diff --git a/extra/start-here.py b/extra/start-here.py index 03f5e5c..36a780c 100644 --- a/extra/start-here.py +++ b/extra/start-here.py @@ -24,16 +24,19 @@ class StinkyPinkyPacket(ip.Packet): is deemed to not be part of the packet's data, it should be returned. Likewise, if the Packet needs more data, raise ip.NeedsMoreData - self.parts - a magic bag of values. self.parts[:-1] is highlighted when - printed iff the value == length(self.payload) - + self.parts - a magic bag of values; (!) when the value matches len(self.payload) self.payload - non-header packet data + self.opcode - an integer that triggers additional parsing + self.text - text to be displayed without prep (i.e. shell output) + self.html - html information for logging - self.opcode - an integer that triggers additional parsing, or special - display + return: + + If you need more data, raise ip.NeedMoreData() + If you have excess data, return it from this function ''' - self.parts = unpack(" .time { float: right; margin-left: 1em; font-size: 75%%; } .server { background-color: white; color: black; } - .client { background-color: #884; color: white; } + .client { background-color: #a8a8a8; color: black; } @@ -806,3 +816,13 @@ class HtmlSession(Session): self.sessfd.write('%s' % (cls, ts, cls)) self.sessfd.write(p.replace('\r\n', '\n')) self.sessfd.write('') + + def process(self, packet): + if self.debug: + packet.show() + if hasattr(packet, "html") and packet.html is not None: + self.log(packet.firstframe, packet.html, False) + if hasattr(packet, "text") and packet.text is not None: + if self.debug: + sys.stdout.write(packet.text) + self.log(packet.firstframe, packet.text, True)