Changeset 1351
- Timestamp:
- 08/05/08 14:42:03 (8 months ago)
- Files:
-
- trunk/libpacketdump/bitbuffer.c (modified) (1 diff)
- trunk/libpacketdump/eth_2048.c (modified) (1 diff)
- trunk/libpacketdump/eth_2054.c (modified) (1 diff)
- trunk/libpacketdump/eth_34887.c (modified) (1 diff)
- trunk/libpacketdump/eth_34916.c (modified) (1 diff)
- trunk/libpacketdump/eth_34958.c (modified) (1 diff)
- trunk/libpacketdump/grammar.h (modified) (1 diff)
- trunk/libpacketdump/ip_1.c (modified) (1 diff)
- trunk/libpacketdump/ip_132.c (modified) (1 diff)
- trunk/libpacketdump/ip_17.c (modified) (1 diff)
- trunk/libpacketdump/ip_33.c (modified) (1 diff)
- trunk/libpacketdump/ip_47.c (modified) (1 diff)
- trunk/libpacketdump/ip_6.c (modified) (1 diff)
- trunk/libpacketdump/libpacketdump.cc (modified) (5 diffs)
- trunk/libpacketdump/libpacketdump.h (modified) (1 diff)
- trunk/libpacketdump/link_0.c (modified) (1 diff)
- trunk/libpacketdump/link_10.c (modified) (1 diff)
- trunk/libpacketdump/link_11.c (modified) (1 diff)
- trunk/libpacketdump/link_15.c (modified) (1 diff)
- trunk/libpacketdump/link_2.c (modified) (1 diff)
- trunk/libpacketdump/link_4.c (modified) (10 diffs)
- trunk/libpacketdump/link_6.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libpacketdump/bitbuffer.c
r979 r1351 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; trunk/libpacketdump/eth_2048.c
r1287 r1351 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; trunk/libpacketdump/eth_2054.c
r1338 r1351 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; trunk/libpacketdump/eth_34887.c
r1219 r1351 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; trunk/libpacketdump/eth_34916.c
r1241 r1351 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; trunk/libpacketdump/eth_34958.c
r1219 r1351 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; trunk/libpacketdump/grammar.h
r979 r1351 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; trunk/libpacketdump/ip_1.c
r1219 r1351 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; trunk/libpacketdump/ip_132.c
r1219 r1351 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; trunk/libpacketdump/ip_17.c
r1219 r1351 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; trunk/libpacketdump/ip_33.c
r1219 r1351 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; trunk/libpacketdump/ip_47.c
r1238 r1351 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 trunk/libpacketdump/ip_6.c
r1338 r1351 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; trunk/libpacketdump/libpacketdump.cc
r1272 r1351 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 } trunk/libpacketdump/libpacketdump.h
r1219 r1351 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 trunk/libpacketdump/link_0.c
r1219 r1351 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:"); trunk/libpacketdump/link_10.c
r1219 r1351 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 trunk/libpacketdump/link_11.c
r1219 r1351 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 trunk/libpacketdump/link_15.c
r1300 r1351 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; trunk/libpacketdump/link_2.c
r1232 r1351 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, }; trunk/libpacketdump/link_4.c
r1338 r1351 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; trunk/libpacketdump/link_6.c
r1219 r1351 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;
