def _handle(self, flow, message): if not message.parsed: # if this is the first message in the connection we just skip it return 'done' for msg in message.parsed: typ = structs.message_type(msg, from_frontend=message.from_client) if typ == self.packet_kind: matches = structs.message_matches(msg, self.filters, message.from_client) if matches: return 'pass' return 'done'
def isTerminate(msg, from_client): kind = structs.message_type(msg, from_client) return kind == 'Terminate'