Home
last modified time | relevance | path

Searched refs:nh (Results 1 – 25 of 94) sorted by relevance

1234

/f-stack/freebsd/net/route/
H A Dnhop_ctl.c282 nh = nh_priv->nh; in fill_nhop_from_info()
298 nh->nh_aifp = get_aifp(nh, 0); in fill_nhop_from_info()
439 nh->nh_aifp = get_aifp(nh, 0); in alter_nhop_from_info()
464 nh = nh_priv->nh; in nhop_create_from_nhop()
508 nh_priv->nh = nh; in alloc_nhop_structure()
525 nh = nh_priv->nh; in finalize_nhop()
542 nh->nh_aifp = get_aifp(nh, 1); in finalize_nhop()
597 prefix, nh->nh_priv, nh->nh_priv->nh_family, nh->nh_ifp, in print_nhop()
599 if_name(nh->nh_aifp), nh->nh_mtu, nh->nh_flags); in print_nhop()
607 nh = nh_priv->nh; in destroy_nhop()
[all …]
H A Droute_helpers.c196 struct nhop_object *nh; in rib_lookup() local
198 nh = NULL; in rib_lookup()
220 return (nh); in rib_lookup()
240 tmp.nh = rc->rc_nh_old; in decompose_change_notification()
248 tmp.nh = rc->rc_nh_new; in decompose_change_notification()
298 rc_del.rc_nh_old = wn_old[idx_old].nh; in decompose_change_notification()
319 rc_del.rc_nh_old = wn_old[idx_old].nh; in decompose_change_notification()
327 rc_del.rc_nh_old = wn_old[idx_old].nh; in decompose_change_notification()
334 rc_add.rc_nh_new = wn_new[idx_new].nh; in decompose_change_notification()
363 rc_new.rc_nh_new = wn[i].nh; in rib_decompose_notification()
[all …]
H A Droute_var.h52 const struct sockaddr *mask, struct nhop_object *nh);
220 bool nhop_can_multipath(const struct nhop_object *nh);
225 const struct nhop_object *nh);
238 void nhop_ref_object(struct nhop_object *nh);
239 int nhop_try_ref_object(struct nhop_object *nh);
240 void nhop_ref_any(struct nhop_object *nh);
241 void nhop_free_any(struct nhop_object *nh);
265 nhop_select(struct nhop_object *nh, uint32_t flowid) in nhop_select() argument
269 if (NH_IS_NHGRP(nh)) { in nhop_select()
271 nh = nhg->nhops[flowid % nhg->nhg_size]; in nhop_select()
[all …]
H A Droute_ctl.c146 nh = wn[0].nh; in destroy_rtentry()
435 return (memcmp(&nh->gw_sa, gw, nh->gw_sa.sa_len) == 0); in match_nhop_gw()
614 nhop_free(nh); in create_rtentry()
618 rt->rt_nhop = nh; in create_rtentry()
666 nh = rt->rt_nhop; in add_route()
680 nhop_free(nh); in add_route()
716 nhop_free(nh); in add_route()
783 nh = rt->rt_nhop; in rt_unlinkrte()
971 nh = NULL; in change_mpath_route()
1030 nh = NULL; in change_route()
[all …]
H A Dnhop.h167 struct nhop_object *nh; member
171 void nhop_free(struct nhop_object *nh);
177 uint32_t nhop_get_idx(const struct nhop_object *nh);
178 enum nhop_type nhop_get_type(const struct nhop_object *nh);
179 int nhop_get_rtflags(const struct nhop_object *nh);
180 struct vnet *nhop_get_vnet(const struct nhop_object *nh);
181 struct nhop_object *nhop_select_func(struct nhop_object *nh, uint32_t flowid);
/f-stack/dpdk/drivers/net/tap/
H A Dtap_netlink.c123 nh->nlmsg_seq = (uint32_t)rte_rand(); in tap_nl_send()
126 send_bytes = send(nlsk_fd, nh, nh->nlmsg_len, 0); in tap_nl_send()
170 const char *tail = (const char *)nh + NLMSG_ALIGN(nh->nlmsg_len); in tap_nl_dump_ext_ack()
177 if (!(nh->nlmsg_flags & NLM_F_CAPPED)) in tap_nl_dump_ext_ack()
244 struct nlmsghdr *nh; in tap_nl_recv() local
255 for (nh = (struct nlmsghdr *)buf; in tap_nl_recv()
257 nh = NLMSG_NEXT(nh, recv_bytes)) { in tap_nl_recv()
261 tap_nl_dump_ext_ack(nh, err_data); in tap_nl_recv()
271 if (nh->nlmsg_type == NLMSG_DONE) in tap_nl_recv()
276 ret = cb(nh, arg); in tap_nl_recv()
[all …]
H A Dtap_netlink.h20 struct nlmsghdr nh; member
30 int tap_nl_send(int nlsk_fd, struct nlmsghdr *nh);
34 void tap_nlattr_add(struct nlmsghdr *nh, unsigned short type,
36 void tap_nlattr_add8(struct nlmsghdr *nh, unsigned short type, uint8_t data);
37 void tap_nlattr_add16(struct nlmsghdr *nh, unsigned short type, uint16_t data);
38 void tap_nlattr_add32(struct nlmsghdr *nh, unsigned short type, uint32_t data);
H A Dtap_tcmsgs.c47 struct nlmsghdr *n = &msg->nh; in tc_init_msg()
92 if (tap_nl_send(fd, &msg.nh) < 0) in qdisc_del()
126 tap_nlattr_add(&msg.nh, TCA_KIND, sizeof("multiq"), "multiq"); in qdisc_add_multiq()
127 tap_nlattr_add(&msg.nh, TCA_OPTIONS, sizeof(opt), &opt); in qdisc_add_multiq()
128 if (tap_nl_send(nlsk_fd, &msg.nh) < 0) in qdisc_add_multiq()
155 tap_nlattr_add(&msg.nh, TCA_KIND, sizeof("ingress"), "ingress"); in qdisc_add_ingress()
156 if (tap_nl_send(nlsk_fd, &msg.nh) < 0) in qdisc_add_ingress()
175 qdisc_del_cb(struct nlmsghdr *nh, void *arg) in qdisc_del_cb() argument
177 struct tcmsg *t = NLMSG_DATA(nh); in qdisc_del_cb()
222 if (tap_nl_send(nlsk_fd, &msg.nh) < 0) in qdisc_iterate()
H A Dtap_flow.c544 tap_nlattr_add(&msg->nh, in tap_flow_create_eth()
552 tap_nlattr_add(&msg->nh, in tap_flow_create_eth()
610 tap_nlattr_add8(&msg->nh, in tap_flow_create_vlan()
613 tap_nlattr_add16(&msg->nh, in tap_flow_create_vlan()
725 tap_nlattr_add8(&msg->nh, in tap_flow_create_ipv6()
926 tap_nlattr_add(&msg->nh, TCA_ACT_KIND, in add_action()
938 tap_nlattr_add(&msg->nh, TCA_MIRRED_PARMS, in add_action()
1123 tap_nlattr_add16(&flow->msg.nh, in priv_flow_process()
1396 err = tap_nl_send(pmd->nlsk_fd, &msg->nh); in tap_flow_create()
1491 flow->msg.nh.nlmsg_type = RTM_DELTFILTER; in tap_flow_destroy_pmd()
[all …]
/f-stack/freebsd/netinet/
H A Din_rmx.c56 struct nhop_object *nh) in rib4_preadd() argument
64 rt_flags = nhop_get_rtflags(nh); in rib4_preadd()
82 nh->nh_flags |= NHF_BROADCAST; in rib4_preadd()
91 if (nh->nh_mtu == 0) { in rib4_preadd()
92 nh->nh_mtu = nh->nh_ifp->if_mtu; in rib4_preadd()
93 } else if (nh->nh_mtu > nh->nh_ifp->if_mtu) in rib4_preadd()
94 nh->nh_mtu = nh->nh_ifp->if_mtu; in rib4_preadd()
100 nh->nh_flags |= NHF_DEFAULT; in rib4_preadd()
103 if (nhop_get_type(nh) == 0) { in rib4_preadd()
109 nhop_set_type(nh, nh_type); in rib4_preadd()
[all …]
H A Din_fib.c116 struct nhop_object *nh; in fib4_lookup() local
121 if (nh != NULL) { in fib4_lookup()
122 nh = nhop_select(nh, flowid); in fib4_lookup()
127 return (nh); in fib4_lookup()
155 nh = NULL; in fib4_lookup()
165 return (nh); in fib4_lookup()
198 if (NH_IS_NHGRP(nh)) { in check_urpf()
232 nh = NULL; in lookup_nhop()
239 return (nh); in lookup_nhop()
265 if (nh != NULL) in fib4_check_urpf()
[all …]
H A Dip_fastfwd.c139 if (nh != NULL && in ip_redir_alloc()
159 struct nhop_object *nh; in ip_findroute() local
163 if (nh == NULL) { in ip_findroute()
178 if (nh->nh_flags & NHF_REJECT) { in ip_findroute()
184 *pnh = nh; in ip_findroute()
201 struct nhop_object *nh = NULL; in ip_tryforward() local
427 if (nh->nh_flags & NHF_GATEWAY) in ip_tryforward()
442 if (ip_len <= nh->nh_mtu) { in ip_tryforward()
451 error = (*nh->nh_ifp->if_output)(nh->nh_ifp, m, in ip_tryforward()
460 0, nh->nh_mtu); in ip_tryforward()
[all …]
/f-stack/freebsd/netinet6/
H A Din6_fib.c124 struct nhop_object *nh; in fib6_lookup() local
129 if (nh != NULL) { in fib6_lookup()
130 nh = nhop_select(nh, flowid); in fib6_lookup()
134 nhop_ref_object(nh); in fib6_lookup()
135 return (nh); in fib6_lookup()
174 return (nh); in fib6_lookup()
207 if (NH_IS_NHGRP(nh)) { in check_urpf()
246 nh = NULL; in lookup_nhop()
253 return (nh); in lookup_nhop()
279 if (nh != NULL) in fib6_check_urpf()
[all …]
H A Din6_rmx.c103 struct nhop_object *nh) in rib6_preadd() argument
114 if (nh->nh_mtu == 0) { in rib6_preadd()
115 nh->nh_mtu = IN6_LINKMTU(nh->nh_ifp); in rib6_preadd()
116 } else if (nh->nh_mtu > IN6_LINKMTU(nh->nh_ifp)) in rib6_preadd()
117 nh->nh_mtu = IN6_LINKMTU(nh->nh_ifp); in rib6_preadd()
121 if ((nhop_get_rtflags(nh) & RTF_HOST) == 0 && mask6 != NULL && in rib6_preadd()
123 nh->nh_flags |= NHF_DEFAULT; in rib6_preadd()
126 if (nhop_get_type(nh) == 0) { in rib6_preadd()
127 if (nh->nh_flags & NHF_GATEWAY) in rib6_preadd()
132 nhop_set_type(nh, nh_type); in rib6_preadd()
H A Dip6_fastfwd.c62 struct nhop_object *nh; in ip6_findroute() local
66 if (nh == NULL) { in ip6_findroute()
73 if (nh->nh_flags & NHF_BLACKHOLE) { in ip6_findroute()
79 if (nh->nh_flags & NHF_REJECT) { in ip6_findroute()
86 *pnh = nh; in ip6_findroute()
95 struct nhop_object *nh; in ip6_tryforward() local
205 if (m->m_pkthdr.len > nh->nh_mtu) { in ip6_tryforward()
225 if (m->m_pkthdr.len > nh->nh_mtu) { in ip6_tryforward()
283 if (nh->nh_flags & NHF_GATEWAY) in ip6_tryforward()
284 dst.sin6_addr = nh->gw6_sa.sin6_addr; in ip6_tryforward()
[all …]
H A Dip6_forward.c96 struct nhop_object *nh = NULL; in ip6_forward() local
189 if (nh == NULL) { in ip6_forward()
246 if (nh->nh_flags & NHF_GATEWAY) { in ip6_forward()
295 if_name(nh->nh_ifp)); in ip6_forward()
302 origifp = nh->nh_ifp; in ip6_forward()
328 NH_FREE(nh); in ip6_forward()
367 NH_FREE(nh); in ip6_forward()
378 IN6_LINKMTU(nh->nh_ifp)); in ip6_forward()
407 icmp6_redirect_output(mcopy, nh); in ip6_forward()
438 if (nh != NULL) in ip6_forward()
[all …]
/f-stack/dpdk/lib/librte_node/
H A Dip4_rewrite.c42 struct ip4_rewrite_nh_header *nh = ip4_rewrite_nm->nh; in ip4_rewrite_node_process() local
55 rte_prefetch0(nh); in ip4_rewrite_node_process()
101 next0 = nh[priv01.u16[0]].tx_node; in ip4_rewrite_node_process()
112 next1 = nh[priv01.u16[4]].tx_node; in ip4_rewrite_node_process()
220 rte_memcpy(d0, nh[node_mbuf_priv1(mbuf0, dyn)->nh].rewrite_data, in ip4_rewrite_node_process()
221 nh[node_mbuf_priv1(mbuf0, dyn)->nh].rewrite_len); in ip4_rewrite_node_process()
223 next0 = nh[node_mbuf_priv1(mbuf0, dyn)->nh].tx_node; in ip4_rewrite_node_process()
303 struct ip4_rewrite_nh_header *nh; in rte_node_ip4_rewrite_add() local
324 nh = &ip4_rewrite_nm->nh[next_hop]; in rte_node_ip4_rewrite_add()
328 nh->rewrite_len = rewrite_len; in rte_node_ip4_rewrite_add()
[all …]
/f-stack/dpdk/examples/ipsec-secgw/test/
H A Dtrs_ipv6opts.py48 pkt[ESP].underlayer.nh = d[IPv6].nh
70 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_ESP)
75 self.assertEqual(d[IPv6].nh, socket.IPPROTO_UDP)
97 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_HOPOPTS)
102 self.assertEqual(resp[IPv6ExtHdrDestOpt].nh, socket.IPPROTO_ESP)
109 self.assertEqual(d[IPv6].nh, socket.IPPROTO_HOPOPTS)
112 self.assertEqual(d[IPv6ExtHdrDestOpt].nh, socket.IPPROTO_UDP)
127 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_UDP)
153 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_HOPOPTS)
156 self.assertEqual(resp[IPv6ExtHdrDestOpt].nh, socket.IPPROTO_UDP)
[all …]
H A Dtun_null_header_reconstruct.py155 self.assertEqual(pkt[IPv6].nh, socket.IPPROTO_ESP)
173 self.assertEqual(pkt[IPv6].nh, socket.IPPROTO_ESP)
205 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_ESP)
211 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_ESP)
218 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_ESP)
245 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_ESP)
251 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_ESP)
257 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_ESP)
283 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_UDP)
288 self.assertEqual(resp[IPv6].nh, socket.IPPROTO_UDP)
[all …]
/f-stack/tools/netstat/
H A Dnhops.c260 xo_emit(buffer, nh->nh_idx); in print_nhop_entry_sysctl()
263 char *cp = nh_types[nh->nh_type]; in print_nhop_entry_sysctl()
267 if (nh->ifindex < (uint32_t)ifmap_size) { in print_nhop_entry_sysctl()
274 na = (struct nhop_addrs *)((char *)nh + nh->nh_len); in print_nhop_entry_sysctl()
281 if (nh->nh_flags & NHF_GATEWAY) { in print_nhop_entry_sysctl()
309 if (nh->aifindex < (uint32_t)ifmap_size && nh->ifindex != nh->aifindex) { in print_nhop_entry_sysctl()
319 if (Wflag && nh->prepend_len) { in print_nhop_entry_sysctl()
350 struct nhop_external *nh; in dump_nhops_sysctl() local
388 nh_map[nh_count].idx = nh->nh_idx; in dump_nhops_sysctl()
404 struct nhop_external *nh; in print_nhops_sysctl() local
[all …]
/f-stack/dpdk/drivers/common/mlx5/linux/
H A Dmlx5_nl.c249 { .iov_base = nh, .iov_len = sizeof(*nh), }, in mlx5_nl_request()
261 nh->nlmsg_seq = sn; in mlx5_nl_request()
291 .iov_base = nh, in mlx5_nl_send()
367 nh = NLMSG_NEXT(nh, recv_bytes)) { in mlx5_nl_recv()
1006 .nh = { in mlx5_nl_ifindex()
1244 .nh = { in mlx5_nl_switch_info()
1294 .nh = { in mlx5_nl_vlan_vmwa_delete()
1439 struct nlattr *tail = RTE_PTR_ADD(nh, nh->nlmsg_len); in mlx5_nl_family_id_cb()
1440 struct nlattr *nla = RTE_PTR_ADD(nh, NLMSG_ALIGN(sizeof(*nh)) + in mlx5_nl_family_id_cb()
1536 struct nlattr *tail = RTE_PTR_ADD(nh, nh->nlmsg_len); in mlx5_nl_roce_cb()
[all …]
/f-stack/tools/compat/include/net/route/
H A Dnhop.h167 struct nhop_object *nh; member
171 void nhop_free(struct nhop_object *nh);
177 uint32_t nhop_get_idx(const struct nhop_object *nh);
178 enum nhop_type nhop_get_type(const struct nhop_object *nh);
179 int nhop_get_rtflags(const struct nhop_object *nh);
180 struct vnet *nhop_get_vnet(const struct nhop_object *nh);
181 struct nhop_object *nhop_select_func(struct nhop_object *nh, uint32_t flowid);
/f-stack/freebsd/net/
H A Droute.c298 struct nhop_object *nh; in ifa_ifwithroute() local
306 if ((nh == NULL) || (nh->nh_flags & NHF_DEFAULT)) in ifa_ifwithroute()
308 ifa = nh->nh_ifa; in ifa_ifwithroute()
369 src = &nh->gw_sa; in rt_exportinfo()
394 rmx->rmx_mtu = nh->nh_mtu; in rt_exportinfo()
398 info->rti_ifp = nh->nh_ifp; in rt_exportinfo()
399 info->rti_ifa = nh->nh_ifa; in rt_exportinfo()
426 struct nhop_object *nh; in rib_lookup_info() local
438 nh = nhop_select(rt->rt_nhop, flowid); in rib_lookup_info()
440 if (RT_LINK_IS_UP(nh->nh_ifp)) { in rib_lookup_info()
[all …]
/f-stack/dpdk/lib/librte_ring/
H A Drte_ring_rts_c11_mem.h75 union __rte_ring_rts_poscnt nh, oh; in __rte_ring_rts_move_prod_head() local
108 nh.val.pos = oh.val.pos + n; in __rte_ring_rts_move_prod_head()
109 nh.val.cnt = oh.val.cnt + 1; in __rte_ring_rts_move_prod_head()
117 &oh.raw, nh.raw, in __rte_ring_rts_move_prod_head()
133 union __rte_ring_rts_poscnt nh, oh; in __rte_ring_rts_move_cons_head() local
163 nh.val.pos = oh.val.pos + n; in __rte_ring_rts_move_cons_head()
164 nh.val.cnt = oh.val.cnt + 1; in __rte_ring_rts_move_cons_head()
172 &oh.raw, nh.raw, in __rte_ring_rts_move_cons_head()
/f-stack/lib/
H A Dff_route.c606 if (!NH_IS_NHGRP(nh)) in select_nhop()
607 return (nh); in select_nhop()
613 return (wn[0].nh); in select_nhop()
616 return (wn[i].nh); in select_nhop()
635 struct nhop_object *nh; in handle_rtm_get() local
672 if (nh == NULL) { in handle_rtm_get()
710 if (nh == NULL) { in handle_rtm_get()
715 rc->rc_nh_new = nh; in handle_rtm_get()
954 ifp = nh->nh_ifp; in update_rtm_from_rc()
1068 nh = NULL; in ff_rtioctl()
[all …]

1234