FD.io VPP  v19.08-27-gf4dcae4
Vector Packet Processing
arp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __ARP_H__
17 #define __ARP_H__
18 
19 #include <vnet/ethernet/ethernet.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/ip/ip_neighbor.h>
23 
24 typedef struct
25 {
28 
30 
32 
34 
35  /**
36  * The index of the adj-fib entry created
37  */
40 
41 extern u8 *format_ethernet_arp_ip4_entry (u8 * s, va_list * va);
42 
45 
46 extern int vnet_proxy_arp_add_del (ip4_address_t * lo_addr,
47  ip4_address_t * hi_addr,
48  u32 fib_index, int is_del);
49 
51  u32 sw_if_index, u8 enable);
52 
55  const
56  ethernet_arp_ip4_over_ethernet_address_t
58 
61  const
62  ethernet_arp_ip4_over_ethernet_address_t
63  * a);
64 
65 extern int vnet_proxy_arp_fib_reset (u32 fib_id);
66 
68  void *address_arg,
69  uword node_index,
70  uword type_opaque, uword data);
71 
72 typedef int (*arp_change_event_cb_t) (u32 pool_index,
73  const mac_address_t * mac,
75  const ip4_address_t * address);
76 
79  u32 pid,
80  void *address_arg,
81  uword node_index,
82  uword type_opaque,
83  uword data, int is_add);
84 
85 void wc_arp_set_publisher_node (uword inode_index, uword event_type);
86 
89 
91 
92 typedef struct
93 {
98 
99 /**
100  * call back function when walking the DB of proxy ARPs
101  * @return 0 to stop the walk !0 to continue
102  */
103 typedef walk_rc_t (proxy_arp_walk_t) (const ip4_address_t * lo_addr,
104  const ip4_address_t * hi_addr,
105  u32 fib_index, void *dat);
106 
107 extern void proxy_arp_walk (proxy_arp_walk_t cb, void *data);
108 
109 /**
110  * call back function when walking the DB of proxy ARP interface
111  * @return 0 to stop the walk !0 to continue
112  */
114 
115 extern void proxy_arp_intfc_walk (proxy_arp_intf_walk_t cb, void *data);
116 
117 #endif
118 
119 /*
120  * fd.io coding-style-patch-verification: ON
121  *
122  * Local Variables:
123  * eval: (c-set-style "gnu")
124  * End:
125  */
ip_neighbor_flags_t flags
Definition: arp.h:31
typedef address
Definition: ip_types.api:83
int vnet_add_del_ip4_arp_change_event(vnet_main_t *vnm, arp_change_event_cb_t data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
Definition: arp.c:874
u32 flags
Definition: vhost_user.h:141
int vnet_proxy_arp_add_del(ip4_address_t *lo_addr, ip4_address_t *hi_addr, u32 fib_index, int is_del)
Definition: arp.c:2430
ethernet_arp_ip4_entry_t * ip4_neighbors_pool(void)
Definition: arp.c:1765
vl_api_mac_address_t mac
Definition: l2.api:490
a
Definition: bitmap.h:538
u32 sw_if_index
Definition: arp.h:94
ethernet_arp_ip4_entry_t * ip4_neighbor_entries(u32 sw_if_index)
Definition: arp.c:1772
void ethernet_ndp_change_mac(u32 sw_if_index)
u8 data[128]
Definition: ipsec.api:249
int vnet_proxy_arp_fib_reset(u32 fib_id)
Definition: arp.c:2484
void vnet_register_ip4_arp_resolution_event(vnet_main_t *vnm, void *address_arg, uword node_index, uword type_opaque, uword data)
Definition: arp.c:843
unsigned char u8
Definition: types.h:56
int vnet_arp_set_ip4_over_ethernet(vnet_main_t *vnm, u32 sw_if_index, const ethernet_arp_ip4_over_ethernet_address_t *a, ip_neighbor_flags_t flags)
Definition: arp.c:2366
double f64
Definition: types.h:142
enum walk_rc_t_ walk_rc_t
Walk return code.
void proxy_arp_intfc_walk(proxy_arp_intf_walk_t cb, void *data)
Definition: arp.c:2467
vl_api_interface_index_t sw_if_index
Definition: gre.api:50
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
unsigned int u32
Definition: types.h:88
int(* arp_change_event_cb_t)(u32 pool_index, const mac_address_t *mac, u32 sw_if_index, const ip4_address_t *address)
Definition: arp.h:72
vlib_frame_t * data_callback(flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_index)
void wc_arp_set_publisher_node(uword inode_index, uword event_type)
Definition: arp.c:1989
ip4_address_t ip4_address
Definition: arp.h:27
mac_address_t mac
Definition: arp.h:29
u32 sw_if_index
Definition: arp.h:26
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:30
void ethernet_arp_change_mac(u32 sw_if_index)
Definition: arp.c:2977
f64 time_last_updated
Definition: arp.h:33
fib_node_index_t fib_entry_index
The index of the adj-fib entry created.
Definition: arp.h:38
u64 uword
Definition: types.h:112
u8 * format_ethernet_arp_ip4_entry(u8 *s, va_list *va)
Definition: arp.c:262
int vnet_proxy_arp_enable_disable(vnet_main_t *vnm, u32 sw_if_index, u8 enable)
Definition: arp.c:2398
int vnet_arp_unset_ip4_over_ethernet(vnet_main_t *vnm, u32 sw_if_index, const ethernet_arp_ip4_over_ethernet_address_t *a)
Control Plane hook to remove an ARP entry.
Definition: arp.c:1931
mac_address_t mac
Definition: arp.h:96
ip4_address_t ip
Definition: arp.h:95
void proxy_arp_walk(proxy_arp_walk_t cb, void *data)
Definition: arp.c:2385
walk_rc_t( proxy_arp_intf_walk_t)(u32 sw_if_index, void *data)
call back function when walking the DB of proxy ARP interface
Definition: arp.h:113
void arp_update_adjacency(vnet_main_t *vnm, u32 sw_if_index, u32 ai)
Definition: arp.c:519
walk_rc_t( proxy_arp_walk_t)(const ip4_address_t *lo_addr, const ip4_address_t *hi_addr, u32 fib_index, void *dat)
call back function when walking the DB of proxy ARPs
Definition: arp.h:103
Definition: arp.h:24