#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"
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_handle * | rtnl_open (void) |
void | rtnl_close (struct rtnl_handle *rtnl_handle) |
#define rtnl_log | ( | x, | |
... | |||
) |
Referenced by rtnl_handler_register(), rtnl_handler_unregister(), rtnl_open(), and rtnl_receive().
void rtnl_close | ( | struct rtnl_handle * | rtnl_handle | ) |
References rtnl_handle::rtnl_fd.
Referenced by nlif_close(), and nlif_open().
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().
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().
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().
struct rtnl_handle* rtnl_open | ( | void | ) |
References NETLINK_ROUTE, sockaddr_nl::nl_family, sockaddr_nl::nl_groups, sockaddr_nl::nl_pid, NULL, RTMGRP_LINK, rtnl_handle::rtnl_fd, rtnl_handle::rtnl_local, rtnl_log, and rtnl_handle::rtnl_seq.
Referenced by nlif_open().
References RTA_NEXT, RTA_OK, and rtattr::rta_type.
int rtnl_receive | ( | struct rtnl_handle * | rtnl_handle | ) |
References buf, nlmsgerr::error, LOG_NOTICE, NLMSG_DATA, NLMSG_DONE, NLMSG_ERROR, nlmsghdr::nlmsg_len, NLMSG_LENGTH, NLMSG_NEXT, NLMSG_OK, nlmsghdr::nlmsg_pid, nlmsghdr::nlmsg_seq, nlmsghdr::nlmsg_type, rtnl_handle::rtnl_fd, and rtnl_log.
Referenced by nlif_catch(), and rtnl_receive_multi().
int rtnl_receive_multi | ( | struct rtnl_handle * | rtnl_handle | ) |