source: libpacketdump/link_10.cc @ bf7018a

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since bf7018a was 950d54a, checked in by Perry Lorier <perry@…>, 16 years ago

Add libpacketdump to cvs

  • Property mode set to 100644
File size: 689 bytes
Line 
1#include <netinet/ether.h>
2#include <netinet/in.h>
3#include <stdio.h>
4#include <inttypes.h>
5#include <dlfcn.h>
6#include <map>
7#include "libpacketdump.h"
8
9extern "C"
10void decode(int link_type,char *packet,int len)
11{
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));
29                printf(" %04x\n",type);
30                decode_next(packet+24,len-24,"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.