Changeset 3b8a5ef for libpacketdump
- Timestamp:
- 11/30/05 15:43:30 (15 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:
- 2adf051
- Parents:
- 08594b8
- Location:
- libpacketdump
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libpacketdump/libpacketdump.cc
r3840760 r3b8a5ef 64 64 65 65 printf("%s",ctime(&sec)); 66 decode_next(link,packet->size - trace_get_framing_length(packet),"link",trace_get_link_type(packet)); 66 decode_next(link,packet->size-trace_get_framing_length(packet), 67 "link", 68 trace_get_link_type(packet)); 67 69 } 68 70 -
libpacketdump/link_10.cc
r950d54a r3b8a5ef 6 6 #include <map> 7 7 #include "libpacketdump.h" 8 #include "libtrace.h" 8 9 9 10 extern "C" 10 11 void decode(int link_type,char *packet,int len) 11 12 { 12 printf(" Legacy ATM:"); 13 /* 14 if (len>=6) 15 printf(" %s",ether_ntoa((struct ether_addr*)packet)); 16 else { 17 printf("[|Truncated]\n"); 18 return; 19 } 20 if (len>=12) 21 printf(" %s",ether_ntoa((struct ether_addr*)(packet+6))); 22 else { 23 printf("[|Truncated]\n"); 24 return; 25 } 26 */ 27 if (len>=24) { 28 uint16_t type = htons(*(uint16_t*)(packet+22)); 13 // ATM 14 printf(" Legacy Framing:"); 15 if (len>=12) { 16 uint16_t type = htons(*(uint16_t*)(packet+sizeof(libtrace_atm_cell)+4)); 29 17 printf(" %04x\n",type); 30 decode_next(packet+24,len-24,"eth",type); 18 decode_next(packet+sizeof(libtrace_atm_cell) + 4, 19 len-sizeof(libtrace_atm_cell) -4, 20 "eth",type); 31 21 } 32 22 else { -
libpacketdump/link_11.cc
r950d54a r3b8a5ef 11 11 void decode(int link_type,char *packet,int len) 12 12 { 13 printf(" Legacy Framing: "); 13 // Ethernet - just raw ethernet frames 14 printf(" Legacy: "); 14 15 if (len>=10) { 15 decode_next(packet +10,len-10,"link",2);16 decode_next(packet,len,"link",2); 16 17 } 17 18 else { -
libpacketdump/link_9.cc
r950d54a r3b8a5ef 10 10 void decode(int link_type,char *packet,int len) 11 11 { 12 printf(" Legacy POS:"); 13 /* 14 if (len>=6) 15 printf(" %s",ether_ntoa((struct ether_addr*)packet)); 16 else { 17 printf("[|Truncated]\n"); 18 return; 19 } 20 if (len>=12) 21 printf(" %s",ether_ntoa((struct ether_addr*)(packet+6))); 22 else { 23 printf("[|Truncated]\n"); 24 return; 25 } 26 */ 27 if (len>=20) { 28 uint16_t type = htons(*(uint16_t*)(packet+18)); 12 // POS 13 printf(" Legacy Framing:"); 14 // take into account llc 15 if (len>=4) { 16 uint16_t type = htons( 17 ((libtrace_pos *)packet)->ether_type); 29 18 printf(" %04x\n",type); 30 decode_next(packet+20,len-20,"eth",type); 19 decode_next(packet+sizeof(libtrace_pos), 20 len-sizeof(libtrace_pos), 21 "eth",type); 31 22 } 32 23 else {
Note: See TracChangeset
for help on using the changeset viewer.