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 #define foreach_ethernet_arp_hardware_type \
24 _ (2, experimental_ethernet) \
26 _ (4, proteon_pronet_token_ring) \
40 _ (18, fibre_channel) \
44 _ (22, mil_std_188_220) \
53 _ (31, ipsec_tunnel) \
61 #define foreach_ethernet_arp_opcode \
82 _ (mars_grouplist_request) \
83 _ (mars_grouplist_reply) \
84 _ (mars_redirect_map) \
91 #define _(n,f) ETHERNET_ARP_HARDWARE_TYPE_##f = (n),
92 foreach_ethernet_arp_hardware_type
94 } ethernet_arp_hardware_type_t;
98 #define _(f) ETHERNET_ARP_OPCODE_##f,
99 foreach_ethernet_arp_opcode
101 ETHERNET_ARP_N_OPCODE,
102 } ethernet_arp_opcode_t;
113 IP4_ARP_ERROR_REQUEST_SENT,
114 IP4_ARP_ERROR_NON_ARP_ADJ,
115 IP4_ARP_ERROR_REPLICATE_DROP,
116 IP4_ARP_ERROR_REPLICATE_FAIL,
117 IP4_ARP_ERROR_NO_SOURCE_ADDRESS,
121 typedef CLIB_PACKED (struct {
124 }) ethernet_arp_ip4_over_ethernet_address_t;
131 u8 n_l2_address_bytes;
132 u8 n_l3_address_bytes;
136 ethernet_arp_ip4_over_ethernet_address_t ip4_over_ethernet[2];
141 } ethernet_arp_header_t;
146 ip4_address_t ip4_address;
148 u8 ethernet_address[6];
151 #define ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC (1 << 0)
152 #define ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC (1 << 1)
154 u64 cpu_time_last_updated;
157 * The index of the adj-fib entry created
159 fib_node_index_t fib_entry_index;
160 } ethernet_arp_ip4_entry_t;
162 ethernet_arp_ip4_entry_t *ip4_neighbor_entries (u32 sw_if_index);
163 u8 *format_ethernet_arp_ip4_entry (u8 * s, va_list * va);
165 #endif /* included_ethernet_arp_packet_h */
168 * fd.io coding-style-patch-verification: ON
171 * eval: (c-set-style "gnu")