source: examples/tracedump/ @ f04e489

Last change on this file since f04e489 was f04e489, checked in by Daniel Lawson <dlawson@…>, 15 years ago

fixed the legacyatm legacypos and legacyeth formats to correctly calculate the framing offset then use that to step into the link layer properly.
Added headers to deal with the link layers.

updated tracedump to be correct now.

  • Property mode set to 100644
File size: 435 bytes
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 "tracedump.h"
9extern "C"
10void decode(int link_type,char *packet,int len)
12        printf(" Legacy ATM:");
13        if (len>=12) {
14                uint16_t type = htons(*(uint16_t*)(packet+10));
15                printf(" %04x\n",type);
16                decode_next(packet+12,len-12,"eth",type);
17        }
18        else {
19                printf("[|Truncated]\n");
20                return;
21        }
22        return;
Note: See TracBrowser for help on using the repository browser.