source: libpacketdump/link_10.c @ e8d0993

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e8d0993 was 4f55f69, checked in by Perry Lorier <perry@…>, 14 years ago

More warning fixes -- convert the length to be an unsigned number

  • Property mode set to 100644
File size: 502 bytes
Line 
1#include <sys/types.h>
2#include <netinet/in.h>
3#include <stdio.h>
4#include "libpacketdump.h"
5#include "libtrace.h"
6
7void decode(int link_type,char *packet,unsigned len)
8{
9        // ATM
10        printf(" Legacy Framing:");
11        if (len>=12) {
12                uint16_t type = htons(*(uint16_t*)(packet+sizeof(libtrace_atm_cell_t)+4));
13                printf(" %04x\n",type);
14                decode_next(packet+sizeof(libtrace_atm_cell_t) + 4,
15                                len-sizeof(libtrace_atm_cell_t) -4, 
16                                "eth",type);
17        }
18        else {
19                printf("[|Truncated]\n");
20                return;
21        }
22        return;
23}
Note: See TracBrowser for help on using the repository browser.