-
Notifications
You must be signed in to change notification settings - Fork 1
/
open_bpf.h
47 lines (40 loc) · 1.46 KB
/
open_bpf.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* entren --- a traffic analyser, may also be used as an intrusion detection system
* Copyright (C) 2002 Chris Aumann <c_aumann@users.sourceforge.net>
*
* This file is part of entren.
*
* entren is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* entren is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with entren; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/bpf.h>
#include <net/if.h>
#include <errno.h>
struct cap_dev {
char nic_device[sizeof("/dev/rtk000")];
char promisc; /* promisc mode set? */
char out; /* capture outgoing packages? */
/* filled by open_bpf() */
int fd; /* file descriptor */
u_int ll_type; /* link layer type */
u_int bio_len; /* required buffer length */
};
int open_bpf(struct cap_dev *);