/freebsd/sys/net/route/ |
H A D | route_ctl.c | 77 static int add_route_byinfo(struct rib_head *rnh, struct rt_addrinfo *info, 79 static int change_route_byinfo(struct rib_head *rnh, struct rtentry *rt, 83 static int add_route_flags(struct rib_head *rnh, struct rtentry *rt, 86 static int add_route_flags_mpath(struct rib_head *rnh, struct rtentry *rt, 91 static int add_route(struct rib_head *rnh, struct rtentry *rt, 93 static int delete_route(struct rib_head *rnh, struct rtentry *rt, 95 static int rt_delete_conditional(struct rib_head *rnh, struct rtentry *rt, 150 struct rib_head *rnh; in get_rnh() local 156 rnh = rt_tables_get_rnh(fibnum, dst->sa_family); in get_rnh() 158 return (rnh); in get_rnh() [all …]
|
H A D | route_subscription.c | 48 struct rib_head *rnh; member 56 rib_notify(struct rib_head *rnh, enum rib_subscription_type type, in rib_notify() argument 61 CK_STAILQ_FOREACH(rs, &rnh->rnh_subscribers, next) { in rib_notify() 63 rs->func(rnh, rc, rs->arg); in rib_notify() 95 struct rib_head *rnh; in rib_subscribe() local 100 rnh = rt_tables_get_rnh(fibnum, family); in rib_subscribe() 103 return (rib_subscribe_internal(rnh, f, arg, type, waitok)); in rib_subscribe() 107 rib_subscribe_internal(struct rib_head *rnh, rib_subscription_cb_t *f, void *arg, in rib_subscribe_internal() argument 115 rs->rnh = rnh; in rib_subscribe_internal() 118 RIB_WLOCK(rnh); in rib_subscribe_internal() [all …]
|
H A D | route_temporal.c | 84 struct rib_head *rnh; in expire_callout() local 88 rnh = (struct rib_head *)arg; in expire_callout() 90 CURVNET_SET(rnh->rib_vnet); in expire_callout() 93 rib_walk_del(rnh->rib_fibnum, rnh->rib_family, expire_route, in expire_callout() 96 RIB_WLOCK(rnh); in expire_callout() 101 callout_reset_sbt(&rnh->expire_callout, SBT_1S * seconds, in expire_callout() 102 SBT_1MS * 500, expire_callout, rnh, 0); in expire_callout() 103 rnh->next_expire = next_expire; in expire_callout() 109 if (callout_pending(&rnh->expire_callout) == 0) in expire_callout() 110 rnh->next_expire = 0; in expire_callout() [all …]
|
H A D | route_var.h | 118 rib_bump_gen(struct rib_head *rnh) in rib_bump_gen() argument 121 rnh->rnh_gen_rib++; in rib_bump_gen() 123 rnh->rnh_gen++; in rib_bump_gen() 207 void tmproutes_update(struct rib_head *rnh, struct rtentry *rt, struct nhop_object *nh); 213 int change_route(struct rib_head *rnh, struct rtentry *rt, 215 int change_route_conditional(struct rib_head *rnh, struct rtentry *rt, 218 struct rtentry *lookup_prefix(struct rib_head *rnh, 220 struct rtentry *lookup_prefix_rt(struct rib_head *rnh, const struct rtentry *rt, 236 struct rtentry *rt_alloc(struct rib_head *rnh, const struct sockaddr *dst, 240 void rib_init_subscriptions(struct rib_head *rnh); [all …]
|
H A D | route_helpers.c | 76 rib_walk_ext_locked(struct rib_head *rnh, rib_walktree_f_t *wa_f, in rib_walk_ext_locked() argument 80 hook_f(rnh, RIB_WALK_HOOK_PRE, arg); in rib_walk_ext_locked() 81 rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f, arg); in rib_walk_ext_locked() 83 hook_f(rnh, RIB_WALK_HOOK_POST, arg); in rib_walk_ext_locked() 96 rib_walk_ext_internal(struct rib_head *rnh, bool wlock, rib_walktree_f_t *wa_f, in rib_walk_ext_internal() argument 102 RIB_WLOCK(rnh); in rib_walk_ext_internal() 104 RIB_RLOCK(rnh); in rib_walk_ext_internal() 105 rib_walk_ext_locked(rnh, wa_f, hook_f, arg); in rib_walk_ext_internal() 107 RIB_WUNLOCK(rnh); in rib_walk_ext_internal() 109 RIB_RUNLOCK(rnh); in rib_walk_ext_internal() [all …]
|
H A D | route_ctl.h | 102 typedef void rib_walk_hook_f_t(struct rib_head *rnh, enum rib_walk_hook stage, 108 void rib_walk_ext_internal(struct rib_head *rnh, bool wlock, 110 void rib_walk_ext_locked(struct rib_head *rnh, rib_walktree_f_t *wa_f, 127 rib_lookup_prefix_plen(struct rib_head *rnh, struct sockaddr *dst, int plen, 189 typedef void rib_subscription_cb_t(struct rib_head *rnh, struct rib_cmd_info *rc, 195 struct rib_subscription *rib_subscribe_internal(struct rib_head *rnh, 198 struct rib_subscription *rib_subscribe_locked(struct rib_head *rnh, 202 void rib_notify(struct rib_head *rnh, enum rib_subscription_type type,
|
H A D | route_tables.c | 323 struct rib_head *rnh; in rtables_destroy() local 333 rnh = rt_tables_get_rnh(i, family); in rtables_destroy() 334 dom->dom_rtdetach(rnh); in rtables_destroy() 370 /* rnh is [fib=0][af=0]. */ in rt_tables_get_rnh_ptr() 398 struct rib_head *rnh; in rt_tables_get_gen() local 400 rnh = rt_tables_get_rnh_ptr(table, family); in rt_tables_get_gen() 401 KASSERT(rnh != NULL, ("%s: NULL rib_head pointer table %d family %d", in rt_tables_get_gen() 403 return (rnh->rnh_gen); in rt_tables_get_gen()
|
H A D | nhop_ctl.c | 256 nhop_create_from_info(struct rib_head *rnh, struct rt_addrinfo *info, in nhop_create_from_info() argument 267 FIB_RH_LOG(LOG_DEBUG, rnh, "error: empty gateway"); in nhop_create_from_info() 271 struct nhop_object *nh = nhop_alloc(rnh->rib_fibnum, rnh->rib_family); in nhop_create_from_info() 283 error = rnh->rnh_set_nh_pfxflags(rnh->rib_fibnum, info->rti_info[RTAX_DST], in nhop_create_from_info() 315 struct rib_head *rnh = nhop_get_rh(nh); in nhop_get_nhop() local 317 if (__predict_false(rnh == NULL)) { in nhop_get_nhop() 323 return (nhop_get_nhop_internal(rnh, nh, perror)); in nhop_get_nhop() 327 nhop_get_nhop_internal(struct rib_head *rnh, struct nhop_object *nh, int *perror) in nhop_get_nhop_internal() argument 335 error = rnh->rnh_augment_nh(rnh->rib_fibnum, nh); in nhop_get_nhop_internal() 342 tmp_priv = find_nhop(rnh->nh_control, nh->nh_priv); in nhop_get_nhop_internal() [all …]
|
H A D | route_ddb.c | 170 struct rib_head *rnh; in DB_SHOW_COMMAND() local 181 rnh = rt_tables_get_rnh(0, i); in DB_SHOW_COMMAND() 182 if (rnh == NULL) { in DB_SHOW_COMMAND() 199 error = rnh->rnh_walktree(&rnh->head, rt_dumpentry_ddb, NULL); in DB_SHOW_COMMAND()
|
H A D | fib_algo.h | 78 typedef enum flm_op_result flm_change_t(struct rib_head *rnh, 80 typedef enum flm_op_result flm_change_batch_t(struct rib_head *rnh,
|
H A D | fib_algo.c | 772 handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, in handle_rtable_change_cb() argument 778 RIB_WLOCK_ASSERT(rnh); in handle_rtable_change_cb() 831 result = fd->fd_flm->flm_change_rib_item_cb(rnh, rc, fd->fd_algo_data); in handle_rtable_change_cb() 916 sync_algo_end_cb(struct rib_head *rnh, enum rib_walk_hook stage, void *_data) in sync_algo_end_cb() argument 923 if (rnh->rib_dying) { in sync_algo_end_cb()
|
H A D | route_rtentry.c | 82 rt_alloc(struct rib_head *rnh, const struct sockaddr *dst, in rt_alloc() argument
|
/freebsd/sys/net/ |
H A D | radix.h | 161 #define RADIX_NODE_HEAD_LOCK_INIT(rnh) \ argument 162 rm_init(&(rnh)->rnh_lock, "radix node head") 163 #define RADIX_NODE_HEAD_LOCK(rnh) rm_wlock(&(rnh)->rnh_lock) argument 164 #define RADIX_NODE_HEAD_UNLOCK(rnh) rm_wunlock(&(rnh)->rnh_lock) argument 165 #define RADIX_NODE_HEAD_RLOCK(rnh) rm_rlock(&(rnh)->rnh_lock,\ argument 167 #define RADIX_NODE_HEAD_RUNLOCK(rnh) rm_runlock(&(rnh)->rnh_lock,\ argument 169 #define RADIX_NODE_HEAD_DESTROY(rnh) rm_destroy(&(rnh)->rnh_lock) argument 170 #define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rm_assert(&(rnh)->rnh_lock, RA_LOCKED) argument 171 #define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rm_assert(&(rnh)->rnh_lock, RA_WLOCKED) argument
|
H A D | radix.c | 1137 struct radix_node_head *rnh; in rn_inithead() local 1140 rnh = *head; in rn_inithead() 1146 R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh)); in rn_inithead() 1148 if (rnh == NULL || rmh == NULL) { in rn_inithead() 1149 if (rnh != NULL) in rn_inithead() 1150 R_Free(rnh); in rn_inithead() 1157 rn_inithead_internal(&rnh->rh, rnh->rnh_nodes, off); in rn_inithead() 1159 *head = rnh; in rn_inithead() 1160 rnh->rh.rnh_masks = rmh; in rn_inithead() 1163 rnh->rnh_addaddr = rn_addroute; in rn_inithead() [all …]
|
H A D | route.c | 143 struct radix_head * const rnh = arg; in rt_freeentry() local 146 x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); in rt_freeentry() 514 struct rib_head *rnh; in rt_updatemtu() local 526 rnh = rt_tables_get_rnh(j, i); in rt_updatemtu() 527 if (rnh == NULL) in rt_updatemtu() 529 nhops_update_ifmtu(rnh, ifp, mtu); in rt_updatemtu()
|
H A D | rtsock.c | 772 struct rib_head *rnh; in handle_rtm_get() local 778 rnh = rt_tables_get_rnh(fibnum, saf); in handle_rtm_get() 779 if (rnh == NULL) in handle_rtm_get() 782 RIB_RLOCK(rnh); in handle_rtm_get() 797 rc->rc_rt = (struct rtentry *) rnh->rnh_matchaddr( in handle_rtm_get() 798 info->rti_info[RTAX_DST], &rnh->head); in handle_rtm_get() 800 rc->rc_rt = (struct rtentry *) rnh->rnh_lookup( in handle_rtm_get() 802 info->rti_info[RTAX_NETMASK], &rnh->head); in handle_rtm_get() 805 RIB_RUNLOCK(rnh); in handle_rtm_get() 811 RIB_RUNLOCK(rnh); in handle_rtm_get() [all …]
|
/freebsd/sys/netpfil/ipfilter/netinet/ |
H A D | radix_ipf.c | 998 void delete_addr(ipf_rdx_head_t *rnh, int item); 999 void dumptree(ipf_rdx_head_t *rnh); 1004 void test_addr(ipf_rdx_head_t *rnh, int pref, addrfamily_t *, int); 1174 printroots(ipf_rdx_head_t *rnh) in printroots() argument 1177 GNAME(&rnh->nodes[0]), in printroots() 1178 rnh->nodes[0].index, GNAME(rnh->nodes[0].parent), in printroots() 1179 GNAME(rnh->nodes[0].left), GNAME(rnh->nodes[0].right)); in printroots() 1181 GNAME(&rnh->nodes[1]), in printroots() 1182 rnh->nodes[1].index, GNAME(rnh->nodes[1].parent), in printroots() 1183 GNAME(rnh->nodes[1].left), GNAME(rnh->nodes[1].right)); in printroots() [all …]
|
/freebsd/sys/kern/ |
H A D | vfs_export.c | 106 struct radix_node_head *rnh; in vfs_hang_addrlist() local 178 rnh = NULL; in vfs_hang_addrlist() 182 if ((rnh = nep->ne4) == NULL) { in vfs_hang_addrlist() 184 rnh = vfs_create_addrlist_af(&nep->ne4, off); in vfs_hang_addrlist() 190 if ((rnh = nep->ne6) == NULL) { in vfs_hang_addrlist() 192 rnh = vfs_create_addrlist_af(&nep->ne6, off); in vfs_hang_addrlist() 197 if (rnh == NULL) { in vfs_hang_addrlist() 204 RADIX_NODE_HEAD_LOCK(rnh); in vfs_hang_addrlist() 205 rn = (*rnh->rnh_addaddr)(saddr, smask, &rnh->rh, np->netc_rnodes); in vfs_hang_addrlist() 206 RADIX_NODE_HEAD_UNLOCK(rnh); in vfs_hang_addrlist() [all …]
|
/freebsd/sys/netinet6/ |
H A D | in6_fib_algo.c | 89 struct radix_node_head *rnh; member 100 struct radix_node_head *rnh = (struct radix_node_head *)algo_data; in lradix6_lookup() local 108 ent = (struct radix6_addr_entry *)(rn_match(&addr6, &rnh->rh)); in lradix6_lookup() 135 if (lr == NULL || !rn_inithead((void **)&lr->rnh, OFF_LEN_INET6)) in lradix6_init() 159 if (lr->rnh != NULL) in lradix6_destroy() 160 rn_detachhead((void **)&lr->rnh); in lradix6_destroy() 199 rn = lr->rnh->rnh_addaddr((struct sockaddr *)&ae->addr, in lradix6_add_route_cb() 200 (struct sockaddr *)rt_mask, &lr->rnh->rh, ae->rn); in lradix6_add_route_cb() 213 dp->arg = lr->rnh; in lradix6_end_dump() 219 lradix6_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, in lradix6_change_cb() argument [all …]
|
H A D | nd6.h | 376 void nd6_subscription_cb(struct rib_head *rnh, struct rib_cmd_info *rc,
|
/freebsd/sys/netinet/ |
H A D | in_fib_algo.c | 479 bsearch4_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, in bsearch4_change_cb() argument 518 struct radix_node_head *rnh; member 529 struct radix_node_head *rnh = (struct radix_node_head *)algo_data; in lradix4_lookup() local 535 ent = (struct radix4_addr_entry *)(rn_match(&addr4, &rnh->rh)); in lradix4_lookup() 567 if (lr == NULL || !rn_inithead((void **)&lr->rnh, OFF_LEN_INET)) in lradix4_init() 591 if (lr->rnh != NULL) in lradix4_destroy() 592 rn_detachhead((void **)&lr->rnh); in lradix4_destroy() 629 rn = lr->rnh->rnh_addaddr((struct sockaddr *)&ae->addr, rt_mask, in lradix4_add_route_cb() 630 &lr->rnh->rh, ae->rn); in lradix4_add_route_cb() 643 dp->arg = lr->rnh; in lradix4_end_dump() [all …]
|
/freebsd/sys/netpfil/ipfw/ |
H A D | ip_fw_table_algo.c | 414 struct radix_node_head *rnh; in ta_lookup_addr_radix() local 421 rnh = (struct radix_node_head *)ti->state; in ta_lookup_addr_radix() 422 ent = (struct addr_radix_entry *)(rnh->rnh_matchaddr(&sa, &rnh->rh)); in ta_lookup_addr_radix() 432 rnh = (struct radix_node_head *)ti->xstate; in ta_lookup_addr_radix() 433 xent = (struct addr_radix_xentry *)(rnh->rnh_matchaddr(&sa6, &rnh->rh)); in ta_lookup_addr_radix() 470 struct radix_node_head * const rnh = arg; in flush_radix_entry() local 474 rnh->rnh_deladdr(rn->rn_key, rn->rn_mask, &rnh->rh); in flush_radix_entry() 484 struct radix_node_head *rnh; in ta_destroy_addr_radix() local 488 rnh = (struct radix_node_head *)(ti->state); in ta_destroy_addr_radix() 489 rnh->rnh_walktree(&rnh->rh, flush_radix_entry, rnh); in ta_destroy_addr_radix() [all …]
|
/freebsd/sbin/routed/ |
H A D | radix.c | 844 struct radix_node_head *rnh; in rn_inithead() local 848 rnh = (struct radix_node_head *)rtmalloc(sizeof(*rnh), "rn_inithead"); in rn_inithead() 849 Bzero(rnh, sizeof (*rnh)); in rn_inithead() 850 *head = rnh; in rn_inithead() 851 t = rn_newpair(rn_zeros, off, rnh->rnh_nodes); in rn_inithead() 852 ttt = rnh->rnh_nodes + 2; in rn_inithead() 860 rnh->rnh_addaddr = rn_addroute; in rn_inithead() 861 rnh->rnh_deladdr = rn_delete; in rn_inithead() 862 rnh->rnh_matchaddr = rn_match; in rn_inithead() 863 rnh->rnh_lookup = rn_lookup; in rn_inithead() [all …]
|
/freebsd/sys/netlink/route/ |
H A D | rt.c | 626 struct rib_head *rnh; in handle_rtm_getroute() 637 rnh = rt_tables_get_rnh(fibnum, family); in handle_rtm_getroute() 638 if (rnh == NULL) in handle_rtm_getroute() 641 RIB_RLOCK(rnh); in handle_rtm_getroute() 646 rt = rib_lookup_prefix_plen(rnh, dst, attrs->rtm_dst_len, &rnd); in handle_rtm_getroute() 648 rt = (const struct rtentry *)rnh->rnh_matchaddr(dst, &rnh->head); in handle_rtm_getroute() 650 RIB_RUNLOCK(rnh); in handle_rtm_getroute() 657 RIB_RUNLOCK(rnh); in handle_rtm_getroute() 614 struct rib_head *rnh; handle_rtm_getroute() local
|
/freebsd/sys/contrib/dpdk_rte_lpm/ |
H A D | dpdk_lpm.c | 214 handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, in handle_rtable_change_cb() argument
|