4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since dce95f3 was
d907ff5,
checked in by Perry Lorier <perry@…>, 18 years ago
|
Import tracedump to libtrace
|
-
Property mode set to
100644
|
File size:
673 bytes
|
Rev | Line | |
---|
[d907ff5] | 1 | #include <netinet/ether.h> |
---|
| 2 | #include <netinet/in.h> |
---|
| 3 | #include <stdio.h> |
---|
| 4 | #include <stdint.h> |
---|
| 5 | #include <dlfcn.h> |
---|
| 6 | #include <map> |
---|
| 7 | #include "tracedump.h" |
---|
| 8 | |
---|
| 9 | extern "C" |
---|
| 10 | void decode(int link_type,char *packet,int len) |
---|
| 11 | { |
---|
| 12 | printf(" Ethernet:"); |
---|
| 13 | if (len>=6) |
---|
| 14 | printf(" %s",ether_ntoa((struct ether_addr*)packet)); |
---|
| 15 | else { |
---|
| 16 | printf("[|Truncated]\n"); |
---|
| 17 | return; |
---|
| 18 | } |
---|
| 19 | if (len>=12) |
---|
| 20 | printf(" %s",ether_ntoa((struct ether_addr*)(packet+6))); |
---|
| 21 | else { |
---|
| 22 | printf("[|Truncated]\n"); |
---|
| 23 | return; |
---|
| 24 | } |
---|
| 25 | if (len>=14) { |
---|
| 26 | uint16_t type = htons(*(uint16_t*)(packet+12)); |
---|
| 27 | printf(" %04x\n",type); |
---|
| 28 | decode_next(packet+14,len-14,"eth",type); |
---|
| 29 | } |
---|
| 30 | else { |
---|
| 31 | printf("[|Truncated]\n"); |
---|
| 32 | return; |
---|
| 33 | } |
---|
| 34 | return; |
---|
| 35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.