source: libpacketdump/ @ bd6869b

Last change on this file since bd6869b was 4e65f42, checked in by Shane Alcock <salcock@…>, 16 years ago

Fixed segmentation faults when trace_destroy is called on a trace that wasn't successfully created
libdl is now checked for and only linked against if available (BSD's don't have a libdl)
Fixed the libpacketdump .so's to use libtrace's generic protocol headers as well as trace_ether_ntoa
Added missing check for strlcpy
Added a couple of #defines to various tools that needed them under FreeBSD
Removed some needless #includes from the libpacketdump .so's

  • Property mode set to 100644
File size: 420 bytes
1#include <netinet/in.h>
2#include <stdio.h>
3#include <inttypes.h>
4#include <dlfcn.h>
5#include "libpacketdump.h"
7extern "C"
8void decode(int link_type,char *packet,int len)
10        printf(" Legacy PoS:");
11        if (len>=4)
12                printf(" %08x\n",*(uint32_t *)packet);
13        else {
14                printf("[|Truncated]\n");
15                return;
16        }
17        if (len>4) {
18                decode_next(packet+4,len-4,"eth",2048);
19        }
20        else {
21                printf("[|Truncated]\n");
22                return;
23        }
24        return;
Note: See TracBrowser for help on using the repository browser.