Modules | |
Nexthop | |
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_route * | rtnl_route_alloc (void) |
void | rtnl_route_get (struct rtnl_route *route) |
void | rtnl_route_put (struct rtnl_route *route) |
Utilities | |
int | rtnl_route_guess_scope (struct rtnl_route *route) |
Guess scope of a route object. More... | |
void rtnl_route_add_nexthop | ( | struct rtnl_route * | route, |
struct rtnl_nexthop * | nh | ||
) |
References rtnl_route::rt_nexthops, rtnl_route::rt_nr_nh, and rtnl_nexthop::rtnh_list.
Referenced by nl_cli_route_parse_nexthop(), and rtnl_route_parse().
struct rtnl_route* rtnl_route_alloc | ( | void | ) |
References nl_object_alloc(), and route_obj_ops.
Referenced by nl_cli_route_alloc(), and rtnl_route_parse().
int rtnl_route_build_msg | ( | struct nl_msg * | msg, |
struct rtnl_route * | route | ||
) |
References nl_addr_get_prefixlen(), nl_list_for_each_entry, nla_nest_end(), nla_nest_start(), NLA_PUT_ADDR, NLA_PUT_U32, NLE_MISSING_ATTR, NLE_MSGSIZE, NLMSG_ALIGNTO, nlmsg_append(), nlmsg_reserve(), nlmsg_tail(), nl_msg::nm_nlh, NULL, rtnl_route::rt_dst, rtnl_route::rt_family, rtnl_route::rt_flags, rtnl_route::rt_iif, rtnl_route::rt_nexthops, rtnl_route::rt_nmetrics, rtnl_route::rt_pref_src, rtnl_route::rt_prio, rtnl_route::rt_protocol, rtnl_route::rt_scope, RT_SCOPE_NOWHERE, rtnl_route::rt_src, rtnl_route::rt_table, rtnl_route::rt_tos, rtnl_route::rt_type, RTA_DST, RTA_FLOW, RTA_IIF, RTA_METRICS, RTA_MULTIPATH, RTA_PREFSRC, RTA_PRIORITY, RTA_SRC, RTA_TABLE, RTAX_MAX, rtmsg::rtm_dst_len, rtmsg::rtm_family, rtmsg::rtm_scope, rtmsg::rtm_src_len, rtnl_nexthop::rtnh_flags, rtnexthop::rtnh_flags, rtnl_nexthop::rtnh_gateway, rtnexthop::rtnh_hops, rtnl_nexthop::rtnh_ifindex, rtnexthop::rtnh_ifindex, rtnexthop::rtnh_len, rtnl_nexthop::rtnh_list, rtnl_nexthop::rtnh_realms, rtnl_nexthop::rtnh_weight, rtnl_route_get_metric(), rtnl_route_get_nnexthops(), and rtnl_route_guess_scope().
void rtnl_route_foreach_nexthop | ( | struct rtnl_route * | r, |
void(*)(struct rtnl_nexthop *, void *) | cb, | ||
void * | arg | ||
) |
References nl_list_for_each_entry, rtnl_route::rt_nexthops, and rtnl_nexthop::rtnh_list.
void rtnl_route_get | ( | struct rtnl_route * | route | ) |
struct nl_addr* rtnl_route_get_dst | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_dst.
uint8_t rtnl_route_get_family | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_family.
Referenced by nl_cli_route_parse_dst(), nl_cli_route_parse_nexthop(), nl_cli_route_parse_pref_src(), and nl_cli_route_parse_src().
uint32_t rtnl_route_get_flags | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_flags.
int rtnl_route_get_iif | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_iif.
int rtnl_route_get_metric | ( | struct rtnl_route * | route, |
int | metric, | ||
uint32_t * | value | ||
) |
References NLE_OBJ_NOTFOUND, NLE_RANGE, rtnl_route::rt_metrics, and rtnl_route::rt_metrics_mask.
Referenced by rtnl_route_build_msg().
struct nl_list_head* rtnl_route_get_nexthops | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_nexthops.
int rtnl_route_get_nnexthops | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_nr_nh.
Referenced by rtnl_route_build_msg().
struct nl_addr* rtnl_route_get_pref_src | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_pref_src.
uint32_t rtnl_route_get_priority | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_prio.
uint8_t rtnl_route_get_protocol | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_protocol.
uint8_t rtnl_route_get_scope | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_scope.
struct nl_addr* rtnl_route_get_src | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_src.
uint32_t rtnl_route_get_table | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_table.
uint8_t rtnl_route_get_tos | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_tos.
uint8_t rtnl_route_get_type | ( | struct rtnl_route * | route | ) |
References rtnl_route::rt_type.
int rtnl_route_guess_scope | ( | struct rtnl_route * | route | ) |
Guess scope of a route object.
Guesses the scope of a route object, based on the following rules:
References nl_list_for_each_entry, rtnl_route::rt_nexthops, RT_SCOPE_HOST, RT_SCOPE_LINK, RT_SCOPE_UNIVERSE, rtnl_route::rt_type, RTN_LOCAL, rtnl_nexthop::rtnh_gateway, and rtnl_nexthop::rtnh_list.
Referenced by rtnl_route_build_msg().
struct rtnl_nexthop* rtnl_route_nexthop_n | ( | struct rtnl_route * | r, |
int | n | ||
) |
References nl_list_for_each_entry, NULL, rtnl_route::rt_nexthops, rtnl_route::rt_nr_nh, and rtnl_nexthop::rtnh_list.
int rtnl_route_parse | ( | struct nlmsghdr * | nlh, |
struct rtnl_route ** | result | ||
) |
References BUG, rtnl_nexthop::ce_mask, nl_addr_alloc(), nl_addr_alloc_attr(), nl_addr_put(), nl_addr_set_family(), nl_addr_set_prefixlen(), nl_list_first_entry, nla_get_u32(), nla_len(), nla_memcpy(), nla_parse_nested(), NLE_INVAL, NLE_NOMEM, nlmsg_data(), nlmsg_parse(), nlmsghdr::nlmsg_type, NULL, rtnl_route::rt_cacheinfo, rtnl_route::rt_family, rtnl_route::rt_flags, rtnl_route::rt_nexthops, rtnl_route::rt_nr_nh, rtnl_route::rt_protocol, rtnl_route::rt_scope, rtnl_route::rt_table, rtnl_route::rt_tos, rtnl_route::rt_type, RTA_CACHEINFO, RTA_DST, RTA_FLOW, RTA_IIF, RTA_MAX, RTA_METRICS, RTA_MULTIPATH, RTA_OIF, RTA_PREFSRC, RTA_PRIORITY, RTA_SRC, RTAX_MAX, rtmsg::rtm_dst_len, rtmsg::rtm_family, rtmsg::rtm_flags, rtmsg::rtm_protocol, rtmsg::rtm_scope, rtmsg::rtm_src_len, rtmsg::rtm_table, rtmsg::rtm_tos, rtmsg::rtm_type, rtnl_nexthop::rtnh_list, rtnl_route_add_nexthop(), rtnl_route_alloc(), rtnl_route_nh_alloc(), rtnl_route_nh_compare(), rtnl_route_nh_free(), rtnl_route_nh_set_gateway(), rtnl_route_nh_set_ifindex(), rtnl_route_nh_set_realms(), rtnl_route_put(), rtnl_route_set_dst(), rtnl_route_set_iif(), rtnl_route_set_metric(), rtnl_route_set_pref_src(), rtnl_route_set_priority(), rtnl_route_set_src(), and tb.
void rtnl_route_put | ( | struct rtnl_route * | route | ) |
References nl_object_put().
Referenced by rtnl_route_parse().
void rtnl_route_remove_nexthop | ( | struct rtnl_route * | route, |
struct rtnl_nexthop * | nh | ||
) |
References rtnl_route::rt_nr_nh, and rtnl_nexthop::rtnh_list.
int rtnl_route_set_dst | ( | struct rtnl_route * | route, |
struct nl_addr * | addr | ||
) |
References nl_addr::a_family, nl_addr_get(), nl_addr_put(), NLE_AF_MISMATCH, rtnl_route::rt_dst, and rtnl_route::rt_family.
Referenced by nl_cli_route_parse_dst(), and rtnl_route_parse().
int rtnl_route_set_family | ( | struct rtnl_route * | route, |
uint8_t | family | ||
) |
References NLE_AF_NOSUPPORT, and rtnl_route::rt_family.
Referenced by nl_cli_route_parse_family().
void rtnl_route_set_flags | ( | struct rtnl_route * | route, |
uint32_t | flags | ||
) |
References flags, rtnl_route::rt_flag_mask, and rtnl_route::rt_flags.
void rtnl_route_set_iif | ( | struct rtnl_route * | route, |
int | ifindex | ||
) |
References rtnl_route::rt_iif.
Referenced by nl_cli_route_parse_iif(), and rtnl_route_parse().
int rtnl_route_set_metric | ( | struct rtnl_route * | route, |
int | metric, | ||
uint32_t | value | ||
) |
References NLE_RANGE, rtnl_route::rt_metrics, rtnl_route::rt_metrics_mask, rtnl_route::rt_nmetrics, and value.
Referenced by rtnl_route_parse().
int rtnl_route_set_pref_src | ( | struct rtnl_route * | route, |
struct nl_addr * | addr | ||
) |
References nl_addr::a_family, nl_addr_get(), nl_addr_put(), NLE_AF_MISMATCH, rtnl_route::rt_family, and rtnl_route::rt_pref_src.
Referenced by nl_cli_route_parse_pref_src(), and rtnl_route_parse().
void rtnl_route_set_priority | ( | struct rtnl_route * | route, |
uint32_t | prio | ||
) |
References rtnl_route::rt_prio.
Referenced by nl_cli_route_parse_prio(), and rtnl_route_parse().
void rtnl_route_set_protocol | ( | struct rtnl_route * | route, |
uint8_t | protocol | ||
) |
References rtnl_route::rt_protocol.
Referenced by nl_cli_route_parse_protocol().
void rtnl_route_set_scope | ( | struct rtnl_route * | route, |
uint8_t | scope | ||
) |
References rtnl_route::rt_scope.
Referenced by nl_cli_route_parse_scope().
int rtnl_route_set_src | ( | struct rtnl_route * | route, |
struct nl_addr * | addr | ||
) |
References nl_addr::a_family, nl_addr_get(), nl_addr_put(), NLE_AF_MISMATCH, NLE_SRCRT_NOSUPPORT, rtnl_route::rt_family, and rtnl_route::rt_src.
Referenced by nl_cli_route_parse_src(), and rtnl_route_parse().
void rtnl_route_set_table | ( | struct rtnl_route * | route, |
uint32_t | table | ||
) |
References rtnl_route::rt_table.
Referenced by nl_cli_route_parse_table().
void rtnl_route_set_tos | ( | struct rtnl_route * | route, |
uint8_t | tos | ||
) |
References rtnl_route::rt_tos.
int rtnl_route_set_type | ( | struct rtnl_route * | route, |
uint8_t | type | ||
) |
References NLE_RANGE, rtnl_route::rt_type, RTN_MAX, and type.
Referenced by nl_cli_route_parse_type().
void rtnl_route_unset_flags | ( | struct rtnl_route * | route, |
uint32_t | flags | ||
) |
References flags, rtnl_route::rt_flag_mask, and rtnl_route::rt_flags.
int rtnl_route_unset_metric | ( | struct rtnl_route * | route, |
int | metric | ||
) |
References NLE_RANGE, rtnl_route::rt_metrics_mask, and rtnl_route::rt_nmetrics.