summaryrefslogtreecommitdiffstats
path: root/include/netlink/netfilter/nfnl.h
blob: 123d93ea65de873271cf3a706cb18ba878e620e4 (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
36
37
38
39
40
41
42
43
44
/*
 * netlink/nfnl/nfnl.h		Netfilter Netlink
 *
 *	This library is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU Lesser General Public
 *	License as published by the Free Software Foundation version 2.1
 *	of the License.
 *
 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
 * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
 * Copyright (c) 2007 Secure Computing Corporation
 */

#ifndef NETLINK_NFNL_H_
#define NETLINK_NFNL_H_

#include <netlink/netlink.h>

#ifdef __cplusplus
extern "C" {
#endif

#define NFNL_HDRLEN NLMSG_ALIGN(sizeof(struct nfgenmsg))
#define NFNLMSG_TYPE(subsys, subtype) (((subsys) << 8) | (subtype))

extern int		nfnl_connect(struct nl_handle *);

extern uint8_t		nfnlmsg_subsys(struct nlmsghdr *);
extern uint8_t		nfnlmsg_subtype(struct nlmsghdr *);
extern uint8_t		nfnlmsg_family(struct nlmsghdr *);
extern uint16_t		nfnlmsg_res_id(struct nlmsghdr *);

extern int		nfnl_send_simple(struct nl_handle *, uint8_t, uint8_t,
					 int, uint8_t, uint16_t);
extern struct nl_msg *	nfnlmsg_alloc_simple(uint8_t, uint8_t, int,
					     uint8_t, uint16_t);
extern int		nfnlmsg_put(struct nl_msg *, uint32_t, uint32_t,
				    uint8_t, uint8_t, int, uint8_t, uint16_t);

#ifdef __cplusplus
}
#endif

#endif