4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since 4325ef8 was
eade363,
checked in by Perry Lorier <perry@…>, 13 years ago
|
Tidy up thousands of little warnings
|
-
Property mode set to
100644
|
File size:
772 bytes
|
Rev | Line | |
---|
[ace188a] | 1 | #include <sys/types.h> |
---|
[09d3bef] | 2 | #include <netinet/in.h> |
---|
| 3 | #include <stdio.h> |
---|
| 4 | #include <inttypes.h> |
---|
| 5 | #include <dlfcn.h> |
---|
| 6 | #include "libtrace.h" |
---|
| 7 | #include "libpacketdump.h" |
---|
| 8 | |
---|
[eade363] | 9 | void decode(int link_type UNUSED,const char *packet,unsigned len) |
---|
[09d3bef] | 10 | { |
---|
| 11 | char ether_buf[18] = {0, }; |
---|
| 12 | printf(" Ethernet:"); |
---|
| 13 | if (len>=6) |
---|
| 14 | printf(" Dest: %s",trace_ether_ntoa((uint8_t *)packet, |
---|
| 15 | ether_buf)); |
---|
| 16 | else { |
---|
| 17 | printf("[|Truncated]\n"); |
---|
| 18 | return; |
---|
| 19 | } |
---|
| 20 | if (len>=12) |
---|
| 21 | printf(" Source: %s",trace_ether_ntoa((uint8_t*)(packet+6), |
---|
| 22 | ether_buf)); |
---|
| 23 | else { |
---|
| 24 | printf("[|Truncated]\n"); |
---|
| 25 | return; |
---|
| 26 | } |
---|
| 27 | if (len>=14) { |
---|
| 28 | uint16_t type = htons(*(uint16_t*)(packet+12)); |
---|
[f2f3327] | 29 | printf(" Ethertype: 0x%04x\n",type); |
---|
[09d3bef] | 30 | decode_next(packet+14,len-14,"eth",type); |
---|
| 31 | } |
---|
| 32 | else { |
---|
| 33 | printf("[|Truncated]\n"); |
---|
| 34 | return; |
---|
| 35 | } |
---|
| 36 | return; |
---|
| 37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.