- Timestamp:
- 02/21/14 10:38:06 (8 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:
- a31777e
- Parents:
- 86bec15
- Location:
- lib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_erf.c
r98d4e2d rf7bcbfb 637 637 /* Flags. Can't do this */ 638 638 memset(&erfhdr.flags,1,sizeof(erfhdr.flags)); 639 if (trace_get_direction(packet)!= ~0U)639 if (trace_get_direction(packet)!=TRACE_DIR_UNKNOWN) 640 640 erfhdr.flags.iface = trace_get_direction(packet); 641 641 -
lib/format_pcap.c
rc909fad rf7bcbfb 463 463 * pop off the top header until it can be converted 464 464 */ 465 while (libtrace_to_pcap_linktype(linktype)== ~0U) {465 while (libtrace_to_pcap_linktype(linktype)==TRACE_DLT_ERROR) { 466 466 if (!demote_packet(packet)) { 467 467 trace_set_err_out(libtrace, -
lib/format_pcapfile.c
raccdd5b rf7bcbfb 426 426 /* Silently discard RT metadata packets and packets with an 427 427 * unknown linktype. */ 428 if (linktype == TRACE_TYPE_NONDATA || linktype == ~0U) {428 if (linktype == TRACE_TYPE_NONDATA || linktype == TRACE_TYPE_UNKNOWN) { 429 429 return 0; 430 430 } … … 433 433 * pop off the top header until it can be converted 434 434 */ 435 while (libtrace_to_pcap_linktype(linktype)== ~0U) {435 while (libtrace_to_pcap_linktype(linktype)==TRACE_DLT_ERROR) { 436 436 if (!demote_packet(packet)) { 437 437 trace_set_err_out(out, -
lib/libtrace.h.in
rc04929c rf7bcbfb 249 249 */ 250 250 typedef enum { 251 /* Special value used to indicate a failure to convert to libtrace 252 * DLT */ 253 TRACE_DLT_ERROR = -1, 254 251 255 /** pcap documents this as having the Address Family value in host byte order as the 252 256 * framing. Ugly? Yes. … … 279 283 /** Enumeration of link layer types supported by libtrace */ 280 284 typedef enum { 285 TRACE_TYPE_UNKNOWN = -1, /**< Unable to determine link type */ 281 286 /* TRACE_TYPE_LEGACY = 0 Obsolete */ 282 287 TRACE_TYPE_HDLC_POS = 1, /**< HDLC over POS */ … … 487 492 TRACE_DIR_OUTGOING = 0, /**< Packets originating "inside" */ 488 493 TRACE_DIR_INCOMING = 1, /**< Packets originating "outside" */ 489 TRACE_DIR_OTHER = 2 /**< Packets with an unknown direction, or one that's unknown */ 494 TRACE_DIR_OTHER = 2, /**< Packets with an unknown direction, or one that's unknown */ 495 TRACE_DIR_UNKNOWN = -1, /**< No direction information available */ 490 496 } libtrace_direction_t; 491 497 -
lib/linktypes.c
r77f79c7 rf7bcbfb 67 67 case TRACE_DLT_OPENBSD_LOOP: return TRACE_TYPE_OPENBSD_LOOP; 68 68 /* Unhandled */ 69 case TRACE_DLT_ERROR: 69 70 case TRACE_DLT_NULL: /* Raw IP frame with a BSD specific 70 71 * header If you want raw L3 headers … … 73 74 break; 74 75 } 75 return ~0U;76 return TRACE_TYPE_UNKNOWN; 76 77 } 77 78 … … 115 116 case TRACE_TYPE_NONDATA: 116 117 break; 117 } 118 return ~0U; 118 case TRACE_TYPE_UNKNOWN: 119 break; 120 } 121 return TRACE_DLT_ERROR; 119 122 } 120 123 … … 203 206 case TRACE_TYPE_NONDATA: 204 207 case TRACE_TYPE_OPENBSD_LOOP: 208 case TRACE_TYPE_UNKNOWN: 205 209 break; 206 210 } -
lib/protocols_l2.c
r77f79c7 rf7bcbfb 390 390 case TRACE_TYPE_PFLOG: 391 391 break; 392 case TRACE_TYPE_UNKNOWN: 393 return NULL; 392 394 } 393 395 … … 423 425 case TRACE_TYPE_PFLOG: 424 426 break; 427 case TRACE_TYPE_UNKNOWN: 428 return NULL; 425 429 } 426 430 … … 464 468 void *l; 465 469 466 if (linktype == ~0U) {470 if (linktype == TRACE_TYPE_UNKNOWN) { 467 471 fprintf(stderr, "Unable to determine linktype for packet\n"); 468 472 return NULL; … … 486 490 case TRACE_TYPE_METADATA: 487 491 case TRACE_TYPE_NONDATA: 492 case TRACE_TYPE_UNKNOWN: 488 493 return NULL; 489 494 … … 587 592 case TRACE_TYPE_NONDATA: 588 593 case TRACE_TYPE_OPENBSD_LOOP: 594 case TRACE_TYPE_UNKNOWN: 589 595 return NULL; 590 596 … … 635 641 case TRACE_TYPE_NONDATA: 636 642 case TRACE_TYPE_OPENBSD_LOOP: 643 case TRACE_TYPE_UNKNOWN: 637 644 /* No MAC address */ 638 645 return NULL; -
lib/protocols_pktmeta.c
r77f79c7 rf7bcbfb 162 162 case TRACE_TYPE_NONDATA: 163 163 case TRACE_TYPE_OPENBSD_LOOP: 164 case TRACE_TYPE_UNKNOWN: 164 165 return NULL; 165 166 } … … 218 219 case TRACE_TYPE_NONDATA: 219 220 case TRACE_TYPE_OPENBSD_LOOP: 221 case TRACE_TYPE_UNKNOWN: 220 222 /* In this case, the pointer passed in does not point 221 223 * to a metadata header and so we cannot get the -
lib/trace.c
rc04929c rf7bcbfb 1075 1075 if (packet->link_type == 0) { 1076 1076 if (!packet->trace->format->get_link_type) 1077 return (libtrace_linktype_t)-1;1077 return TRACE_TYPE_UNKNOWN; 1078 1078 ((libtrace_packet_t *)packet)->link_type = 1079 1079 packet->trace->format->get_link_type(packet); … … 1216 1216 return -1; 1217 1217 } 1218 if (libtrace_to_pcap_dlt(linktype) == ~1U) {1218 if (libtrace_to_pcap_dlt(linktype) == TRACE_DLT_ERROR) { 1219 1219 trace_set_err(packet->trace,TRACE_ERR_BAD_FILTER, 1220 1220 "Unknown pcap equivalent linktype"); … … 1267 1267 return 1; 1268 1268 1269 if (libtrace_to_pcap_dlt(linktype)== ~0U) {1269 if (libtrace_to_pcap_dlt(linktype)==TRACE_DLT_ERROR) { 1270 1270 1271 1271 /* If we cannot get a suitable DLT for the packet, it may … … 1280 1280 free_packet_needed=true; 1281 1281 1282 while (libtrace_to_pcap_dlt(linktype) == ~0U) {1282 while (libtrace_to_pcap_dlt(linktype) == TRACE_DLT_ERROR) { 1283 1283 if (!demote_packet(packet_copy)) { 1284 1284 trace_set_err(packet->trace,
Note: See TracChangeset
for help on using the changeset viewer.