2 * ethernet/arp.c: IP v4 ARP node
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:
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef included_ethernet_arp_packet_h
19 #define included_ethernet_arp_packet_h
21 #include <vnet/ethernet/mac_address.h>
23 #define foreach_ethernet_arp_hardware_type \
26 _ (2, experimental_ethernet) \
28 _ (4, proteon_pronet_token_ring) \
42 _ (18, fibre_channel) \
46 _ (22, mil_std_188_220) \
55 _ (31, ipsec_tunnel) \
63 #define foreach_ethernet_arp_opcode \
84 _ (mars_grouplist_request) \
85 _ (mars_grouplist_reply) \
86 _ (mars_redirect_map) \
93 #define _(n,f) ETHERNET_ARP_HARDWARE_TYPE_##f = (n),
94 foreach_ethernet_arp_hardware_type
96 } ethernet_arp_hardware_type_t;
100 #define _(f) ETHERNET_ARP_OPCODE_##f,
101 foreach_ethernet_arp_opcode
103 ETHERNET_ARP_N_OPCODE,
104 } ethernet_arp_opcode_t;
114 IP4_ARP_ERROR_THROTTLED,
115 IP4_ARP_ERROR_RESOLVED,
116 IP4_ARP_ERROR_NO_BUFFERS,
117 IP4_ARP_ERROR_REQUEST_SENT,
118 IP4_ARP_ERROR_NON_ARP_ADJ,
119 IP4_ARP_ERROR_NO_SOURCE_ADDRESS,
123 typedef CLIB_PACKED (struct {
126 }) ethernet_arp_ip4_over_ethernet_address_t;
129 STATIC_ASSERT (sizeof (ethernet_arp_ip4_over_ethernet_address_t) == 10,
130 "Packet ethernet address and IP4 address too big");
136 u8 n_l2_address_bytes;
137 u8 n_l3_address_bytes;
141 ethernet_arp_ip4_over_ethernet_address_t ip4_over_ethernet[2];
146 } ethernet_arp_header_t;
148 void send_ip4_garp (vlib_main_t * vm, u32 sw_if_index);
149 void send_ip4_garp_w_addr (vlib_main_t * vm,
150 const ip4_address_t * ip4_addr, u32 sw_if_index);
152 #endif /* included_ethernet_arp_packet_h */
155 * fd.io coding-style-patch-verification: ON
158 * eval: (c-set-style "gnu")