def frag_joiner(ack, src_ip_port, load):
 for ip_port in pkt_frag_loads:
  if (src_ip_port == ip_port):
   if (ack in pkt_frag_loads[src_ip_port]):
    old_load = pkt_frag_loads[src_ip_port][ack]
    concat_load = (old_load + load)
    return OrderedDict([(ack, concat_load)])
 return OrderedDict([(ack, load)])

def frag_joiner ( ack , src_ip_port , load ) : for ip_port in pkt_frag_loads : if ( src_ip_port == ip_port ) : if ( ack in pkt_frag_loads [ src_ip_port ] ) : old_load = pkt_frag_loads [ src_ip_port ] [ ack ] concat_load = ( old_load + load ) return OrderedDict ( [ ( ack , concat_load ) ] ) return OrderedDict ( [ ( ack , load ) ] )
keep a store of previous fragments in an ordereddict named pkt_frag_loads .