Changeset 11a7f9c for libpacketdump
- Timestamp:
- 05/08/08 14:42:03 (13 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:
- 1f44884
- Parents:
- 89404f5
- Location:
- libpacketdump
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
libpacketdump/bitbuffer.c
r4f666aa r11a7f9c 109 109 110 110 111 void decode_protocol_file(uint16_t link_type,c har *packet,int len,element_t *el)111 void decode_protocol_file(uint16_t link_type,const char *packet,int len,element_t *el) 112 112 { 113 113 bitbuffer_t result; -
libpacketdump/eth_2048.c
r049e277 r11a7f9c 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,c har *packet,unsigned len)23 void decode(int link_type,const char *packet,unsigned len) 24 24 { 25 25 libtrace_ip_t *ip = (libtrace_ip_t*)packet; -
libpacketdump/eth_2054.c
rf5d654e r11a7f9c 77 77 } 78 78 79 void decode(int link_type,c har *packet,unsigned len)79 void decode(int link_type,const char *packet,unsigned len) 80 80 { 81 81 struct arphdr *arp = (struct arphdr*)packet; -
libpacketdump/eth_34887.c
r4f55f69 r11a7f9c 17 17 } while(0) 18 18 19 void decode(int link_type,c har *packet,unsigned len)19 void decode(int link_type,const char *packet,unsigned len) 20 20 { 21 21 int offset=0; -
libpacketdump/eth_34916.c
r0c47bf4 r11a7f9c 15 15 } pppoe_t; 16 16 17 void decode(int link_type, char *pkt,unsigned len)17 void decode(int link_type,const char *pkt,unsigned len) 18 18 { 19 19 pppoe_t *pppoe = (pppoe_t *) pkt; -
libpacketdump/eth_34958.c
r4f55f69 r11a7f9c 91 91 } 92 92 93 void decode(int link_type,c har *packet,unsigned len)93 void decode(int link_type,const char *packet,unsigned len) 94 94 { 95 95 int offset; -
libpacketdump/grammar.h
r4f666aa r11a7f9c 51 51 52 52 element_t *parse_protocol_file(char *filename); 53 void decode_protocol_file(uint16_t link_type,c har *packet,int len, element_t* el);53 void decode_protocol_file(uint16_t link_type,const char *packet,int len, element_t* el); 54 54 55 55 typedef uint64_t bitbuffer_t; -
libpacketdump/ip_1.c
r4f55f69 r11a7f9c 39 39 }; 40 40 41 void decode(int link_type,c har *packet,unsigned len)41 void decode(int link_type,const char *packet,unsigned len) 42 42 { 43 43 libtrace_icmp_t *icmp = (libtrace_icmp_t*)packet; -
libpacketdump/ip_132.c
r4f55f69 r11a7f9c 151 151 } 152 152 153 void decode(int link_type,c har *packet,unsigned len)153 void decode(int link_type,const char *packet,unsigned len) 154 154 { 155 155 struct sctp_common_hdr *hdr; -
libpacketdump/ip_17.c
r4f55f69 r11a7f9c 25 25 26 26 27 void decode(int link_type,c har *packet,unsigned len)27 void decode(int link_type,const char *packet,unsigned len) 28 28 { 29 29 struct libtrace_udp *udp = (struct libtrace_udp*)packet; -
libpacketdump/ip_33.c
r4f55f69 r11a7f9c 47 47 }; 48 48 49 void decode(int link_type,c har *packet,unsigned len)49 void decode(int link_type,const char *packet,unsigned len) 50 50 { 51 51 struct dccphdr *dccp = (struct dccphdr*)packet; -
libpacketdump/ip_47.c
r9b06a91 r11a7f9c 11 11 } gre_t; 12 12 13 void decode(int link_type,c har *packet,unsigned len)13 void decode(int link_type,const char *packet,unsigned len) 14 14 { 15 15 // GRE -
libpacketdump/ip_6.c
rf5d654e r11a7f9c 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,c har *packet,unsigned len)22 void decode(int link_type,const char *packet,unsigned len) 23 23 { 24 24 unsigned char *pkt = NULL; -
libpacketdump/libpacketdump.cc
r0aae8f4 r11a7f9c 55 55 }; 56 56 57 typedef void (*decode_norm_t)(uint16_t type,c har *packet,int len);58 typedef void (*decode_parser_t)(uint16_t type,c har *packet,int len, element_t* el);57 typedef void (*decode_norm_t)(uint16_t type,const char *packet,int len); 58 typedef void (*decode_parser_t)(uint16_t type,const char *packet,int len, element_t* el); 59 59 60 60 typedef union decode_funcs { … … 84 84 libtrace_linktype_t linktype; 85 85 uint32_t length; 86 c har *link=(char *)trace_get_packet_buffer(packet,&linktype,&length);86 const char *link=(char *)trace_get_packet_buffer(packet,&linktype,&length); 87 87 88 88 printf("\n%s",ctime(&sec)); … … 98 98 } 99 99 100 static void generic_decode(uint16_t type,c har *packet, int len) {100 static void generic_decode(uint16_t type,const char *packet, int len) { 101 101 int i; 102 102 printf(" Unknown Protocol: %i",type); … … 128 128 } 129 129 130 void decode_next(c har *packet,int len,char *proto_name,int type)130 void decode_next(const char *packet,int len,const char *proto_name,int type) 131 131 { 132 132 std::string sname(proto_name); … … 187 187 uint16_t newtype; 188 188 uint32_t newlen=len; 189 void *network=trace_get_payload_from_link(packet,189 const char *network=(const char*)trace_get_payload_from_link((void*)packet, 190 190 (libtrace_linktype_t)type, 191 191 &newtype,&newlen); 192 192 if (network) { 193 193 printf("skipping unknown link header of type %i to %i\n",type,newtype); 194 decode_next( (char*)network,newlen,"eth",newtype);194 decode_next(network,newlen,"eth",newtype); 195 195 return; 196 196 } -
libpacketdump/libpacketdump.h
r4f55f69 r11a7f9c 8 8 9 9 void trace_dump_packet(libtrace_packet_t *packet); 10 void decode_next(c har *packet,int len,char *proto_name,int type);10 void decode_next(const char *packet,int len,const char *proto_name,int type); 11 11 12 void decode(int link_type, c har *pkt, unsigned len);12 void decode(int link_type, const char *pkt, unsigned len); 13 13 14 14 #ifdef __cplusplus -
libpacketdump/link_0.c
r4f55f69 r11a7f9c 6 6 #include "libpacketdump.h" 7 7 8 void decode(int link_type,c har *packet,unsigned len)8 void decode(int link_type,const char *packet,unsigned len) 9 9 { 10 10 printf(" Legacy PoS:"); -
libpacketdump/link_10.c
r4f55f69 r11a7f9c 5 5 #include "libtrace.h" 6 6 7 void decode(int link_type,c har *packet,unsigned len)7 void decode(int link_type,const char *packet,unsigned len) 8 8 { 9 9 // ATM -
libpacketdump/link_11.c
r4f55f69 r11a7f9c 4 4 #include "libpacketdump.h" 5 5 6 void decode(int link_type,c har *packet,unsigned len)6 void decode(int link_type,const char *packet,unsigned len) 7 7 { 8 8 // Ethernet - just raw ethernet frames -
libpacketdump/link_15.c
r3996329 r11a7f9c 16 16 while ( (_p - _s) % sizeof(uint16_t)) {_p++; _c++;} 17 17 18 void decode(int link_type,c har *packet,unsigned len)18 void decode(int link_type,const char *packet,unsigned len) 19 19 { 20 20 uint32_t *ptr; -
libpacketdump/link_2.c
rf2f3327 r11a7f9c 7 7 #include "libpacketdump.h" 8 8 9 void decode(int link_type,c har *packet,unsigned len)9 void decode(int link_type,const char *packet,unsigned len) 10 10 { 11 11 char ether_buf[18] = {0, }; -
libpacketdump/link_4.c
rf5d654e r11a7f9c 191 191 * length remaining and decodes the IEs. 192 192 */ 193 static void decode_80211_information_elements(c har *pkt, unsigned len) {193 static void decode_80211_information_elements(const char *pkt, unsigned len) { 194 194 ieee80211_ie *ie; 195 195 int i = 0; … … 425 425 426 426 /* Decodes a beacon (or a probe response) */ 427 static void decode_80211_beacon(c har *pkt, unsigned len) {427 static void decode_80211_beacon(const char *pkt, unsigned len) { 428 428 ieee80211_beacon *b = (ieee80211_beacon *)pkt; 429 429 if (len < sizeof(ieee80211_beacon)) { … … 439 439 } 440 440 441 static void decode_80211_assoc_request(c har *pkt, unsigned len) {441 static void decode_80211_assoc_request(const char *pkt, unsigned len) { 442 442 ieee80211_assoc_req *a = (ieee80211_assoc_req *) pkt; 443 443 … … 453 453 } 454 454 455 static void decode_80211_assoc_response(c har *pkt, unsigned len) {455 static void decode_80211_assoc_response(const char *pkt, unsigned len) { 456 456 ieee80211_assoc_resp *r = (ieee80211_assoc_resp *) pkt; 457 457 … … 468 468 } 469 469 470 static void decode_80211_reassoc_request(c har *pkt, unsigned len) {470 static void decode_80211_reassoc_request(const char *pkt, unsigned len) { 471 471 ieee80211_reassoc_req *r = (ieee80211_reassoc_req *) pkt; 472 472 … … 482 482 } 483 483 484 static void decode_80211_authentication_frame(c har *pkt, unsigned len) {484 static void decode_80211_authentication_frame(const char *pkt, unsigned len) { 485 485 ieee80211_auth *auth = (ieee80211_auth *)pkt; 486 486 if(len < sizeof(ieee80211_auth)) { … … 497 497 } 498 498 499 static void decode_80211_mgmt(c har *pkt, unsigned len) {499 static void decode_80211_mgmt(const char *pkt, unsigned len) { 500 500 ieee80211_mgmt_frame *mgmt = (ieee80211_mgmt_frame *)pkt; 501 501 uint8_t *data; … … 580 580 } 581 581 582 static void decode_80211_ctrl(c har *pkt, unsigned len) {582 static void decode_80211_ctrl(const char *pkt, unsigned len) { 583 583 ieee80211_ctrl_frame_1addr *ctrl1 = (ieee80211_ctrl_frame_1addr *) pkt; 584 584 ieee80211_ctrl_frame_2addr *ctrl2 = (ieee80211_ctrl_frame_2addr *) pkt; … … 650 650 } 651 651 652 static void decode_80211_data(c har *pkt, unsigned len) {652 static void decode_80211_data(const char *pkt, unsigned len) { 653 653 ieee80211_data_frame *data = (ieee80211_data_frame *) pkt; 654 654 ieee80211_qos_data_frame *qos = (ieee80211_qos_data_frame *)pkt; … … 747 747 } 748 748 749 void decode(int link_type, c har *pkt, unsigned len)749 void decode(int link_type, const char *pkt, unsigned len) 750 750 { 751 751 ieee80211_frame_control *fc; -
libpacketdump/link_6.c
r4f55f69 r11a7f9c 11 11 #include "libtrace_int.h" 12 12 13 void decode(int link_type, char *pkt,unsigned len)13 void decode(int link_type,const char *pkt,unsigned len) 14 14 { 15 15 libtrace_sll_header_t *sll = (libtrace_sll_header_t *) pkt;
Note: See TracChangeset
for help on using the changeset viewer.