Changeset 1269
- Timestamp:
- 06/09/07 01:07:07 (1 year ago)
- Files:
-
- trunk/lib/format_pcap.c (modified) (8 diffs)
- trunk/lib/format_pcapfile.c (modified) (8 diffs)
- trunk/lib/libtrace.h.in (modified) (6 diffs)
- trunk/lib/libtrace_int.h (modified) (1 diff)
- trunk/lib/linktypes.c (modified) (1 diff)
- trunk/lib/protocols.c (modified) (15 diffs)
- trunk/lib/trace.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/format_pcap.c
r1247 r1269 313 313 { 314 314 struct pcap_pkthdr pcap_pkt_hdr; 315 void *link; 316 libtrace_linktype_t linktype; 317 uint32_t remaining; 318 319 link = trace_get_packet_buffer(packet,&linktype,&remaining); 315 320 316 321 /* If this packet cannot be converted to a pcap linktype then 317 322 * pop off the top header until it can be converted 318 323 */ 319 while (libtrace_to_pcap_linktype( trace_get_link_type(packet))==~0U) {324 while (libtrace_to_pcap_linktype(linktype)==~0U) { 320 325 if (!demote_packet(packet)) { 321 326 trace_set_err_out(libtrace, … … 324 329 return -1; 325 330 } 331 332 link = trace_get_packet_buffer(packet,&linktype,&remaining); 326 333 } 327 334 … … 346 353 347 354 /* Corrupt packet, or other "non data" packet, so skip it */ 348 if ( trace_get_link(packet)== NULL) {355 if (link == NULL) { 349 356 /* Return "success", but nothing written */ 350 357 return 0; … … 363 370 pcap_pkt_hdr.ts.tv_sec = ts.tv_sec; 364 371 pcap_pkt_hdr.ts.tv_usec = ts.tv_usec; 365 pcap_pkt_hdr.caplen = trace_get_capture_length(packet);372 pcap_pkt_hdr.caplen = remaining; 366 373 /* trace_get_wire_length includes FCS, while pcap doesn't */ 367 374 if (trace_get_link_type(packet)==TRACE_TYPE_ETH) … … 442 449 { 443 450 libtrace_sll_header_t *sll; 444 sll = trace_get_link(packet); 451 sll = trace_get_packet_buffer(packet, NULL, NULL); 452 /* TODO: should check remaining>=sizeof(*sll) */ 445 453 if (!sll) { 446 454 trace_set_err(packet->trace, … … 471 479 { 472 480 libtrace_pflog_header_t *pflog; 473 pflog = trace_get_link(packet); 481 pflog = trace_get_packet_buffer(packet, NULL, NULL); 482 /* TODO: should check remaining >= sizeof(*pflog) */ 474 483 if (!pflog) { 475 484 trace_set_err(packet->trace, … … 518 527 return pcapptr->len+4; /* Include the missing FCS */ 519 528 else if (packet->type==pcap_linktype_to_rt(TRACE_DLT_IEEE802_11_RADIO)) { 529 libtrace_linktype_t linktype; 530 void *link = trace_get_packet_buffer(packet,&linktype,NULL); 520 531 /* If the packet is Radiotap and the flags field indicates 521 532 * that the FCS is not included in the 802.11 frame, then … … 523 534 */ 524 535 uint8_t flags; 525 trace_get_wireless_flags( trace_get_link(packet),526 trace_get_link_type(packet), &flags);536 trace_get_wireless_flags(link, 537 linktype, &flags); 527 538 if ((flags & TRACE_RADIOTAP_F_FCS) == 0) 528 539 return pcapptr->len + 4; trunk/lib/format_pcapfile.c
r1246 r1269 281 281 int numbytes; 282 282 int ret; 283 void *ptr; 284 uint32_t remaining; 285 libtrace_linktype_t linktype; 286 287 ptr = trace_get_packet_buffer(packet,&linktype,&remaining); 283 288 284 289 /* If this packet cannot be converted to a pcap linktype then 285 290 * pop off the top header until it can be converted 286 291 */ 287 while (libtrace_to_pcap_linktype( trace_get_link_type(packet))==~0U) {292 while (libtrace_to_pcap_linktype(linktype)==~0U) { 288 293 if (!demote_packet(packet)) { 289 294 trace_set_err_out(out, … … 292 297 return -1; 293 298 } 299 300 ptr = trace_get_packet_buffer(packet,&linktype,&remaining); 294 301 } 295 302 … … 314 321 pcaphdr.snaplen = 65536; 315 322 pcaphdr.network = 316 libtrace_to_pcap_linktype(trace_get_link_type(packet)); 317 318 libtrace_io_write(DATAOUT(out)->file, &pcaphdr, sizeof(pcaphdr)); 323 libtrace_to_pcap_linktype(linktype); 324 325 libtrace_io_write(DATAOUT(out)->file, 326 &pcaphdr, sizeof(pcaphdr)); 319 327 } 320 328 … … 323 331 hdr.caplen = trace_get_capture_length(packet); 324 332 /* PCAP doesn't include the FCS, we do */ 325 if ( trace_get_link_type(packet)==TRACE_TYPE_ETH)333 if (linktype==TRACE_TYPE_ETH) 326 334 if (trace_get_wire_length(packet) >= 4) { 327 hdr.wirelen = 328 trace_get_wire_length(packet)-4; 335 hdr.wirelen = trace_get_wire_length(packet)-4; 329 336 } 330 337 else { … … 342 349 343 350 ret=libtrace_io_write(DATAOUT(out)->file, 344 trace_get_link(packet),345 trace_get_capture_length(packet));346 347 if (ret!=(int) trace_get_capture_length(packet))351 link, 352 remaining); 353 354 if (ret!=(int)remaining) 348 355 return -1; 349 356 … … 371 378 { 372 379 libtrace_sll_header_t *sll; 373 sll = (libtrace_sll_header_t*)trace_get_link(packet); 380 libtrace_linktype_t linktype; 381 382 sll = (libtrace_sll_header_t*)trace_get_packet_buffer( 383 packet, 384 &linktype, 385 NULL); 374 386 if (!sll) { 375 387 trace_set_err(packet->trace, … … 400 412 { 401 413 libtrace_pflog_header_t *pflog; 402 pflog=(libtrace_pflog_header_t*)trace_get_link(packet); 414 libtrace_linktype_t linktype; 415 416 pflog=(libtrace_pflog_header_t*)trace_get_packet_buffer( 417 packet,&linktype,NULL); 403 418 if (!pflog) { 404 419 trace_set_err(packet->trace, … … 455 470 */ 456 471 uint8_t flags; 457 trace_get_wireless_flags(trace_get_link(packet), 458 trace_get_link_type(packet), &flags); 472 void *link; 473 libtrace_linktype_t linktype; 474 link = trace_get_packet_buffer(packet, &linktype, NULL); 475 trace_get_wireless_flags(link, linktype, &flags); 459 476 if ((flags & TRACE_RADIOTAP_F_FCS) == 0) 460 477 return swapl(packet->trace,pcapptr->wirelen)+4; trunk/lib/libtrace.h.in
r1268 r1269 397 397 int16_t ip_id; /**< Identification */ 398 398 #if BYTE_ORDER == LITTLE_ENDIAN 399 LT_BITFIELD16 ip_off:1 2; /**< Fragment Offset */399 LT_BITFIELD16 ip_off:13; /**< Fragment Offset */ 400 400 LT_BITFIELD16 ip_mf:1; /**< More Fragments Flag */ 401 401 LT_BITFIELD16 ip_df:1; /**< Dont Fragment Flag */ … … 405 405 LT_BITFIELD16 ip_df:1; /**< More Fragments Flag */ 406 406 LT_BITFIELD16 ip_mf:1; /**< Dont Fragment Flag */ 407 LT_BITFIELD16 ip_off:1 2; /**< Reserved Fragment Flag */407 LT_BITFIELD16 ip_off:13; /**< Reserved Fragment Flag */ 408 408 #else 409 409 # error "Adjust your <bits/endian.h> defines" … … 1063 1063 uint32_t *remaining); 1064 1064 1065 /** Gets a pointer to the next header given a pointer to a layer2 header 1066 * 1067 * @param l2 The pointer to the current layer2 header 1068 * @param linktype The type of the layer2 header 1069 * @param[out] ethertype An optional output variable of the ethernet type 1070 * @param[in,out] remaining Optionally updated with the length remaining 1071 * 1072 * @return a pointer to the transport layer header, or NULL if header isn't 1073 * present. 1074 * 1075 * type may be NULL if not needed. 1076 * 1077 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1078 * of bytes captured of the layer2 header and beyond. It will be updated after 1079 * this function to the number of bytes remaining after the layer2 header 1080 * was removed. 1081 * 1082 */ 1083 DLLEXPORT void *trace_get_payload_from_layer2(void *l2, 1084 libtrace_linktype_t linktype, 1085 uint16_t *ethertype, 1086 uint32_t *remaining); 1087 1088 1065 1089 /** Get a pointer to the layer 3 header. 1066 1090 * @param packet The packet opaque pointer … … 1074 1098 */ 1075 1099 DLLEXPORT SIMPLE_FUNCTION 1076 void *trace_get_layer3( libtrace_packet_t *packet,1100 void *trace_get_layer3(const libtrace_packet_t *packet, 1077 1101 uint16_t *ethertype, uint32_t *remaining); 1078 1102 … … 1085 1109 * @note proto may be NULL if proto is unneeded. 1086 1110 */ 1087 DLLEXPORT void *trace_get_transport( libtrace_packet_t *packet, uint8_t *proto,1111 DLLEXPORT void *trace_get_transport(const libtrace_packet_t *packet, uint8_t *proto, 1088 1112 uint32_t *remaining); 1089 1113 … … 1426 1450 */ 1427 1451 DLLEXPORT SIMPLE_FUNCTION 1428 size_t trace_get_capture_length( libtrace_packet_t *packet);1452 size_t trace_get_capture_length(const libtrace_packet_t *packet); 1429 1453 1430 1454 /** Get the size of the packet as it was seen on the wire. trunk/lib/libtrace_int.h
r1266 r1269 373 373 bool demote_packet(libtrace_packet_t *packet); 374 374 375 void *trace_get_payload_from_linux_sll( void *, uint16_t *, uint32_t *);375 void *trace_get_payload_from_linux_sll(const void *, uint16_t *, uint32_t *); 376 376 void *trace_get_payload_from_pos(void *, uint16_t *, uint32_t *); 377 377 DLLEXPORT void *trace_get_payload_from_atm(void *, uint8_t *, uint32_t *); trunk/lib/linktypes.c
r1242 r1269 210 210 switch(pcap_linktype_to_libtrace(rt_to_pcap_linktype(packet->type))) { 211 211 case TRACE_TYPE_NONE: 212 trace_get_payload_from_link( 213 trace_get_link(packet), 214 trace_get_link_type(packet), 215 &hdr->protocol, 216 NULL); 212 trace_get_layer3(packet, &hdr->protocol, NULL); 217 213 hdr->hatype = htons(ARPHRD_PPP); 218 214 hdr->protocol=htons(hdr->protocol); trunk/lib/protocols.c
r1268 r1269 156 156 157 157 /* NB: type is returned as an ARPHRD_ type for SLL*/ 158 void *trace_get_payload_from_linux_sll( void *link,158 void *trace_get_payload_from_linux_sll(const void *link, 159 159 uint16_t *type, uint32_t *remaining) 160 160 { … … 257 257 258 258 /* Returns the 'payload' of the prism header, which is the 802.11 frame */ 259 static void *trace_get_payload_from_prism ( void *link,260 uint16_t *type, uint32_t *remaining)259 static void *trace_get_payload_from_prism (const void *link, 260 libtrace_linktype_t *type, uint32_t *remaining) 261 261 { 262 262 if (remaining) { … … 272 272 273 273 /* Returns the 'payload' of the radiotap header, which is the 802.11 frame */ 274 static void *trace_get_payload_from_radiotap ( void *link,275 uint16_t *type, uint32_t *remaining)274 static void *trace_get_payload_from_radiotap (const void *link, 275 libtrace_linktype_t *type, uint32_t *remaining) 276 276 { 277 277 struct libtrace_radiotap_t *rtap = (struct libtrace_radiotap_t*)link; … … 296 296 switch(linktype) { 297 297 case TRACE_TYPE_80211_PRISM: 298 l = trace_get_payload_from_prism(link, type,remaining);298 l = trace_get_payload_from_prism(link,&linktype,remaining); 299 299 return (l ? trace_get_payload_from_link(l, TRACE_TYPE_80211, type, remaining) : NULL); 300 300 case TRACE_TYPE_80211_RADIO: 301 l = trace_get_payload_from_radiotap(link, type,remaining);301 l = trace_get_payload_from_radiotap(link,&linktype,remaining); 302 302 return (l ? trace_get_payload_from_link(l, TRACE_TYPE_80211, type, remaining) : NULL); 303 303 case TRACE_TYPE_80211: … … 446 446 uint32_t *remaining) 447 447 { 448 uint32_t dummyrem = trace_get_capture_length(packet);448 uint32_t dummyrem; 449 449 450 450 assert(packet != NULL); … … 474 474 return NULL; 475 475 } 476 477 /* Shouldn't get here */ 478 return NULL; 476 479 } 477 480 … … 519 522 return NULL; 520 523 } 524 /* Shouldn't get here */ 525 return NULL; 521 526 } 522 527 … … 553 558 } 554 559 555 DLLEXPORT void *trace_get_layer3(libtrace_packet_t *packet, 560 DLLEXPORT void *trace_get_payload_from_layer2(void *link, 561 libtrace_linktype_t linktype, 562 uint16_t *ethertype, 563 uint32_t *remaining) 564 { 565 void *l; 566 switch(linktype) { 567 /* Packet Metadata headers, not layer2 headers */ 568 case TRACE_TYPE_80211_PRISM: 569 case TRACE_TYPE_80211_RADIO: 570 case TRACE_TYPE_LINUX_SLL: 571 return NULL; 572 573 /* duck packets have no payload! */ 574 case TRACE_TYPE_DUCK: 575 return NULL; 576 577 /* The payload is in these packets does 578 not correspond to a genuine link-layer 579 */ 580 case TRACE_TYPE_METADATA: 581 return NULL; 582 583 case TRACE_TYPE_80211: 584 return trace_get_payload_from_80211(link,ethertype,remaining); 585 case TRACE_TYPE_ETH: 586 return trace_get_payload_from_ethernet(link,ethertype,remaining); 587 case TRACE_TYPE_NONE: 588 if ((*(char*)link&0xF0) == 0x40) 589 *ethertype=0x0800; 590 else if ((*(char*)link&0xF0) == 0x60) 591 *ethertype=0x86DD; 592 return link; /* I love the simplicity */ 593 case TRACE_TYPE_PFLOG: 594 return trace_get_payload_from_pflog(link,ethertype,remaining); 595 case TRACE_TYPE_PPP: 596 return trace_get_payload_from_ppp(link,ethertype,remaining); 597 case TRACE_TYPE_ATM: 598 l=trace_get_payload_from_atm(link,NULL,remaining); 599 /* FIXME: We shouldn't skip llcsnap here, we should return 600 * an ethertype for it (somehow) 601 */ 602 return (l ? trace_get_payload_from_llcsnap(l, 603 ethertype, remaining):NULL); 604 case TRACE_TYPE_LLCSNAP: 605 return trace_get_payload_from_llcsnap(link,ethertype,remaining); 606 607 /* TODO: Unsupported */ 608 case TRACE_TYPE_HDLC_POS: 609 case TRACE_TYPE_POS: 610 case TRACE_TYPE_AAL5: 611 return NULL; 612 } 613 return NULL; 614 615 } 616 617 DLLEXPORT void *trace_get_layer3(const libtrace_packet_t *packet, 556 618 uint16_t *ethertype, 557 619 uint32_t *remaining) … … 561 623 void *link; 562 624 uint32_t dummy_remaining; 625 libtrace_linktype_t linktype; 626 627 if (!ethertype) ethertype=&dummy_ethertype; 628 629 if (!remaining) remaining=&dummy_remaining; 563 630 564 631 /* use l3 cache */ 565 632 if (packet->l3_header) 566 633 { 634 link = trace_get_packet_buffer(packet,&linktype,remaining); 635 636 if (!link) 637 return NULL; 638 567 639 *ethertype = packet->l3_ethertype; 568 *remaining -= (packet->l3_header - trace_get_link(packet)); 640 *remaining -= (packet->l3_header - link); 641 569 642 return packet->l3_header; 570 643 } 571 644 572 if (!ethertype) ethertype=&dummy_ethertype; 573 574 if (!remaining) remaining=&dummy_remaining; 575 576 *remaining = trace_get_capture_length(packet); 577 578 link=trace_get_link(packet); 579 580 if (!link) 581 return NULL; 582 583 iphdr = trace_get_payload_from_link( 645 link = trace_get_layer2(packet,&linktype,remaining); 646 647 iphdr = trace_get_payload_from_layer2( 584 648 link, 585 trace_get_link_type(packet),649 linktype, 586 650 ethertype, 587 651 remaining); … … 613 677 614 678 /* Store values in the cache for later */ 615 packet->l3_ethertype = *ethertype; 616 packet->l3_header = iphdr; 679 /* Cast away constness, nasty, but this is just a cache */ 680 ((libtrace_packet_t*)packet)->l3_ethertype = *ethertype; 681 ((libtrace_packet_t*)packet)->l3_header = iphdr; 617 682 618 683 return iphdr; 619 684 } 620 685 621 DLLEXPORT void *trace_get_transport( libtrace_packet_t *packet,686 DLLEXPORT void *trace_get_transport(const libtrace_packet_t *packet, 622 687 uint8_t *proto, 623 688 uint32_t *remaining … … 632 697 633 698 if (!remaining) remaining=&dummy_remaining; 634 635 *remaining = trace_get_capture_length(packet);636 699 637 700 transport = trace_get_layer3(packet,ðertype,remaining); … … 829 892 } 830 893 831 static 832 uint8_t *__trace_get_source_mac(void *link, libtrace_linktype_t *linktype, uint32_t *rem) { 833 libtrace_ether_t *ethptr = (libtrace_ether_t *) link; 834 uint16_t arphrd; 894 DLLEXPORT uint8_t *trace_get_source_mac(libtrace_packet_t *packet) { 895 void *link; 896 uint32_t remaining; 897 libtrace_linktype_t linktype; 898 assert(packet); 899 link = trace_get_layer2(packet,&linktype,&remaining); 900 835 901 if (!link) 836 902 return NULL; 837 903 838 switch ( *linktype) {904 switch (linktype) { 839 905 case TRACE_TYPE_ETH: 840 return (uint8_t *)& ethptr->ether_shost;906 return (uint8_t *)&(((libtrace_ether_t*)link)->ether_shost); 841 907 case TRACE_TYPE_80211: 842 908 return get_source_mac_from_wifi(link); 843 case TRACE_TYPE_80211_RADIO: 844 link = trace_get_payload_from_radiotap( 845 link, linktype, rem); 846 return __trace_get_source_mac(link, linktype, rem); 847 case TRACE_TYPE_80211_PRISM: 848 link = trace_get_payload_from_prism( 849 link, linktype, rem); 850 return __trace_get_source_mac(link, linktype, rem); 851 case TRACE_TYPE_LINUX_SLL: 852 link = trace_get_payload_from_linux_sll( 853 link, &arphrd, rem); 854 *linktype = arphrd_type_to_libtrace(arphrd); 855 return __trace_get_source_mac(link, linktype, rem); 909 /* These packets don't have MAC addresses */ 856 910 case TRACE_TYPE_POS: 857 911 case TRACE_TYPE_NONE: … … 861 915 case TRACE_TYPE_DUCK: 862 916 case TRACE_TYPE_METADATA: 863 return NULL; 864 default: 917 case TRACE_TYPE_AAL5: 918 case TRACE_TYPE_LLCSNAP: 919 case TRACE_TYPE_PPP: 920 return NULL; 921 922 /* Metadata headers should already be skipped */ 923 case TRACE_TYPE_LINUX_SLL: 924 case TRACE_TYPE_80211_PRISM: 925 case TRACE_TYPE_80211_RADIO: 926 assert(!"Metadata headers should already be skipped"); 865 927 break; 866 928 } 867 fprintf(stderr,"%s not implemented for linktype %i\n", __func__, *linktype);929 fprintf(stderr,"%s not implemented for linktype %i\n", __func__, linktype); 868 930 assert(0); 869 931 return NULL; 870 932 } 871 933 872 DLLEXPORT uint8_t *trace_get_source_mac(libtrace_packet_t *packet) { 873 if (packet == NULL) 874 return NULL; 875 void *link = trace_get_link(packet); 876 uint32_t len = trace_get_capture_length(packet); 877 libtrace_linktype_t lt = trace_get_link_type(packet); 878 return __trace_get_source_mac(link, <, &len); 879 } 880 881 DLLEXPORT uint8_t *trace_get_destination_mac(libtrace_packet_t *packet) { 882 void *link = trace_get_link(packet); 934 DLLEXPORT uint8_t *trace_get_destination_mac(libtrace_packet_t *packet) 935 { 936 void *link; 937 libtrace_linktype_t linktype; 938 uint32_t remaining; 939 940 link = trace_get_layer2(packet,&linktype,&remaining); 941 883 942 libtrace_80211_t *wifi; 884 943 libtrace_ether_t *ethptr = (libtrace_ether_t*)link; 944 945 885 946 if (!link) 886 947 return NULL; 887 switch (trace_get_link_type(packet)) { 948 949 switch (linktype) { 888 950 case TRACE_TYPE_80211: 889 951 wifi=(libtrace_80211_t*)link; … … 928 990 addr=(struct sockaddr*)&dummy; 929 991 930 remaining = trace_get_capture_length(packet);931 932 992 l3 = trace_get_layer3(packet,ðertype,&remaining); 933 993 … … 981 1041 if (!addr) 982 1042 addr=(struct sockaddr*)&dummy; 983 984 remaining = trace_get_capture_length(packet);985 1043 986 1044 l3 = trace_get_layer3(packet,ðertype,&remaining); trunk/lib/trace.c
r1268 r1269 646 646 (libtrace_packet_t *)malloc(sizeof(libtrace_packet_t)); 647 647 dest->trace=packet->trace; 648 dest->buffer=malloc( 649 trace_get_framing_length(packet) 650 +trace_get_capture_length(packet)); 648 dest->buffer=malloc(65536); 651 649 dest->header=dest->buffer; 652 650 dest->payload=(void*) … … 869 867 } 870 868 871 DLLEXPORT size_t trace_get_capture_length( libtrace_packet_t *packet)869 DLLEXPORT size_t trace_get_capture_length(const libtrace_packet_t *packet) 872 870 { 873 871 /* Cache the capture length */ … … 875 873 if (!packet->trace->format->get_capture_length) 876 874 return ~0U; 877 packet->capture_length = 875 /* Cast away constness because this is "just" a cache */ 876 ((libtrace_packet_t*)packet)->capture_length = 878 877 packet->trace->format->get_capture_length(packet); 879 878 } … … 1002 1001 #ifdef HAVE_BPF 1003 1002 void *linkptr = 0; 1003 libtrace_linktype_t linktype; 1004 1004 assert(filter); 1005 1005 1006 1006 /* If this isn't a real packet, then fail */ 1007 linkptr = trace_get_ link(packet);1007 linkptr = trace_get_packet_buffer(packet,&linktype,NULL); 1008 1008 if (!linkptr) { 1009 1009 trace_set_err(packet->trace, … … 1014 1014 if (filter->filterstring && ! filter->flag) { 1015 1015 pcap_t *pcap = NULL; 1016 libtrace_linktype_t linktype=trace_get_link_type(packet);1017 1016 if (linktype==(libtrace_linktype_t)-1) { 1018 1017 trace_set_err(packet->trace, … … 1056 1055 #ifdef HAVE_BPF 1057 1056 void *linkptr = 0; 1058 u nsigned int clen = 0;1057 uint32_t clen = 0; 1059 1058 bool free_packet_needed = false; 1060 1059 int ret; … … 1084 1083 } 1085 1084 1086 linkptr = trace_get_ link(packet_copy);1085 linkptr = trace_get_packet_buffer(packet_copy,NULL,&clen); 1087 1086 if (!linkptr) { 1088 1087 if (free_packet_needed) { … … 1102 1101 } 1103 1102 1104 clen = trace_get_capture_length(packet_copy);1105 1106 1103 assert(filter->flag); 1107 ret=bpf_filter(filter->filter.bf_insns,(u_char*)linkptr, clen,clen);1104 ret=bpf_filter(filter->filter.bf_insns,(u_char*)linkptr,(unsigned int)clen,(unsigned int)clen); 1108 1105 if (free_packet_needed) { 1109 1106 trace_destroy_packet(packet_copy);
