File: pcaplite.h

package info (click to toggle)
savvycan 220-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,456 kB
  • sloc: cpp: 61,803; sh: 293; javascript: 91; python: 44; makefile: 8
file content (34 lines) | stat: -rw-r--r-- 687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef PCAPLITE_H
#define PCAPLITE_H

#include <stdio.h>
#if defined(unix) || defined __APPLE__
#include <sys/time.h>
#else
#include <winsock.h>
#endif

#define PCAP_ERRBUF_SIZE        (256)
#define PCAP_LINKTYPE_SOCKETCAN (227)
#define PCAP_LINKTYPE_ANY       (-1)

struct pcap_pkthdr {
	struct timeval ts;	/* time stamp */
	unsigned int caplen;	/* length of portion present */
	unsigned int len;	/* length of this packet (off wire) */
};

struct pcap {
    FILE *file;
    bool is_ng;
};

typedef struct pcap pcap_t;

pcap *pcap_open_offline(const char *, char *, int);

const unsigned char *pcap_next(pcap_t *, struct pcap_pkthdr *);

void pcap_close(pcap_t *);

#endif// PCAPLITE_H