FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
arp_packet.h
Go to the documentation of this file.
1 /*
2  * ethernet/arp.c: IP v4 ARP node
3  *
4  * Copyright (c) 2010 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 included_ethernet_arp_packet_h
19 #define included_ethernet_arp_packet_h
20 
22 
23 #define foreach_ethernet_arp_hardware_type \
24  _ (0, reserved) \
25  _ (1, ethernet) \
26  _ (2, experimental_ethernet) \
27  _ (3, ax_25) \
28  _ (4, proteon_pronet_token_ring) \
29  _ (5, chaos) \
30  _ (6, ieee_802) \
31  _ (7, arcnet) \
32  _ (8, hyperchannel) \
33  _ (9, lanstar) \
34  _ (10, autonet) \
35  _ (11, localtalk) \
36  _ (12, localnet) \
37  _ (13, ultra_link) \
38  _ (14, smds) \
39  _ (15, frame_relay) \
40  _ (16, atm) \
41  _ (17, hdlc) \
42  _ (18, fibre_channel) \
43  _ (19, atm19) \
44  _ (20, serial_line) \
45  _ (21, atm21) \
46  _ (22, mil_std_188_220) \
47  _ (23, metricom) \
48  _ (24, ieee_1394) \
49  _ (25, mapos) \
50  _ (26, twinaxial) \
51  _ (27, eui_64) \
52  _ (28, hiparp) \
53  _ (29, iso_7816_3) \
54  _ (30, arpsec) \
55  _ (31, ipsec_tunnel) \
56  _ (32, infiniband) \
57  _ (33, cai) \
58  _ (34, wiegand) \
59  _ (35, pure_ip) \
60  _ (36, hw_exp1) \
61  _ (256, hw_exp2)
62 
63 #define foreach_ethernet_arp_opcode \
64  _ (reserved) \
65  _ (request) \
66  _ (reply) \
67  _ (reverse_request) \
68  _ (reverse_reply) \
69  _ (drarp_request) \
70  _ (drarp_reply) \
71  _ (drarp_error) \
72  _ (inarp_request) \
73  _ (inarp_reply) \
74  _ (arp_nak) \
75  _ (mars_request) \
76  _ (mars_multi) \
77  _ (mars_mserv) \
78  _ (mars_join) \
79  _ (mars_leave) \
80  _ (mars_nak) \
81  _ (mars_unserv) \
82  _ (mars_sjoin) \
83  _ (mars_sleave) \
84  _ (mars_grouplist_request) \
85  _ (mars_grouplist_reply) \
86  _ (mars_redirect_map) \
87  _ (mapos_unarp) \
88  _ (exp1) \
89  _ (exp2)
90 
91 typedef enum
92 {
93 #define _(n,f) ETHERNET_ARP_HARDWARE_TYPE_##f = (n),
95 #undef _
97 
98 typedef enum
99 {
100 #define _(f) ETHERNET_ARP_OPCODE_##f,
102 #undef _
105 
106 typedef enum
107 {
111 
112 typedef enum
113 {
121 
122 /* *INDENT-OFF* */
123 typedef CLIB_PACKED (struct {
125  ip4_address_t ip4;
126 }) ethernet_arp_ip4_over_ethernet_address_t;
127 /* *INDENT-ON* */
128 
129 STATIC_ASSERT (sizeof (ethernet_arp_ip4_over_ethernet_address_t) == 10,
130  "Packet ethernet address and IP4 address too big");
131 
132 typedef struct
133 {
139  union
140  {
141  ethernet_arp_ip4_over_ethernet_address_t ip4_over_ethernet[2];
142 
143  /* Others... */
144  u8 data[0];
145  };
147 
150  const ip4_address_t * ip4_addr, u32 sw_if_index);
151 
152 #endif /* included_ethernet_arp_packet_h */
153 
154 /*
155  * fd.io coding-style-patch-verification: ON
156  *
157  * Local Variables:
158  * eval: (c-set-style "gnu")
159  * End:
160  */
vl_api_mac_address_t mac
Definition: l2.api:490
STATIC_ASSERT(sizeof(ethernet_arp_ip4_over_ethernet_address_t)==10, "Packet ethernet address and IP4 address too big")
void send_ip4_garp(vlib_main_t *vm, u32 sw_if_index)
Definition: arp.c:3011
u8 data[128]
Definition: ipsec.api:251
unsigned char u8
Definition: types.h:56
vl_api_interface_index_t sw_if_index
Definition: gre.api:50
ip4_arp_error_t
Definition: arp_packet.h:112
ethernet_arp_hardware_type_t
Definition: arp_packet.h:91
#define foreach_ethernet_arp_opcode
Definition: arp_packet.h:63
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
ip4_arp_next_t
Definition: arp_packet.h:106
ethernet_arp_opcode_t
Definition: arp_packet.h:98
vlib_main_t * vm
Definition: buffer.c:323
void send_ip4_garp_w_addr(vlib_main_t *vm, const ip4_address_t *ip4_addr, u32 sw_if_index)
Definition: arp.c:3020
#define foreach_ethernet_arp_hardware_type
Definition: arp_packet.h:23
typedef CLIB_PACKED(struct { mac_address_t mac;ip4_address_t ip4;}) ethernet_arp_ip4_over_ethernet_address_t