Changeset eade363 for libpacketdump
- Timestamp:
- 10/15/09 18:46:08 (11 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:
- 34cab5b
- Parents:
- 189f5c6
- Location:
- libpacketdump
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
libpacketdump/bitbuffer.c
r11a7f9c reade363 49 49 return ret; 50 50 } 51 52 int yyparse(void); 51 53 52 54 element_t* parse_protocol_file(char *filename) … … 109 111 110 112 111 void decode_protocol_file(uint16_t link_type ,const char *packet,int len,element_t *el)113 void decode_protocol_file(uint16_t link_type UNUSED,const char *packet,int len,element_t *el) 112 114 { 113 115 bitbuffer_t result; … … 134 136 135 137 el->data->field->value = result; 136 printf(" %s % lld\n",138 printf(" %s %" PRIi64 "\n", 137 139 el->data->field->identifier, 138 140 result); … … 151 153 152 154 el->data->field->value = result; 153 printf(" %s 0x% llx\n",155 printf(" %s 0x%" PRIx64 "\n", 154 156 el->data->field->identifier, 155 157 result); -
libpacketdump/eth_2048.c
r11a7f9c reade363 21 21 #define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&ip->x)) 22 22 23 void decode(int link_type ,const char *packet,unsigned len)23 void decode(int link_type UNUSED,const char *packet,unsigned len) 24 24 { 25 25 libtrace_ip_t *ip = (libtrace_ip_t*)packet; -
libpacketdump/eth_2054.c
r11a7f9c reade363 20 20 * attempt to decode. 21 21 */ 22 static char *format_hrd( struct arphdr *arp,char *hrd) {22 static char *format_hrd(const struct arphdr *arp, const char *hrd) { 23 23 static char buffer[1024] = {0,}; 24 24 int i; … … 31 31 switch(ntohs(arp->ar_hrd)) { 32 32 case ARPHRD_ETHER: 33 trace_ether_ntoa( hrd, buffer);33 trace_ether_ntoa((const unsigned char *)hrd, buffer); 34 34 break; 35 35 default: … … 50 50 * attempt to decode. 51 51 */ 52 static char *format_pro( struct arphdr *arp,char *pro) {52 static char *format_pro(const struct arphdr *arp, const char *pro) { 53 53 static char buffer[1024] = {0,}; 54 54 int i; … … 77 77 } 78 78 79 void decode(int link_type ,const char *packet,unsigned len)79 void decode(int link_type UNUSED,const char *packet,unsigned len) 80 80 { 81 81 struct arphdr *arp = (struct arphdr*)packet; 82 c har *source_hrd = NULL;83 c har *source_pro = NULL;84 c har *dest_hrd = NULL;85 c har *dest_pro = NULL;82 const char *source_hrd = NULL; 83 const char *source_pro = NULL; 84 const char *dest_hrd = NULL; 85 const char *dest_pro = NULL; 86 86 87 87 if (len < sizeof(struct arphdr)) { -
libpacketdump/eth_33024.c
r4e4a77f reade363 22 22 } while(0) 23 23 24 void decode(int link_type ,const char *packet,unsigned len)24 void decode(int link_type UNUSED,const char *packet,unsigned len) 25 25 { 26 int offset=0;26 unsigned int offset=0; 27 27 int value; 28 28 uint16_t ethertype; -
libpacketdump/eth_34887.c
rc5f3398 reade363 22 22 } while(0) 23 23 24 void decode(int link_type ,const char *packet,unsigned len)24 void decode(int link_type UNUSED,const char *packet,unsigned len) 25 25 { 26 int offset=0;26 unsigned int offset=0; 27 27 int value; 28 28 int more = 0; -
libpacketdump/eth_34916.c
r11c0f44 reade363 15 15 } pppoe_t; 16 16 17 void decode(int link_type ,const char *pkt,unsigned len)17 void decode(int link_type UNUSED,const char *pkt,unsigned len) 18 18 { 19 19 pppoe_t *pppoe = (pppoe_t *) pkt; -
libpacketdump/eth_34958.c
r11a7f9c reade363 15 15 } while(0) 16 16 17 static void decode_eap_request(c har *packet, unsigned len)17 static void decode_eap_request(const char *packet, unsigned len) 18 18 { 19 19 int v; … … 34 34 } 35 35 36 static void decode_eap(c har *packet, unsigned len)36 static void decode_eap(const char *packet, unsigned len) 37 37 { 38 38 int v; … … 54 54 } 55 55 56 static void decode_eapol_start(c har *packet, unsigned len)56 static void decode_eapol_start(const char *packet, unsigned len) 57 57 { 58 58 int v; … … 61 61 } 62 62 63 static void decode_eapol_logoff(c har *packet, unsigned len)63 static void decode_eapol_logoff(const char *packet, unsigned len) 64 64 { 65 65 int v; … … 77 77 }; 78 78 79 static void decode_eapol_key(c har *packet, unsigned len)79 static void decode_eapol_key(const char *packet, unsigned len) 80 80 { 81 81 int v; … … 84 84 } 85 85 86 static void decode_eapol_encapsulated_asf_alert(c har *packet, unsigned len)86 static void decode_eapol_encapsulated_asf_alert(const char *packet, unsigned len) 87 87 { 88 88 int v; … … 91 91 } 92 92 93 void decode(int link_type ,const char *packet,unsigned len)93 void decode(int link_type UNUSED,const char *packet,unsigned len) 94 94 { 95 int offset;96 95 int v; 97 96 int type; -
libpacketdump/ip_1.c
r11a7f9c reade363 39 39 }; 40 40 41 void decode(int link_type ,const char *packet,unsigned len)41 void decode(int link_type UNUSED,const char *packet,unsigned len) 42 42 { 43 43 libtrace_icmp_t *icmp = (libtrace_icmp_t*)packet; -
libpacketdump/ip_132.c
r11a7f9c reade363 151 151 } 152 152 153 void decode(int link_type ,const char *packet,unsigned len)153 void decode(int link_type UNUSED,const char *packet,unsigned len) 154 154 { 155 155 struct sctp_common_hdr *hdr; -
libpacketdump/ip_17.c
r11a7f9c reade363 25 25 26 26 27 void decode(int link_type ,const char *packet,unsigned len)27 void decode(int link_type UNUSED,const char *packet,unsigned len) 28 28 { 29 29 struct libtrace_udp *udp = (struct libtrace_udp*)packet; -
libpacketdump/ip_33.c
r11a7f9c reade363 47 47 }; 48 48 49 void decode(int link_type ,const char *packet,unsigned len)49 void decode(int link_type UNUSED,const char *packet,unsigned len) 50 50 { 51 51 struct dccphdr *dccp = (struct dccphdr*)packet; -
libpacketdump/ip_47.c
r553247b reade363 11 11 } gre_t; 12 12 13 void decode(int link_type ,const char *packet,unsigned len)13 void decode(int link_type UNUSED,const char *packet,unsigned len) 14 14 { 15 15 // GRE -
libpacketdump/ip_6.c
r11a7f9c reade363 20 20 #define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&tcp->x)) 21 21 22 void decode(int link_type ,const char *packet,unsigned len)22 void decode(int link_type UNUSED,const char *packet,unsigned len) 23 23 { 24 24 unsigned char *pkt = NULL; -
libpacketdump/link_0.c
r11a7f9c reade363 6 6 #include "libpacketdump.h" 7 7 8 void decode(int link_type ,const char *packet,unsigned len)8 void decode(int link_type UNUSED,const char *packet,unsigned len) 9 9 { 10 10 printf(" Legacy PoS:"); -
libpacketdump/link_10.c
r11a7f9c reade363 5 5 #include "libtrace.h" 6 6 7 void decode(int link_type ,const char *packet,unsigned len)7 void decode(int link_type UNUSED,const char *packet,unsigned len) 8 8 { 9 9 // ATM -
libpacketdump/link_11.c
r11a7f9c reade363 4 4 #include "libpacketdump.h" 5 5 6 void decode(int link_type ,const char *packet,unsigned len)6 void decode(int link_type UNUSED,const char *packet,unsigned len) 7 7 { 8 8 // Ethernet - just raw ethernet frames -
libpacketdump/link_15.c
r11a7f9c reade363 16 16 while ( (_p - _s) % sizeof(uint16_t)) {_p++; _c++;} 17 17 18 void decode(int link_type ,const char *packet,unsigned len)18 void decode(int link_type UNUSED,const char *packet,unsigned len) 19 19 { 20 20 uint32_t *ptr; … … 55 55 56 56 if (rtap->it_present & (1 << TRACE_RADIOTAP_TSFT)) { 57 printf(" Radiotap: TSFT = % llumicroseconds\n", bswap_le_to_host64(*((uint64_t *)p)));57 printf(" Radiotap: TSFT = %" PRIu64 " microseconds\n", bswap_le_to_host64(*((uint64_t *)p))); 58 58 p += sizeof (uint64_t); 59 59 rtap_real_len += sizeof (uint64_t); -
libpacketdump/link_2.c
r11a7f9c reade363 7 7 #include "libpacketdump.h" 8 8 9 void decode(int link_type ,const char *packet,unsigned len)9 void decode(int link_type UNUSED,const char *packet,unsigned len) 10 10 { 11 11 char ether_buf[18] = {0, }; -
libpacketdump/link_4.c
r11a7f9c reade363 25 25 #include <netinet/in.h> 26 26 #include <stdio.h> 27 #include <inttypes.h> 27 28 #include "libpacketdump.h" 28 29 #include "libtrace.h" … … 194 195 ieee80211_ie *ie; 195 196 int i = 0; 196 uint8_t * data;197 const uint8_t * data; 197 198 uint8_t bmap_offset; 198 199 while (len >= sizeof(ieee80211_ie)) { … … 204 205 } 205 206 206 data = (( c har *)pkt + sizeof (ieee80211_ie));207 data = (( const unsigned char *)pkt + sizeof (ieee80211_ie)); 207 208 208 209 switch (ie->id) { … … 432 433 } 433 434 434 printf(" 802.11MAC: Timestamp = % llu\n", b->ts);435 printf(" 802.11MAC: Timestamp = %" PRIu64 "\n", b->ts); 435 436 printf(" 802.11MAC: Beacon Interval = %u\n", b->interval); 436 437 decode_80211_capinfo(&b->capinfo); … … 499 500 static void decode_80211_mgmt(const char *pkt, unsigned len) { 500 501 ieee80211_mgmt_frame *mgmt = (ieee80211_mgmt_frame *)pkt; 501 uint8_t*data;502 const char *data; 502 503 503 504 printf(" 802.11MAC: Management frame: "); … … 557 558 break; 558 559 case 10: 559 data = ( (char *)pkt + sizeof(ieee80211_mgmt_frame));560 data = (pkt + sizeof(ieee80211_mgmt_frame)); 560 561 printf(" 802.11MAC: Reason Code = "); 561 562 ieee80211_print_reason_code((uint16_t) ((data[0] << 8) | (data[1]))); … … 567 568 break; 568 569 case 12: 569 data = ( (char *)pkt + sizeof(ieee80211_mgmt_frame));570 data = (pkt + sizeof(ieee80211_mgmt_frame)); 570 571 printf(" 802.11MAC: Reason Code = "); 571 572 ieee80211_print_reason_code((uint16_t) ((data[0] << 8) | (data[1]))); … … 747 748 } 748 749 749 void decode(int link_type , const char *pkt, unsigned len)750 void decode(int link_type UNUSED, const char *pkt, unsigned len) 750 751 { 751 752 ieee80211_frame_control *fc; -
libpacketdump/link_6.c
r11a7f9c reade363 11 11 #include "libtrace_int.h" 12 12 13 void decode(int link_type ,const char *pkt,unsigned len)13 void decode(int link_type UNUSED,const char *pkt,unsigned len) 14 14 { 15 15 libtrace_sll_header_t *sll = (libtrace_sll_header_t *) pkt; -
libpacketdump/parser.y
r4f666aa reade363 19 19 element_t *el_list = NULL; 20 20 21 /* i didnt want these to be global, but i think they have to be? :/ */22 static bitbuffer_t buffer = 0;23 static int bits = 0;24 21 %} 25 22
Note: See TracChangeset
for help on using the changeset viewer.