Changeset 528eb6e
- Timestamp:
- 12/04/12 15:24:34 (9 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:
- b4c3f61
- Parents:
- fd87898
- Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/Makefile.am
r60f3c4c r528eb6e 1 1 lib_LTLIBRARIES = libtrace.la 2 include_HEADERS = libtrace.h dagformat.h lt_inttypes.h daglegacy.h rt_protocol.h erftypes.h 2 include_HEADERS = libtrace.h dagformat.h lt_inttypes.h daglegacy.h rt_protocol.h erftypes.h 3 3 4 4 AM_CFLAGS=@LIBCFLAGS@ … … 6 6 7 7 extra_DIST = format_template.c 8 if HAVE_NETPACKET_PACKET_H9 8 NATIVEFORMATS=format_linux.c 10 else11 NATIVEFORMATS=12 endif13 9 14 10 if HAVE_BPF_CAPTURE … … 47 43 $(DAGSOURCE) format_erf.h \ 48 44 $(BPFJITSOURCE) \ 49 arphrd.h45 libtrace_arphrd.h 50 46 51 47 if DAG2_4 -
lib/format_linux.c
rf240823 r528eb6e 33 33 */ 34 34 35 36 #include "libtrace.h"37 #include "libtrace_int.h"38 #include "format_helper.h"39 #include "config.h"40 #include <stdlib.h>41 42 #ifdef HAVE_INTTYPES_H43 # include <inttypes.h>44 #else45 # error "Can't find inttypes.h"46 #endif47 48 #include <sys/socket.h>49 #include <netpacket/packet.h>50 #include <net/ethernet.h>51 #include <net/if_arp.h>52 53 #include <string.h>54 #include <net/if.h>55 #include <sys/ioctl.h>56 #include <errno.h>57 #include <unistd.h>58 59 #include <assert.h>60 61 #include <poll.h>62 #include <sys/mman.h>63 64 35 /* This format module deals with using the Linux Native capture format. 65 36 * … … 72 43 */ 73 44 74 /* Declared in linux/if_arp.h but not in net/if_arp.h sigh */ 75 #ifndef ARPHRD_NONE 76 #define ARPHRD_NONE 0xfffe 77 #endif 45 #include "config.h" 46 #include "libtrace.h" 47 #include "libtrace_int.h" 48 #include "format_helper.h" 49 #include "libtrace_arphrd.h" 50 #include <stdlib.h> 51 #include <errno.h> 52 #include <unistd.h> 53 #include <string.h> 54 #include <assert.h> 55 56 #ifdef HAVE_INTTYPES_H 57 # include <inttypes.h> 58 #else 59 # error "Can't find inttypes.h" 60 #endif 61 62 #ifdef HAVE_NETPACKET_PACKET_H_ 63 64 #include <sys/socket.h> 65 #include <netpacket/packet.h> 66 #include <net/ethernet.h> 67 #include <net/if_arp.h> 68 69 #include <net/if.h> 70 #include <sys/ioctl.h> 71 #include <poll.h> 72 #include <sys/mman.h> 73 74 /* MAX_ORDER is defined in linux/mmzone.h. 10 is default for 2.4 kernel. 75 * max_order will be decreased by one if the ring buffer fails to allocate. 76 * Used to get correct sized buffers from the kernel. 77 */ 78 #define MAX_ORDER 10 79 static unsigned int max_order = MAX_ORDER; 80 81 /* Cached page size, the page size shoudn't be changing */ 82 static int pagesize = 0; 83 84 /* Number of frames in the ring used by both TX and TR rings. More frames 85 * hopefully means less packet loss, especially if traffic comes in bursts. 86 */ 87 #define CONF_RING_FRAMES 0x100 88 89 /* The maximum frames allowed to be waiting in the TX_RING before the kernel is 90 * notified to write them out. Make sure this is less than CONF_RING_FRAMES. 91 * Performance doesn't seem to increase any more when setting this above 10. 92 */ 93 #define TX_MAX_QUEUE 10 94 95 /* Get current frame in the ring buffer*/ 96 #define GET_CURRENT_BUFFER(libtrace) ((void *) FORMAT(libtrace->format_data)->rx_ring + \ 97 (FORMAT(libtrace->format_data)->rxring_offset * FORMAT(libtrace->format_data)->req.tp_frame_size)) 98 99 100 #else /* HAVE_NETPACKET_PACKET_H */ 101 /* Need to know what a sockaddr_ll looks like */ 102 struct sockaddr_ll { 103 uint16_t sll_family; 104 uint16_t sll_protocol; 105 int32_t sll_ifindex; 106 uint16_t sll_hatype; 107 uint8_t sll_pkttype; 108 uint8_t sll_halen; 109 uint8_t sll_addr[8]; 110 }; 111 112 /* Packet types. */ 113 114 #define PACKET_HOST 0 /* To us. */ 115 #define PACKET_BROADCAST 1 /* To all. */ 116 #define PACKET_MULTICAST 2 /* To group. */ 117 #define PACKET_OTHERHOST 3 /* To someone else. */ 118 #define PACKET_OUTGOING 4 /* Originated by us . */ 119 #define PACKET_LOOPBACK 5 120 #define PACKET_FASTROUTE 6 121 122 /* Packet socket options. */ 123 124 #define PACKET_ADD_MEMBERSHIP 1 125 #define PACKET_DROP_MEMBERSHIP 2 126 #define PACKET_RECV_OUTPUT 3 127 #define PACKET_RX_RING 5 128 #define PACKET_STATISTICS 6 129 130 131 #endif /* HAVE_NETPACKET_PACKET_H_ */ 78 132 79 133 struct tpacket_stats { … … 107 161 struct tpacket2_hdr { 108 162 /* Frame status - in use by kernel or libtrace etc. */ 109 __u32tp_status;163 uint32_t tp_status; 110 164 /* Wire length */ 111 __u32tp_len;165 uint32_t tp_len; 112 166 /* Captured length */ 113 __u32tp_snaplen;167 uint32_t tp_snaplen; 114 168 /* Offset in bytes from frame start to the mac (link layer) header */ 115 __u16tp_mac;169 uint16_t tp_mac; 116 170 /* Offset in bytes from frame start to the net (network layer) header */ 117 __u16tp_net;171 uint16_t tp_net; 118 172 /* Timestamp */ 119 __u32tp_sec;120 __u32tp_nsec;173 uint32_t tp_sec; 174 uint32_t tp_nsec; 121 175 /* Not used VLAN tag control information */ 122 __u16tp_vlan_tci;123 __u16tp_padding;176 uint16_t tp_vlan_tci; 177 uint16_t tp_padding; 124 178 }; 125 179 … … 202 256 }; 203 257 204 /* MAX_ORDER is defined in linux/mmzone.h. 10 is default for 2.4 kernel. 205 * max_order will be decreased by one if the ring buffer fails to allocate. 206 * Used to get correct sized buffers from the kernel. 207 */ 208 #define MAX_ORDER 10 209 static unsigned int max_order = MAX_ORDER; 210 211 /* Cached page size, the page size shoudn't be changing */ 212 static int pagesize = 0; 213 214 /* Number of frames in the ring used by both TX and TR rings. More frames 215 * hopefully means less packet loss, especially if traffic comes in bursts. 216 */ 217 #define CONF_RING_FRAMES 0x100 218 219 /* The maximum frames allowed to be waiting in the TX_RING before the kernel is 220 * notified to write them out. Make sure this is less than CONF_RING_FRAMES. 221 * Performance doesn't seem to increase any more when setting this above 10. 222 */ 223 #define TX_MAX_QUEUE 10 258 /* Get the sockaddr_ll structure from a frame */ 259 #define GET_SOCKADDR_HDR(x) ((struct sockaddr_ll *) (((char *) (x))\ 260 + TPACKET_ALIGN(sizeof(struct tpacket2_hdr)))) 261 262 #define TPACKET_HDRLEN TPACKET2_HDRLEN 263 264 #define FORMAT(x) ((struct linux_format_data_t*)(x)) 265 #define DATAOUT(x) ((struct linux_output_format_data_t*)((x)->format_data)) 224 266 225 267 /* Get the start of the captured data. I'm not sure if tp_mac (link layer) is … … 229 271 ((mac) > (hdrend) && (mac) < (net) ? (mac) : (net)) 230 272 231 /* Get current frame in the ring buffer*/ 232 #define GET_CURRENT_BUFFER(libtrace) ((void *) FORMAT(libtrace->format_data)->rx_ring + \ 233 (FORMAT(libtrace->format_data)->rxring_offset * FORMAT(libtrace->format_data)->req.tp_frame_size)) 234 235 /* Get the sockaddr_ll structure from a frame */ 236 #define GET_SOCKADDR_HDR(x) ((struct sockaddr_ll *) (((char *) (x))\ 237 + TPACKET_ALIGN(sizeof(struct tpacket2_hdr)))) 238 239 #define TPACKET_HDRLEN TPACKET2_HDRLEN 240 241 #define FORMAT(x) ((struct linux_format_data_t*)(x)) 242 #define DATAOUT(x) ((struct linux_output_format_data_t*)((x)->format_data)) 243 273 274 #ifdef HAVE_NETPACKET_PACKET_H_ 244 275 245 276 /* … … 309 340 assert(req->tp_block_size % req->tp_frame_size == 0); 310 341 } 342 311 343 312 344 static int linuxnative_probe_filename(const char *filename) … … 748 780 return -1; 749 781 } 750 751 static int linuxnative_prepare_packet(libtrace_t *libtrace, 782 #endif /* HAVE_NETPACKET_PACKET_H_ */ 783 784 static int linuxnative_prepare_packet(libtrace_t *libtrace UNUSED, 752 785 libtrace_packet_t *packet, void *buffer, 753 786 libtrace_rt_types_t rt_type, uint32_t flags) { … … 770 803 packet->type = rt_type; 771 804 805 /* 772 806 if (libtrace->format_data == NULL) { 773 807 if (linuxnative_init_input(libtrace)) 774 808 return -1; 775 809 } 810 */ 776 811 return 0; 777 812 778 813 } 779 814 780 static int linuxring_prepare_packet(libtrace_t *libtrace ,815 static int linuxring_prepare_packet(libtrace_t *libtrace UNUSED, 781 816 libtrace_packet_t *packet, void *buffer, 782 817 libtrace_rt_types_t rt_type, uint32_t flags) { … … 802 837 packet->type = rt_type; 803 838 839 /* 804 840 if (libtrace->format_data == NULL) { 805 841 if (linuxnative_init_input(libtrace)) 806 842 return -1; 807 843 } 844 */ 808 845 return 0; 809 846 … … 814 851 /* 20 isn't enough on x86_64 */ 815 852 #define CMSG_BUF_SIZE 128 853 854 #ifdef HAVE_NETPACKET_PACKET_H_ 816 855 static int linuxnative_read_packet(libtrace_t *libtrace, libtrace_packet_t *packet) 817 856 { … … 1128 1167 1129 1168 } 1169 #endif /* HAVE_NETPACKET_PACKET_H_ */ 1130 1170 1131 1171 static inline libtrace_linktype_t get_libtrace_link_type(uint16_t linktype){ 1132 1172 /* Convert the ARPHRD type into an appropriate libtrace link type */ 1133 1173 switch (linktype) { 1134 case ARPHRD_ETHER:1135 case ARPHRD_LOOPBACK:1174 case LIBTRACE_ARPHRD_ETHER: 1175 case LIBTRACE_ARPHRD_LOOPBACK: 1136 1176 return TRACE_TYPE_ETH; 1137 case ARPHRD_PPP:1177 case LIBTRACE_ARPHRD_PPP: 1138 1178 return TRACE_TYPE_NONE; 1139 case ARPHRD_80211_RADIOTAP:1179 case LIBTRACE_ARPHRD_IEEE80211_RADIOTAP: 1140 1180 return TRACE_TYPE_80211_RADIO; 1141 case ARPHRD_IEEE80211:1181 case LIBTRACE_ARPHRD_IEEE80211: 1142 1182 return TRACE_TYPE_80211; 1143 case ARPHRD_SIT:1144 case ARPHRD_NONE:1183 case LIBTRACE_ARPHRD_SIT: 1184 case LIBTRACE_ARPHRD_NONE: 1145 1185 return TRACE_TYPE_NONE; 1146 1186 default: /* shrug, beyond me! */ … … 1359 1399 return UINT64_MAX; 1360 1400 } 1361 1401 1402 #ifdef HAVE_NETPACKET_PACKET_H_ 1362 1403 if ((FORMAT(trace->format_data)->stats_valid & 1) 1363 1404 || FORMAT(trace->format_data)->stats_valid == 0) { … … 1372 1413 1373 1414 return FORMAT(trace->format_data)->stats.tp_packets; 1415 #else 1416 return UINT64_MAX; 1417 #endif 1374 1418 } 1375 1419 … … 1386 1430 } 1387 1431 1432 #ifdef HAVE_NETPACKET_PACKET_H_ 1388 1433 if ((FORMAT(trace->format_data)->stats_valid & 2) 1389 1434 || (FORMAT(trace->format_data)->stats_valid==0)) { … … 1398 1443 1399 1444 return FORMAT(trace->format_data)->stats.tp_drops; 1400 } 1401 1445 #else 1446 return UINT64_MAX; 1447 #endif 1448 } 1449 1450 #ifdef HAVE_NETPACKET_PACKET_H_ 1402 1451 static void linuxnative_help(void) { 1403 1452 printf("linuxnative format module: $Revision$\n"); … … 1460 1509 linuxnative_get_captured_packets,/* get_captured_packets */ 1461 1510 linuxnative_get_fd, /* get_fd */ 1462 trace_event_device,/* trace_event */1511 NULL, /* trace_event */ 1463 1512 linuxnative_help, /* help */ 1464 1513 NULL … … 1507 1556 NULL 1508 1557 }; 1558 #else 1559 static void linuxnative_help(void) { 1560 printf("linuxnative format module: $Revision$\n"); 1561 printf("Not supported on this host\n"); 1562 } 1563 static void linuxring_help(void) { 1564 printf("linuxring format module: $Revision$\n"); 1565 printf("Not supported on this host\n"); 1566 } 1567 1568 static struct libtrace_format_t linuxnative = { 1569 "int", 1570 "$Id$", 1571 TRACE_FORMAT_LINUX_NATIVE, 1572 NULL, /* probe filename */ 1573 NULL, /* probe magic */ 1574 NULL, /* init_input */ 1575 NULL, /* config_input */ 1576 NULL, /* start_input */ 1577 NULL, /* pause_input */ 1578 NULL, /* init_output */ 1579 NULL, /* config_output */ 1580 NULL, /* start_ouput */ 1581 NULL, /* fin_input */ 1582 NULL, /* fin_output */ 1583 NULL, /* read_packet */ 1584 linuxnative_prepare_packet, /* prepare_packet */ 1585 NULL, /* fin_packet */ 1586 NULL, /* write_packet */ 1587 linuxnative_get_link_type, /* get_link_type */ 1588 linuxnative_get_direction, /* get_direction */ 1589 linuxnative_set_direction, /* set_direction */ 1590 NULL, /* get_erf_timestamp */ 1591 linuxnative_get_timeval, /* get_timeval */ 1592 linuxnative_get_timespec, /* get_timespec */ 1593 NULL, /* get_seconds */ 1594 NULL, /* seek_erf */ 1595 NULL, /* seek_timeval */ 1596 NULL, /* seek_seconds */ 1597 linuxnative_get_capture_length, /* get_capture_length */ 1598 linuxnative_get_wire_length, /* get_wire_length */ 1599 linuxnative_get_framing_length, /* get_framing_length */ 1600 linuxnative_set_capture_length, /* set_capture_length */ 1601 NULL, /* get_received_packets */ 1602 linuxnative_get_filtered_packets,/* get_filtered_packets */ 1603 linuxnative_get_dropped_packets,/* get_dropped_packets */ 1604 linuxnative_get_captured_packets,/* get_captured_packets */ 1605 linuxnative_get_fd, /* get_fd */ 1606 trace_event_device, /* trace_event */ 1607 linuxnative_help, /* help */ 1608 NULL 1609 }; 1610 1611 static struct libtrace_format_t linuxring = { 1612 "ring", 1613 "$Id$", 1614 TRACE_FORMAT_LINUX_RING, 1615 NULL, /* probe filename */ 1616 NULL, /* probe magic */ 1617 NULL, /* init_input */ 1618 NULL, /* config_input */ 1619 NULL, /* start_input */ 1620 NULL, /* pause_input */ 1621 NULL, /* init_output */ 1622 NULL, /* config_output */ 1623 NULL, /* start_ouput */ 1624 NULL, /* fin_input */ 1625 NULL, /* fin_output */ 1626 NULL, /* read_packet */ 1627 linuxring_prepare_packet, /* prepare_packet */ 1628 NULL, /* fin_packet */ 1629 NULL, /* write_packet */ 1630 linuxring_get_link_type, /* get_link_type */ 1631 linuxring_get_direction, /* get_direction */ 1632 linuxring_set_direction, /* set_direction */ 1633 NULL, /* get_erf_timestamp */ 1634 linuxring_get_timeval, /* get_timeval */ 1635 linuxring_get_timespec, /* get_timespec */ 1636 NULL, /* get_seconds */ 1637 NULL, /* seek_erf */ 1638 NULL, /* seek_timeval */ 1639 NULL, /* seek_seconds */ 1640 linuxring_get_capture_length, /* get_capture_length */ 1641 linuxring_get_wire_length, /* get_wire_length */ 1642 linuxring_get_framing_length, /* get_framing_length */ 1643 linuxring_set_capture_length, /* set_capture_length */ 1644 NULL, /* get_received_packets */ 1645 linuxnative_get_filtered_packets,/* get_filtered_packets */ 1646 linuxnative_get_dropped_packets,/* get_dropped_packets */ 1647 linuxnative_get_captured_packets,/* get_captured_packets */ 1648 linuxnative_get_fd, /* get_fd */ 1649 NULL, /* trace_event */ 1650 linuxring_help, /* help */ 1651 NULL 1652 }; 1653 1654 #endif /* HAVE_NETPACKET_PACKET_H */ 1655 1509 1656 1510 1657 void linuxnative_constructor(void) { -
lib/format_rt.c
rfd87898 r528eb6e 310 310 * is pretty nasty, but also very rare. 311 311 */ 312 #define RT_BUF_SIZE 10000U312 #define RT_BUF_SIZE (LIBTRACE_PACKET_BUFSIZE * 2) 313 313 314 314 /* Receives data from an RT server */ … … 441 441 /* This may fail on a non-Linux machine */ 442 442 if (trace_is_err(RT_INFO->dummy_linux)) { 443 trace_perror(RT_INFO->dummy_linux, "Creating dead bpftrace");443 trace_perror(RT_INFO->dummy_linux, "Creating dead int trace"); 444 444 return -1; 445 445 } -
lib/linktypes.c
re1f3b6b r528eb6e 41 41 #include <string.h> 42 42 43 #include " arphrd.h"43 #include "libtrace_arphrd.h" 44 44 45 45 … … 207 207 libtrace_linktype_t arphrd_type_to_libtrace(unsigned int arphrd) { 208 208 switch(arphrd) { 209 case ARPHRD_ETHER: return TRACE_TYPE_ETH;210 case ARPHRD_EETHER: return TRACE_TYPE_ETH;211 case ARPHRD_IEEE80211: return TRACE_TYPE_80211;212 case ARPHRD_80211_RADIOTAP: return TRACE_TYPE_80211_RADIO;213 case ARPHRD_PPP: return TRACE_TYPE_NONE;214 case ARPHRD_LOOPBACK: return TRACE_TYPE_ETH;215 case ARPHRD_NONE: return TRACE_TYPE_NONE;209 case LIBTRACE_ARPHRD_ETHER: return TRACE_TYPE_ETH; 210 case LIBTRACE_ARPHRD_EETHER: return TRACE_TYPE_ETH; 211 case LIBTRACE_ARPHRD_IEEE80211: return TRACE_TYPE_80211; 212 case LIBTRACE_ARPHRD_IEEE80211_RADIOTAP: return TRACE_TYPE_80211_RADIO; 213 case LIBTRACE_ARPHRD_PPP: return TRACE_TYPE_NONE; 214 case LIBTRACE_ARPHRD_LOOPBACK: return TRACE_TYPE_ETH; 215 case LIBTRACE_ARPHRD_NONE: return TRACE_TYPE_NONE; 216 216 } 217 217 printf("Unknown ARPHRD %08x\n",arphrd); … … 221 221 unsigned int libtrace_to_arphrd_type(libtrace_linktype_t linktype) { 222 222 switch(linktype) { 223 case TRACE_TYPE_ETH: return ARPHRD_ETHER;224 case TRACE_TYPE_80211: return ARPHRD_IEEE80211;225 case TRACE_TYPE_80211_RADIO: return ARPHRD_80211_RADIOTAP;223 case TRACE_TYPE_ETH: return LIBTRACE_ARPHRD_ETHER; 224 case TRACE_TYPE_80211: return LIBTRACE_ARPHRD_IEEE80211; 225 case TRACE_TYPE_80211_RADIO: return LIBTRACE_ARPHRD_IEEE80211_RADIOTAP; 226 226 default: break; 227 227 } … … 266 266 case TRACE_TYPE_NONE: 267 267 trace_get_layer3(packet, &hdr->protocol, NULL); 268 hdr->hatype = htons( ARPHRD_PPP);268 hdr->hatype = htons(LIBTRACE_ARPHRD_PPP); 269 269 hdr->protocol=htons(hdr->protocol); 270 270 break; 271 271 case TRACE_TYPE_ETH: 272 hdr->hatype = htons( ARPHRD_ETHER);272 hdr->hatype = htons(LIBTRACE_ARPHRD_ETHER); 273 273 hdr->protocol=htons(0x0060); /* ETH_P_LOOP */ 274 274 break; … … 368 368 369 369 /* Preserved from older libtrace behaviour */ 370 if (ha_type == ARPHRD_PPP)370 if (ha_type == LIBTRACE_ARPHRD_PPP) 371 371 packet->type = pcap_linktype_to_rt(TRACE_DLT_RAW); 372 372 /* Don't decide trace type based on ha_type, -
lib/protocols_pktmeta.c
r8ccb7897 r528eb6e 36 36 #include "protocols.h" 37 37 #include <assert.h> 38 39 #include "arphrd.h"40 38 41 39 /* This file contains all the protocol decoding functions for the meta-data -
lib/trace.c
r1935565 r528eb6e 136 136 legacy_constructor(); 137 137 atmhdr_constructor(); 138 #ifdef HAVE_NETPACKET_PACKET_H139 138 linuxnative_constructor(); 140 #endif141 139 #ifdef HAVE_LIBPCAP 142 140 pcap_constructor(); … … 587 585 if (libtrace->started && libtrace->format->pause_input) 588 586 libtrace->format->pause_input(libtrace); 589 libtrace->format->fin_input(libtrace); 587 if (libtrace->format->fin_input) 588 libtrace->format->fin_input(libtrace); 590 589 } 591 590 /* Need to free things! */ -
libpacketdump/link_6.c
rb3edbe9 r528eb6e 12 12 #include "libtrace.h" 13 13 14 #include " arphrd.h"14 #include "libtrace_arphrd.h" 15 15 16 16 /* Copied this here because this isn't currently part of our external API - … … 18 18 static libtrace_linktype_t arphrd_type_to_libtrace(unsigned int arphrd) { 19 19 switch(arphrd) { 20 case ARPHRD_ETHER: return TRACE_TYPE_ETH;21 case ARPHRD_EETHER: return TRACE_TYPE_ETH;22 case ARPHRD_IEEE80211: return TRACE_TYPE_80211;23 case ARPHRD_80211_RADIOTAP: return TRACE_TYPE_80211_RADIO;24 case ARPHRD_PPP: return TRACE_TYPE_NONE;25 case ARPHRD_LOOPBACK: return TRACE_TYPE_NONE;26 case ARPHRD_NONE: return TRACE_TYPE_NONE;20 case LIBTRACE_ARPHRD_ETHER: return TRACE_TYPE_ETH; 21 case LIBTRACE_ARPHRD_EETHER: return TRACE_TYPE_ETH; 22 case LIBTRACE_ARPHRD_IEEE80211: return TRACE_TYPE_80211; 23 case LIBTRACE_ARPHRD_IEEE80211_RADIOTAP: return TRACE_TYPE_80211_RADIO; 24 case LIBTRACE_ARPHRD_PPP: return TRACE_TYPE_NONE; 25 case LIBTRACE_ARPHRD_LOOPBACK: return TRACE_TYPE_NONE; 26 case LIBTRACE_ARPHRD_NONE: return TRACE_TYPE_NONE; 27 27 } 28 28 printf("Unknown ARPHRD: %u\n", arphrd); … … 62 62 ret=trace_get_payload_from_meta(pkt, &linktype, &len); 63 63 64 if (ntohs(sll->hatype) == ARPHRD_ETHER ||65 ntohs(sll->hatype) == ARPHRD_LOOPBACK) {64 if (ntohs(sll->hatype) == LIBTRACE_ARPHRD_ETHER || 65 ntohs(sll->hatype) == LIBTRACE_ARPHRD_LOOPBACK) { 66 66 67 67 if (ntohs(sll->protocol) == 0x0060) {
Note: See TracChangeset
for help on using the changeset viewer.