libnl 1.1.4
nfnl.h
1/*
2 * netlink/nfnl/nfnl.h Netfilter Netlink
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
7 * of the License.
8 *
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10 * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
11 * Copyright (c) 2007 Secure Computing Corporation
12 */
13
14#ifndef NETLINK_NFNL_H_
15#define NETLINK_NFNL_H_
16
17#include <netlink/netlink.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#define NFNL_HDRLEN NLMSG_ALIGN(sizeof(struct nfgenmsg))
24#define NFNLMSG_TYPE(subsys, subtype) (((subsys) << 8) | (subtype))
25
26extern int nfnl_connect(struct nl_handle *);
27
28extern uint8_t nfnlmsg_subsys(struct nlmsghdr *);
29extern uint8_t nfnlmsg_subtype(struct nlmsghdr *);
30extern uint8_t nfnlmsg_family(struct nlmsghdr *);
31extern uint16_t nfnlmsg_res_id(struct nlmsghdr *);
32
33extern int nfnl_send_simple(struct nl_handle *, uint8_t, uint8_t,
34 int, uint8_t, uint16_t);
35extern struct nl_msg * nfnlmsg_alloc_simple(uint8_t, uint8_t, int,
36 uint8_t, uint16_t);
37extern int nfnlmsg_put(struct nl_msg *, uint32_t, uint32_t,
38 uint8_t, uint8_t, int, uint8_t, uint16_t);
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif
int nfnl_send_simple(struct nl_handle *, uint8_t, uint8_t, int, uint8_t, uint16_t)
Send trivial netfilter netlink message.
Definition: nfnl.c:108
uint16_t nfnlmsg_res_id(struct nlmsghdr *)
Get netfilter resource id from message.
Definition: nfnl.c:161
uint8_t nfnlmsg_subsys(struct nlmsghdr *)
Get netfilter subsystem id from message.
Definition: nfnl.c:132
uint8_t nfnlmsg_family(struct nlmsghdr *)
Get netfilter family from message.
Definition: nfnl.c:150
int nfnlmsg_put(struct nl_msg *, uint32_t, uint32_t, uint8_t, uint8_t, int, uint8_t, uint16_t)
Add netlink and netfilter netlink headers to netlink message.
Definition: nfnl.c:231
int nfnl_connect(struct nl_handle *)
Create and connect netfilter netlink socket.
Definition: nfnl.c:85
uint8_t nfnlmsg_subtype(struct nlmsghdr *)
Get netfilter message type from message.
Definition: nfnl.c:141
struct nl_msg * nfnlmsg_alloc_simple(uint8_t, uint8_t, int, uint8_t, uint16_t)
Allocate a new netfilter netlink message.
Definition: nfnl.c:201
Netlink message header.