All pastes #640067 Raw Edit

Stuff

public c v1 · immutable
#640067 ·published 2007-07-31 01:47 UTC
rendered paste body
void per_packet(libtrace_packet **pkt){  libtrace_packet_t *p;  libtrace_defrag_reason_t reason;  trace_defrag_push_packet(*pkt);    *pkt = NULL;  while (p = trace_defrag_pop_packet(*pkt,&reason)) {     if (*pkt)       trace_destroy_packet(*pkt);     *pkt = p;     switch (reason) {       case TRACE_DEFRAG_REASSEMBLED:         printf("%d\n",trace_get_capture_length(p));         break;       case TRACE_DEFRAG_TIMEDOUT:         printf("reassembly timed out\n");         break;       case TRACE_DEFRAG_ALTERNATE:         printf("alternate %d\n",trace_get_capture_length(p));         break;     }  }  if (!*pkt)     *pkt = trace_create_packet();}