'Process subnegotiation, the data between IAC SB and IAC SE.'

def _telnet_process_subnegotiation(self, suboption):

    if (suboption[0:1] == COM_PORT_OPTION):
        if ((suboption[1:2] == SERVER_NOTIFY_LINESTATE) and (len(suboption) >= 3)):
            self._linestate = ord(suboption[2:3])
            if self.logger:
                self.logger.info('NOTIFY_LINESTATE:    {}'.format(self._linestate))
        elif ((suboption[1:2] == SERVER_NOTIFY_MODEMSTATE) and (len(suboption) >= 3)):
            self._modemstate = ord(suboption[2:3])
            if self.logger:
                self.logger.info('NOTIFY_MODEMSTATE:    {}'.format(self._modemstate))
            self._modemstate_timeout.restart(0.3)
        elif (suboption[1:2] == FLOWCONTROL_SUSPEND):
            self._remote_suspend_flow = True
        elif (suboption[1:2] == FLOWCONTROL_RESUME):
            self._remote_suspend_flow = False
        else:
            for item in self._rfc2217_options.values():
                if (item.ack_option == suboption[1:2]):
                    item.check_answer(bytes(suboption[2:]))
                    break
            else:
                if self.logger:
                    self.logger.warning('ignoring    COM_PORT_OPTION:    {!r}'.format(suboption))
    elif self.logger:
        self.logger.warning('ignoring    subnegotiation:    {!r}'.format(suboption))
