blob: 896d05c5b124744befdef22992b90db0950dfb54 (
plain)
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
|
/*
* libnl_ifw.h
*/
#ifndef _LIBNL_IFW_H
#define _LIBNL_IFW_H
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <linux/if.h>
#include <linux/netlink.h>
#define NETLINK_IFWLOG 19
#define PREFSIZ 32
struct nl_msg { /* Netlink kernel to user message */
long timestamp_sec; /* time packet */
char indev_name[IFNAMSIZ]; /* name of the ingoing interface */
char outdev_name[IFNAMSIZ]; /* name of the outgoing interface */
unsigned char prefix[PREFSIZ]; /* logging informations */
struct iphdr ip;
union {
struct tcphdr th;
struct udphdr uh;
} h;
};
int nl_ifw_bind_socket(int s);
int nl_ifw_create_socket(void);
int nl_ifw_read_msg(int s, struct nlmsghdr *nlh, struct nl_msg *msg);
#endif /* !_LIBNL_IFW_H */
|