Changeset 14d8a63 for lib/trace.c
- Timestamp:
- 11/25/05 16:12:39 (17 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 3840760
- Parents:
- e9fa643
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
rf3ed52a r14d8a63 488 488 } 489 489 490 /** Create a new packet object 491 * 492 * @ return a pointer to an initialised libtrace_packet_t structure 493 */ 494 struct libtrace_packet_t *trace_packet_create() { 495 struct libtrace_packet_t *packet = calloc(1,sizeof(struct libtrace_packet_t)); 496 packet->buffer = malloc(LIBTRACE_PACKET_BUFSIZE); 497 packet->buf_control = PACKET; 498 return packet; 499 } 500 501 /** Destroy a packet object 502 * 503 * sideeffect: sets packet to NULL 504 */ 505 void trace_packet_destroy(struct libtrace_packet_t **packet) { 506 if ((*packet)->buf_control) { 507 free((*packet)->buffer); 508 } 509 free((*packet)); 510 packet = NULL; 511 } 512 490 513 /* Read one packet from the trace into buffer 491 514 * … … 543 566 */ 544 567 void *trace_get_link(const struct libtrace_packet_t *packet) { 568 return (void *)packet->payload; 569 /* 545 570 const void *ethptr = 0; 546 571 … … 551 576 } 552 577 return (void *)ethptr; 578 */ 553 579 } 554 580
Note: See TracChangeset
for help on using the changeset viewer.