All pastes #640026 Raw Edit

Stuff

public c v1 · immutable
#640026 ·published 2007-07-31 01:11 UTC
rendered paste body
void per_packet(libtrace_packet **pkt){  trace_defrag_t res = trace_defrag_push_packet(*pkt);  libtrace_packet *p = *pkt;   do {    switch (res) {      case TRACE_DEFRAG_UNNEEDED:          /* code here */          printf("%d\n",trace_get_capture_length(p));          break;      case TRACE_DEFRAG_REASSEMBLED:          /* code here */          printf("%d\n",trace_get_capture_length(p));          trace_destroy_packet(p);          break;      case TRACE_DEFRAG_TIMED_OUT:          printf("Reassembly timed out\n");          trace_destroy_packet(p);          break;      case TRACE_DEFRAG_ALTERNATE:          trace_destroy_packet(p);          break;      case TRACE_DEFRAG_WAITING:          pkt=NULL;          break;      default:          assert(0);    }  } while ( p = trace_defrag_pop_packet(defrag, &res));  if (!*pkt)    *pkt=trace_create_packet();}