source: libpacketdump/eth_34916.c @ 6e90062

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 6e90062 was c7062df, checked in by Shane Alcock <salcock@…>, 11 years ago
  • Ensure that the decode functions are exported as global symbols for the various libpacketdump shared libraries
  • Property mode set to 100644
File size: 837 bytes
Line 
1
2#include <sys/types.h>
3#include <netinet/in.h>
4#include <stdio.h>
5#include "libpacketdump.h"
6#include "libtrace.h"
7#include "libtrace_int.h"
8
9typedef struct pppoe_t {
10        LT_BITFIELD8    ver:4;
11        LT_BITFIELD8    type:4;
12        uint8_t         code;
13        uint16_t        session;
14        uint16_t        length;
15} pppoe_t;
16
17DLLEXPORT void decode(int link_type UNUSED,const char *pkt,unsigned len) 
18{
19        pppoe_t *pppoe = (pppoe_t *) pkt;
20       
21        if (len < sizeof(*pppoe)) {
22                printf(" PPPoE: Truncated (len = %u)\n", len);
23                return;
24        }
25
26        printf(" PPPoE: Version: %d\n",pppoe->ver);
27        printf(" PPPoE: Type: %d\n",pppoe->type);
28        printf(" PPPoE: Code: %d\n",pppoe->code);
29        printf(" PPPoE: Session: %d\n",ntohs(pppoe->session));
30        printf(" PPPoE: Length: %d\n",ntohs(pppoe->length));
31
32        /* Meh.. pass it off to eth decoder */
33        decode_next(pkt + sizeof(*pppoe), len - sizeof(*pppoe), "link", 5);
34
35}
36
37
Note: See TracBrowser for help on using the repository browser.