FD.io VPP  v21.01.1
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>
20 #include <vnet/ip/ip.h>
22 
23 #define foreach_ethernet_arp_error \
24  _ (replies_sent, "ARP replies sent") \
25  _ (l2_type_not_ethernet, "L2 type not ethernet") \
26  _ (l3_type_not_ip4, "L3 type not IP4") \
27  _ (l3_src_address_not_local, "IP4 source address not local to subnet") \
28  _ (l3_dst_address_not_local, "IP4 destination address not local to subnet") \
29  _ (l3_dst_address_unset, "IP4 destination address is unset") \
30  _ (l3_src_address_is_local, "IP4 source address matches local interface") \
31  _ (l3_src_address_learned, "ARP request IP4 source address learned") \
32  _ (replies_received, "ARP replies received") \
33  _ (opcode_not_request, "ARP opcode not request") \
34  _ (proxy_arp_replies_sent, "Proxy ARP replies sent") \
35  _ (l2_address_mismatch, "ARP hw addr does not match L2 frame src addr") \
36  _ (gratuitous_arp, "ARP probe or announcement dropped") \
37  _ (interface_no_table, "Interface is not mapped to an IP table") \
38  _ (interface_not_ip_enabled, "Interface is not IP enabled") \
39  _ (unnumbered_mismatch, "RX interface is unnumbered to different subnet") \
40 
41 typedef enum
42 {
43 #define _(sym,string) ETHERNET_ARP_ERROR_##sym,
45 #undef _
48 
49 extern int arp_proxy_add (u32 fib_index,
50  const ip4_address_t * lo_addr,
51  const ip4_address_t * hi_addr);
52 extern int arp_proxy_del (u32 fib_index,
53  const ip4_address_t * lo_addr,
54  const ip4_address_t * hi_addr);
55 
56 extern int arp_proxy_enable (u32 sw_if_index);
57 extern int arp_proxy_disable (u32 sw_if_index);
58 
59 /**
60  * call back function when walking the DB of proxy ARPs
61  * @return 0 to stop the walk !0 to continue
62  */
63 typedef walk_rc_t (proxy_arp_walk_t) (const ip4_address_t * lo_addr,
64  const ip4_address_t * hi_addr,
65  u32 fib_index, void *dat);
66 
67 extern void proxy_arp_walk (proxy_arp_walk_t cb, void *data);
68 
69 /**
70  * call back function when walking the DB of proxy ARP interface
71  * @return 0 to stop the walk !0 to continue
72  */
74 
75 extern void proxy_arp_intfc_walk (proxy_arp_intf_walk_t cb, void *data);
76 
77 #endif
78 
79 /*
80  * fd.io coding-style-patch-verification: ON
81  *
82  * Local Variables:
83  * eval: (c-set-style "gnu")
84  * End:
85  */
#define foreach_ethernet_arp_error
Definition: arp.h:23
ethernet_arp_reply_error_t
Definition: arp.h:41
int arp_proxy_del(u32 fib_index, const ip4_address_t *lo_addr, const ip4_address_t *hi_addr)
Definition: arp_proxy.c:134
u8 data[128]
Definition: ipsec_types.api:90
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_proxy.c:141
unsigned int u32
Definition: types.h:88
int arp_proxy_add(u32 fib_index, const ip4_address_t *lo_addr, const ip4_address_t *hi_addr)
Definition: arp_proxy.c:127
int arp_proxy_disable(u32 sw_if_index)
Definition: arp_proxy.c:55
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:73
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:63
int arp_proxy_enable(u32 sw_if_index)
Definition: arp_proxy.c:72
void proxy_arp_walk(proxy_arp_walk_t cb, void *data)
Definition: arp_proxy.c:42
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34