def process_IAC(self, sock, cmd, option):
if cmd == DO:<EOL><INDENT>if option == TM:<EOL><INDENT>os.write(self.remote, IAC + WILL + TM)<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>elif cmd == IP:<EOL><INDENT>os.write(self.local, IPRESP)<EOL><DEDENT>elif cmd == SB:<EOL><INDENT>pass<EOL><DEDENT>elif cmd == SE:<EOL><INDENT>option = self.sbdataq[<NUM_LIT:0>]<EOL>if option == NAWS[<NUM_LIT:0>]:<EOL><INDENT>cols = six.indexbytes(self.sbdataq, <NUM_LIT:1>)<EOL>rows = six.indexbytes(self.sbdataq, <NUM_LIT:2>)<EOL>s = struct.pack('<STR_LIT>', rows, cols, <NUM_LIT:0>, <NUM_LIT:0>)<EOL>fcntl.ioctl(self.local, termios.TIOCSWINSZ, s)<EOL><DEDENT><DEDENT>elif cmd == DONT:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>
Read in and parse IAC commands as passed by telnetlib.

SB/SE commands are stored in sbdataq, and passed in w/ a command
of SE.