netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
msg.h File Reference
#include <netlink/netlink.h>
#include <netlink/object.h>
#include <netlink/attr.h>
Include dependency graph for msg.h:
This graph shows which files directly or indirectly include this file:

Macros

#define NL_DONTPAD   0
 
#define NL_AUTO_PID   0
 Will cause the netlink pid to be set to the pid assigned to the netlink handle (socket) just before sending the message off. More...
 
#define NL_AUTO_SEQ   0
 May be used to refer to a sequence number which should be automatically set just before sending the message off. More...
 
Iterators
#define nlmsg_for_each_attr(pos, nlh, hdrlen, rem)
 Iterate over a stream of attributes in a message. More...
 
#define nlmsg_for_each_msg(pos, head, len, rem)
 Iterate over a stream of messages. More...
 

Functions

int nlmsg_msg_size (int)
 length of netlink message not including padding More...
 
int nlmsg_total_size (int)
 length of netlink message including padding More...
 
int nlmsg_padlen (int)
 length of padding at the message's tail More...
 
void * nlmsg_data (const struct nlmsghdr *)
 head of message payload More...
 
int nlmsg_len (const struct nlmsghdr *)
 length of message payload More...
 
void * nlmsg_tail (const struct nlmsghdr *)
 
struct nlattrnlmsg_attrdata (const struct nlmsghdr *, int)
 head of attributes data More...
 
int nlmsg_attrlen (const struct nlmsghdr *, int)
 length of attributes data More...
 
int nlmsg_valid_hdr (const struct nlmsghdr *, int)
 
int nlmsg_ok (const struct nlmsghdr *, int)
 check if the netlink message fits into the remaining bytes More...
 
struct nlmsghdrnlmsg_next (struct nlmsghdr *, int *)
 next netlink message in message stream More...
 
int nlmsg_parse (struct nlmsghdr *, int, struct nlattr **, int, struct nla_policy *)
 
struct nlattrnlmsg_find_attr (struct nlmsghdr *, int, int)
 nlmsg_find_attr - find a specific attribute in a netlink message More...
 
int nlmsg_validate (struct nlmsghdr *, int, int, struct nla_policy *)
 nlmsg_validate - validate a netlink message including attributes More...
 
struct nl_msgnlmsg_alloc (void)
 Allocate a new netlink message with the default maximum payload size. More...
 
struct nl_msgnlmsg_alloc_size (size_t)
 Allocate a new netlink message with maximum payload size specified. More...
 
struct nl_msgnlmsg_alloc_simple (int, int)
 Allocate a new netlink message. More...
 
void nlmsg_set_default_size (size_t)
 Set the default maximum message payload size for allocated messages. More...
 
struct nl_msgnlmsg_inherit (struct nlmsghdr *)
 Allocate a new netlink message and inherit netlink message header. More...
 
struct nl_msgnlmsg_convert (struct nlmsghdr *)
 Convert a netlink message received from a netlink socket to a nl_msg. More...
 
void * nlmsg_reserve (struct nl_msg *, size_t, int)
 Reserve room for additional data in a netlink message. More...
 
int nlmsg_append (struct nl_msg *, void *, size_t, int)
 Append data to tail of a netlink message. More...
 
int nlmsg_expand (struct nl_msg *, size_t)
 Expand maximum payload size of a netlink message. More...
 
struct nlmsghdrnlmsg_put (struct nl_msg *, uint32_t, uint32_t, int, int, int)
 Add a netlink message header to a netlink message. More...
 
struct nlmsghdrnlmsg_hdr (struct nl_msg *)
 Return actual netlink message. More...
 
void nlmsg_get (struct nl_msg *)
 Acquire a reference on a netlink message. More...
 
void nlmsg_free (struct nl_msg *)
 Release a reference from an netlink message. More...
 
void nlmsg_set_proto (struct nl_msg *, int)
 
int nlmsg_get_proto (struct nl_msg *)
 
size_t nlmsg_get_max_size (struct nl_msg *)
 
void nlmsg_set_src (struct nl_msg *, struct sockaddr_nl *)
 
struct sockaddr_nlnlmsg_get_src (struct nl_msg *)
 
void nlmsg_set_dst (struct nl_msg *, struct sockaddr_nl *)
 
struct sockaddr_nlnlmsg_get_dst (struct nl_msg *)
 
void nlmsg_set_creds (struct nl_msg *, struct ucred *)
 
struct ucred * nlmsg_get_creds (struct nl_msg *)
 
char * nl_nlmsgtype2str (int, char *, size_t)
 
int nl_str2nlmsgtype (const char *)
 
char * nl_nlmsg_flags2str (int, char *, size_t)
 
int nl_msg_parse (struct nl_msg *, void(*cb)(struct nl_object *, void *), void *)
 
void nl_msg_dump (struct nl_msg *, FILE *)
 Dump message in human readable format to file descriptor. More...
 

Macro Definition Documentation

#define NL_DONTPAD   0

Function Documentation