netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
route_obj.c File Reference
#include <netlink-local.h>
#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/utils.h>
#include <netlink/data.h>
#include <netlink/route/rtnl.h>
#include <netlink/route/route.h>
#include <netlink/route/link.h>
#include <netlink/route/nexthop.h>
Include dependency graph for route_obj.c:

Macros

#define PRINT_FLAG(f)
 
#define PRINT_FLAG(f)
 
#define PRINT_FLAG(f)
 
#define ROUTE_DIFF(ATTR, EXPR)   ATTR_DIFF(attrs, ROUTE_ATTR_##ATTR, a, b, EXPR)
 

Functions

int rtnl_route_parse (struct nlmsghdr *nlh, struct rtnl_route **result)
 
int rtnl_route_build_msg (struct nl_msg *msg, struct rtnl_route *route)
 
Allocation/Freeing
struct rtnl_routertnl_route_alloc (void)
 
void rtnl_route_get (struct rtnl_route *route)
 
void rtnl_route_put (struct rtnl_route *route)
 
Attributes
void rtnl_route_set_table (struct rtnl_route *route, uint32_t table)
 
uint32_t rtnl_route_get_table (struct rtnl_route *route)
 
void rtnl_route_set_scope (struct rtnl_route *route, uint8_t scope)
 
uint8_t rtnl_route_get_scope (struct rtnl_route *route)
 
void rtnl_route_set_tos (struct rtnl_route *route, uint8_t tos)
 
uint8_t rtnl_route_get_tos (struct rtnl_route *route)
 
void rtnl_route_set_protocol (struct rtnl_route *route, uint8_t protocol)
 
uint8_t rtnl_route_get_protocol (struct rtnl_route *route)
 
void rtnl_route_set_priority (struct rtnl_route *route, uint32_t prio)
 
uint32_t rtnl_route_get_priority (struct rtnl_route *route)
 
int rtnl_route_set_family (struct rtnl_route *route, uint8_t family)
 
uint8_t rtnl_route_get_family (struct rtnl_route *route)
 
int rtnl_route_set_dst (struct rtnl_route *route, struct nl_addr *addr)
 
struct nl_addrrtnl_route_get_dst (struct rtnl_route *route)
 
int rtnl_route_set_src (struct rtnl_route *route, struct nl_addr *addr)
 
struct nl_addrrtnl_route_get_src (struct rtnl_route *route)
 
int rtnl_route_set_type (struct rtnl_route *route, uint8_t type)
 
uint8_t rtnl_route_get_type (struct rtnl_route *route)
 
void rtnl_route_set_flags (struct rtnl_route *route, uint32_t flags)
 
void rtnl_route_unset_flags (struct rtnl_route *route, uint32_t flags)
 
uint32_t rtnl_route_get_flags (struct rtnl_route *route)
 
int rtnl_route_set_metric (struct rtnl_route *route, int metric, uint32_t value)
 
int rtnl_route_unset_metric (struct rtnl_route *route, int metric)
 
int rtnl_route_get_metric (struct rtnl_route *route, int metric, uint32_t *value)
 
int rtnl_route_set_pref_src (struct rtnl_route *route, struct nl_addr *addr)
 
struct nl_addrrtnl_route_get_pref_src (struct rtnl_route *route)
 
void rtnl_route_set_iif (struct rtnl_route *route, int ifindex)
 
int rtnl_route_get_iif (struct rtnl_route *route)
 
void rtnl_route_add_nexthop (struct rtnl_route *route, struct rtnl_nexthop *nh)
 
void rtnl_route_remove_nexthop (struct rtnl_route *route, struct rtnl_nexthop *nh)
 
struct nl_list_headrtnl_route_get_nexthops (struct rtnl_route *route)
 
int rtnl_route_get_nnexthops (struct rtnl_route *route)
 
void rtnl_route_foreach_nexthop (struct rtnl_route *r, void(*cb)(struct rtnl_nexthop *, void *), void *arg)
 
struct rtnl_nexthoprtnl_route_nexthop_n (struct rtnl_route *r, int n)
 
Utilities
int rtnl_route_guess_scope (struct rtnl_route *route)
 Guess scope of a route object. More...
 

Macro Definition Documentation

#define PRINT_FLAG (   f)
Value:
if (flags & RTNH_F_##f) { \
flags &= ~RTNH_F_##f; nl_dump(p, #f "%s", flags ? "," : ""); }
static int struct nlattr enum ipset_adt adt u32 u32 flags
Definition: ip_set_hash_gen.h:1157
void nl_dump(struct nl_dump_params *, const char *,...)
Dump a formatted character string.
Definition: utils.c:739
#define PRINT_FLAG (   f)
Value:
if (flags & RTM_F_##f) { \
flags &= ~RTM_F_##f; nl_dump(p, #f "%s", flags ? "," : ""); }
static int struct nlattr enum ipset_adt adt u32 u32 flags
Definition: ip_set_hash_gen.h:1157
void nl_dump(struct nl_dump_params *, const char *,...)
Dump a formatted character string.
Definition: utils.c:739
#define PRINT_FLAG (   f)
Value:
if (flags & RTCF_##f) { \
flags &= ~RTCF_##f; nl_dump(p, #f "%s", flags ? "," : ""); }
static int struct nlattr enum ipset_adt adt u32 u32 flags
Definition: ip_set_hash_gen.h:1157
void nl_dump(struct nl_dump_params *, const char *,...)
Dump a formatted character string.
Definition: utils.c:739
#define ROUTE_DIFF (   ATTR,
  EXPR 
)    ATTR_DIFF(attrs, ROUTE_ATTR_##ATTR, a, b, EXPR)