netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rtnl.c File Reference
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <linux/types.h>
#include <sys/socket.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include "rtnl.h"
Include dependency graph for rtnl.c:

Macros

#define rtnl_log(x,...)
 

Functions

int rtnl_handler_register (struct rtnl_handle *rtnl_handle, struct rtnl_handler *hdlr)
 
int rtnl_handler_unregister (struct rtnl_handle *rtnl_handle, struct rtnl_handler *hdlr)
 
int rtnl_parse_rtattr (struct rtattr *tb[], int max, struct rtattr *rta, int len)
 
int rtnl_dump_type (struct rtnl_handle *rtnl_handle, unsigned int type)
 
int rtnl_receive (struct rtnl_handle *rtnl_handle)
 
int rtnl_receive_multi (struct rtnl_handle *rtnl_handle)
 
struct rtnl_handlertnl_open (void)
 
void rtnl_close (struct rtnl_handle *rtnl_handle)
 

Macro Definition Documentation

#define rtnl_log (   x,
  ... 
)

Function Documentation

void rtnl_close ( struct rtnl_handle rtnl_handle)

References rtnl_handle::rtnl_fd.

Referenced by nlif_close(), and nlif_open().

Here is the caller graph for this function:

int rtnl_dump_type ( struct rtnl_handle rtnl_handle,
unsigned int  type 
)

References sockaddr_nl::nl_family, NLM_F_MATCH, NLM_F_REQUEST, NLM_F_ROOT, req, rtnl_handle::rtnl_dump, rtnl_handle::rtnl_fd, rtnl_handle::rtnl_seq, and type.

Referenced by nlif_query().

Here is the caller graph for this function:

int rtnl_handler_register ( struct rtnl_handle rtnl_handle,
struct rtnl_handler hdlr 
)

References rtnl_handle::handlers, LOG_DEBUG, rtnl_handler::next, rtnl_handler::nlmsg_type, and rtnl_log.

Referenced by nlif_open().

Here is the caller graph for this function:

int rtnl_handler_unregister ( struct rtnl_handle rtnl_handle,
struct rtnl_handler hdlr 
)

References rtnl_handle::handlers, LOG_DEBUG, rtnl_handler::next, rtnl_handler::nlmsg_type, NULL, and rtnl_log.

Referenced by nlif_close(), and nlif_open().

Here is the caller graph for this function:

int rtnl_parse_rtattr ( struct rtattr tb[],
int  max,
struct rtattr rta,
int  len 
)

References RTA_NEXT, RTA_OK, and rtattr::rta_type.

int rtnl_receive_multi ( struct rtnl_handle rtnl_handle)

References rtnl_receive().

Here is the call graph for this function: