source: lib/pcap_open_dead.c @ 1fc2f6a

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 1fc2f6a was 808a478, checked in by Daniel Lawson <dlawson@…>, 16 years ago

Ported to OpenBSD

Changes were mostly with header changes, although openbsd's pcap doesn't have pcap_open_dead, so we provide our own. To this end, I fixed the libreplace shit that wasn't working at all well, and ended up putting strndup.c and pcap_open_dead.c into lib/, and adding @LTLIBOBJS@ to the libtrace source file line. Seems to work fine now!

  • Property mode set to 100644
File size: 486 bytes
Line 
1#include "../config.h"
2
3#ifndef HAVE_PCAP_OPEN_DEAD
4#include <stdio.h>
5#include <pcap.h>
6#if HAVE_PCAP_INT_H
7# include <pcap-int.h>
8#else
9# error "Need pcap-int.h for declaration of pcap_t"
10#endif
11#include <string.h>
12
13pcap_t *pcap_open_dead(int linktype, int snaplen) {
14    pcap_t *p = NULL;
15
16    p = (pcap_t *)malloc(sizeof(*p));
17    if (p == NULL)
18        return NULL;   
19  //  memset (p, 0, sizeof(*p));
20    p->snapshot = snaplen;
21    p->linktype = linktype;
22    return p;
23}
24#endif
Note: See TracBrowser for help on using the repository browser.