FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip_neighbor.h
Go to the documentation of this file.
1 /*
2  * ip_neighboor.h: ip neighbor generic services
3  *
4  * Copyright (c) 2018 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __INCLUDE_IP_NEIGHBOR_H__
19 #define __INCLUDE_IP_NEIGHBOR_H__
20 
22 
23 #include <vnet/adj/adj.h>
24 
25 
26 /*****
27  * APIs external modules can invoke on the neighbor subsystem
28  */
29 
31 extern int ip_neighbor_add (const ip_address_t * ip,
32  const mac_address_t * mac,
35 extern int ip_neighbor_del (const ip_address_t * ip, u32 sw_if_index);
36 
38  u32 limit, u32 age, bool recycle);
39 
41 
42 typedef walk_rc_t (*ip_neighbor_walk_cb_t) (index_t ipni, void *ctx);
45  ip_neighbor_walk_cb_t fn, void *ctx);
46 
47 extern const ip_address_t *ip_neighbor_get_ip (const ip_neighbor_t * ipn);
49 extern const mac_address_t *ip_neighbor_get_mac (const ip_neighbor_t * ipn);
50 extern const u32 ip_neighbor_get_sw_if_index (const ip_neighbor_t * ipn);
51 
52 extern void ip_neighbor_learn (const ip_neighbor_learn_t * l);
53 
54 extern void ip_neighbor_update (vnet_main_t * vnm, adj_index_t ai);
55 
56 extern void ip_neighbor_probe (const ip_adjacency_t * adj);
59  const ip46_address_t * ip);
60 
61 extern void ip_neighbor_mark (ip_address_family_t af);
62 extern void ip_neighbor_sweep (ip_address_family_t af);
63 
64 /**
65  * From the watcher to the API to publish a new neighbor
66  */
68 
69 /**
70  * The set of function that vnet requires from the IP neighbour module.
71  * Note that an implementation of these functions will not exist
72  * if the ip-neighbour plugin is not loaded. so check the error codes!
73  */
74 extern int ip4_neighbor_proxy_add (u32 fib_index,
75  const ip4_address_t * start,
76  const ip4_address_t * end);
77 extern int ip4_neighbor_proxy_delete (u32 fib_index,
78  const ip4_address_t * start,
79  const ip4_address_t * end);
83  const ip6_address_t * addr);
85  const ip6_address_t * addr);
86 
87 /**
88  * neighbor protocol implementation registration functions
89  * this are provided by ARP and IP-ND
90  */
91 typedef int (*ip4_neighbor_proxy_addr_t) (u32 fib_index,
92  const ip4_address_t * start,
93  const ip4_address_t * end);
96  const ip6_address_t * addr);
97 
98 /**
99  * Virtual function Table for neighbor protocol implementations to register
100  */
101 typedef struct ip_neighbor_vft_t_
102 {
110 
112  const ip_neighbor_vft_t * vft);
113 
114 
115 #endif /* __INCLUDE_IP_NEIGHBOR_H__ */
116 
117 /*
118  * fd.io coding-style-patch-verification: ON
119  *
120  * Local Variables:
121  * eval: (c-set-style "gnu")
122  * End:
123  */
ip_neighbor_t_
A representation of an IP neighbour/peer.
Definition: ip_neighbor_types.h:59
ip4_neighbor_proxy_enable
int ip4_neighbor_proxy_enable(u32 sw_if_index)
Definition: ip_neighbor.c:1106
stats_index
u32 stats_index
Definition: ip.api:145
ip_address
Definition: ip_types.h:79
ip_neighbor_register
void ip_neighbor_register(ip_address_family_t af, const ip_neighbor_vft_t *vft)
Definition: ip_neighbor.c:1009
adj.h
mac
vl_api_mac_address_t mac
Definition: l2.api:559
ip4_neighbor_proxy_add
int ip4_neighbor_proxy_add(u32 fib_index, const ip4_address_t *start, const ip4_address_t *end)
The set of function that vnet requires from the IP neighbour module.
Definition: ip_neighbor.c:1081
ip_neighbor_vft_t_
Virtual function Table for neighbor protocol implementations to register.
Definition: ip_neighbor.h:101
ip_neighbor_vft_t_::inv_proxy4_add
ip4_neighbor_proxy_addr_t inv_proxy4_add
Definition: ip_neighbor.h:105
ip_neighbor_vft_t_::inv_proxy4_del
ip4_neighbor_proxy_addr_t inv_proxy4_del
Definition: ip_neighbor.h:106
ip6_neighbor_proxy_add
int ip6_neighbor_proxy_add(u32 sw_if_index, const ip6_address_t *addr)
Definition: ip_neighbor.c:1126
ip_neighbor_event_t_
Definition: ip_neighbor_types.h:111
ip4_neighbor_proxy_delete
int ip4_neighbor_proxy_delete(u32 fib_index, const ip4_address_t *start, const ip4_address_t *end)
Definition: ip_neighbor.c:1094
ip4_neighbor_proxy_addr_t
int(* ip4_neighbor_proxy_addr_t)(u32 fib_index, const ip4_address_t *start, const ip4_address_t *end)
neighbor protocol implementation registration functions this are provided by ARP and IP-ND
Definition: ip_neighbor.h:91
ip_neighbor_del_all
void ip_neighbor_del_all(ip_address_family_t af, u32 sw_if_index)
Definition: ip_neighbor.c:616
ip_neighbor_walk_cb_t
walk_rc_t(* ip_neighbor_walk_cb_t)(index_t ipni, void *ctx)
Definition: ip_neighbor.h:42
ip_neighbor_learn_t_
Definition: ip_neighbor_types.h:97
ip_neighbor_vft_t
struct ip_neighbor_vft_t_ ip_neighbor_vft_t
Virtual function Table for neighbor protocol implementations to register.
ip_neighbor_mark
void ip_neighbor_mark(ip_address_family_t af)
Definition: ip_neighbor.c:1240
ip_neighbor_vft_t_::inv_proxy6_del
ip6_neighbor_proxy_cfg_t inv_proxy6_del
Definition: ip_neighbor.h:108
ip_neighbor_add
int ip_neighbor_add(const ip_address_t *ip, const mac_address_t *mac, u32 sw_if_index, ip_neighbor_flags_t flags, u32 *stats_index)
Definition: ip_neighbor.c:477
addr
vhost_vring_addr_t addr
Definition: vhost_user.h:130
ip_neighbor_types.h
ip_neighbor_get_ip
const ip_address_t * ip_neighbor_get_ip(const ip_neighbor_t *ipn)
Definition: ip_neighbor.c:116
ip_neighbor_walk
void ip_neighbor_walk(ip_address_family_t af, u32 sw_if_index, ip_neighbor_walk_cb_t fn, void *ctx)
Definition: ip_neighbor.c:1041
ip6_neighbor_proxy_del
int ip6_neighbor_proxy_del(u32 sw_if_index, const ip6_address_t *addr)
Definition: ip_neighbor.c:1136
ip_neighbor_vft_t_::inv_proxy6_add
ip6_neighbor_proxy_cfg_t inv_proxy6_add
Definition: ip_neighbor.h:107
ip_neighbor_del
int ip_neighbor_del(const ip_address_t *ip, u32 sw_if_index)
Definition: ip_neighbor.c:574
ip_neighbor_get
ip_neighbor_t * ip_neighbor_get(index_t ipni)
Definition: ip_neighbor.c:89
ip_neighbor_probe
void ip_neighbor_probe(const ip_adjacency_t *adj)
Definition: ip_neighbor.c:1033
end
f64 end
end of the time range
Definition: mactime.api:44
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
ip_neighbor_get_sw_if_index
const u32 ip_neighbor_get_sw_if_index(const ip_neighbor_t *ipn)
Definition: ip_neighbor.c:134
ip_neighbor_sweep
void ip_neighbor_sweep(ip_address_family_t af)
Definition: ip_neighbor.c:1267
ip4_address_t
Definition: ip4_packet.h:50
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
ip_neighbor_probe_dst
void ip_neighbor_probe_dst(u32 sw_if_index, ip_address_family_t af, const ip46_address_t *ip)
Definition: ip_neighbor.c:1015
ip_neighbor_handle_event
void ip_neighbor_handle_event(ip_neighbor_event_t *ipne)
From the watcher to the API to publish a new neighbor.
Definition: ip_neighbor_api.c:64
ip4_neighbor_proxy_disable
int ip4_neighbor_proxy_disable(u32 sw_if_index)
Definition: ip_neighbor.c:1116
ip_neighbor_update
void ip_neighbor_update(vnet_main_t *vnm, adj_index_t ai)
Definition: ip_neighbor.c:636
vnet_main_t
Definition: vnet.h:76
ip6_neighbor_proxy_cfg_t
int(* ip6_neighbor_proxy_cfg_t)(u32 sw_if_index, const ip6_address_t *addr)
Definition: ip_neighbor.h:95
ip_neighbor_learn
void ip_neighbor_learn(const ip_neighbor_learn_t *l)
Definition: ip_neighbor.c:712
ip_neighbor_flags_t
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
u32
unsigned int u32
Definition: types.h:88
ip_neighbor_get_mac
const mac_address_t * ip_neighbor_get_mac(const ip_neighbor_t *ipn)
Definition: ip_neighbor.c:128
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
ip_neighbor_vft_t_::inv_proxy4_disable
ip4_neighbor_proxy_cfg_t inv_proxy4_disable
Definition: ip_neighbor.h:104
mac_address_t_
Definition: mac_address.h:21
ip_neighbor_get_af
ip_address_family_t ip_neighbor_get_af(const ip_neighbor_t *ipn)
Definition: ip_neighbor.c:122
adj_index_t
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
ip
vl_api_address_t ip
Definition: l2.api:558
ip_neighbor_vft_t_::inv_proxy4_enable
ip4_neighbor_proxy_cfg_t inv_proxy4_enable
Definition: ip_neighbor.h:103
ip4_neighbor_proxy_cfg_t
int(* ip4_neighbor_proxy_cfg_t)(u32 sw_if_index)
Definition: ip_neighbor.h:94
ip_neighbor_config
int ip_neighbor_config(ip_address_family_t af, u32 limit, u32 age, bool recycle)
Definition: ip_neighbor.c:1687
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
walk_rc_t
enum walk_rc_t_ walk_rc_t
Walk return code.
ip_address_family_t
enum ip_address_family_t_ ip_address_family_t
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105