FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
ip_neighbor_types.h
Go to the documentation of this file.
1 /*
2  * ip_neighbor.h: ip neighbor generic services
3  *
4  * Copyright (c) 2018 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 __INCLUDE_IP_NEIGHBOR_TYPES_H__
19 #define __INCLUDE_IP_NEIGHBOR_TYPES_H__
20 
21 #include <vnet/ip/ip_types.h>
23 #include <vnet/fib/fib_types.h>
24 
25 #define foreach_ip_neighbor_flag \
26  _(STATIC, 1 << 0, "static", "S") \
27  _(DYNAMIC, 1 << 1, "dynamic", "D") \
28  _(NO_FIB_ENTRY, 1 << 2, "no-fib-entry", "N") \
29  _(PENDING, 1 << 3, "pending", "P") \
30  _(STALE, 1 << 4, "stale", "A") \
31 
33 {
35 #define _(a,b,c,d) IP_NEIGHBOR_FLAG_##a = b,
37 #undef _
38 } __clib_packed ip_neighbor_flags_t;
39 
40 typedef struct ip_neighbor_watcher_t_
41 {
46 
47 extern u8 *format_ip_neighbor_watcher (u8 * s, va_list * args);
48 
49 typedef struct ip_neighbor_key_t_
50 {
52  u8 __pad[3];
54 } __clib_packed ip_neighbor_key_t;
55 
56 /**
57  * A representation of an IP neighbour/peer
58  */
59 typedef struct ip_neighbor_t_
60 {
61  /**
62  * The idempotent key
63  */
65 
66  /**
67  * The learned MAC address of the neighbour
68  */
70 
71  /**
72  * Falgs for this object
73  */
75 
76  /**
77  * Aging related data
78  * - last time the neighbour was probed
79  * - number of probes - 3 and it's dead
80  */
84 
85  /**
86  * The index of the adj fib created for this neighbour
87  */
90 
91 extern u8 *format_ip_neighbor_flags (u8 * s, va_list * args);
92 extern u8 *format_ip_neighbor_key (u8 * s, va_list * args);
93 extern u8 *format_ip_neighbor (u8 * s, va_list * args);
94 
96 
97 typedef struct ip_neighbor_learn_t_
98 {
103 
104 
106 {
110 
111 typedef struct ip_neighbor_event_t_
112 {
117 
118 extern void ip_neighbor_clone (const ip_neighbor_t * ipn,
119  ip_neighbor_t * clone);
120 
121 extern void ip_neighbor_free (ip_neighbor_t * ipn);
122 
123 
124 
125 #endif /* __INCLUDE_IP_NEIGHBOR_H__ */
126 
127 /*
128  * fd.io coding-style-patch-verification: ON
129  *
130  * Local Variables:
131  * eval: (c-set-style "gnu")
132  * End:
133  */
ip_neighbor_t_
A representation of an IP neighbour/peer.
Definition: ip_neighbor_types.h:59
ip_address
Definition: ip_types.h:79
ip_neighbor_t_::ipn_fib_entry_index
fib_node_index_t ipn_fib_entry_index
The index of the adj fib created for this neighbour.
Definition: ip_neighbor_types.h:88
format_ip_neighbor_watcher
u8 * format_ip_neighbor_watcher(u8 *s, va_list *args)
Definition: ip_neighbor_types.c:59
ip_neighbor_watcher_t_::ipw_api_version
int ipw_api_version
Definition: ip_neighbor_types.h:44
ip_neighbor_t_::ipn_n_probes
u8 ipn_n_probes
Definition: ip_neighbor_types.h:82
ip_neighbor_event_t_
Definition: ip_neighbor_types.h:111
ip_neighbor_watcher_t_
Definition: ip_neighbor_types.h:40
ip_neighbor_event_flags_t_
ip_neighbor_event_flags_t_
Definition: ip_neighbor_types.h:105
ip_neighbor_clone
void ip_neighbor_clone(const ip_neighbor_t *ipn, ip_neighbor_t *clone)
Definition: ip_neighbor_types.c:21
ip_neighbor_learn_t
struct ip_neighbor_learn_t_ ip_neighbor_learn_t
ip_neighbor_learn_t_
Definition: ip_neighbor_types.h:97
ip_neighbor_get
ip_neighbor_t * ip_neighbor_get(index_t ipni)
Definition: ip_neighbor.c:89
format_ip_neighbor_flags
u8 * format_ip_neighbor_flags(u8 *s, va_list *args)
Definition: ip_neighbor_types.c:36
ip_neighbor_flags_t_
ip_neighbor_flags_t_
Definition: ip_neighbor_types.h:32
format_ip_neighbor
u8 * format_ip_neighbor(u8 *s, va_list *args)
Definition: ip_neighbor_types.c:69
ip_neighbor_learn_t_::sw_if_index
u32 sw_if_index
Definition: ip_neighbor_types.h:101
ip_neighbor_t_::ipn_flags
ip_neighbor_flags_t ipn_flags
Falgs for this object.
Definition: ip_neighbor_types.h:74
ip_neighbor_watcher_t_::ipw_client
u32 ipw_client
Definition: ip_neighbor_types.h:43
IP_NEIGHBOR_EVENT_REMOVED
@ IP_NEIGHBOR_EVENT_REMOVED
Definition: ip_neighbor_types.h:108
ip_neighbor_key_t_
Definition: ip_neighbor_types.h:49
ip_neighbor_t_::ipn_key
ip_neighbor_key_t * ipn_key
The idempotent key.
Definition: ip_neighbor_types.h:64
ip_neighbor_learn_t_::ip
ip_address_t ip
Definition: ip_neighbor_types.h:99
mac_address.h
fib_types.h
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
ip_neighbor_learn_t_::mac
mac_address_t mac
Definition: ip_neighbor_types.h:100
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
ip_neighbor_t_::ipn_elt
index_t ipn_elt
Definition: ip_neighbor_types.h:83
format_ip_neighbor_key
u8 * format_ip_neighbor_key(u8 *s, va_list *args)
Definition: ip_neighbor_types.c:49
ip_neighbor_key_t_::ipnk_ip
ip_address_t ipnk_ip
Definition: ip_neighbor_types.h:51
f64
double f64
Definition: types.h:142
ip_types.h
ip_neighbor_t_::ipn_time_last_updated
f64 ipn_time_last_updated
Aging related data.
Definition: ip_neighbor_types.h:81
IP_NEIGHBOR_EVENT_ADDED
@ IP_NEIGHBOR_EVENT_ADDED
Definition: ip_neighbor_types.h:107
IP_NEIGHBOR_FLAG_NONE
@ IP_NEIGHBOR_FLAG_NONE
Definition: ip_neighbor_types.h:34
ip_neighbor_watcher_t_::ipw_pid
u32 ipw_pid
Definition: ip_neighbor_types.h:42
foreach_ip_neighbor_flag
#define foreach_ip_neighbor_flag
Definition: ip_neighbor_types.h:25
ip_neighbor_flags_t
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
u32
unsigned int u32
Definition: types.h:88
ip_neighbor_free
void ip_neighbor_free(ip_neighbor_t *ipn)
Definition: ip_neighbor_types.c:30
ip_neighbor_t
struct ip_neighbor_t_ ip_neighbor_t
A representation of an IP neighbour/peer.
ip_neighbor_watcher_t
struct ip_neighbor_watcher_t_ ip_neighbor_watcher_t
mac_address_t_
Definition: mac_address.h:21
u8
unsigned char u8
Definition: types.h:56
ip_neighbor_key_t_::ipnk_sw_if_index
u32 ipnk_sw_if_index
Definition: ip_neighbor_types.h:53
ip_neighbor_event_t_::ipne_flags
ip_neighbor_event_flags_t ipne_flags
Definition: ip_neighbor_types.h:114
ip_neighbor_key_t
struct ip_neighbor_key_t_ ip_neighbor_key_t
ip_neighbor_event_t_::ipne_watch
ip_neighbor_watcher_t ipne_watch
Definition: ip_neighbor_types.h:113
ip_neighbor_t_::ipn_mac
mac_address_t ipn_mac
The learned MAC address of the neighbour.
Definition: ip_neighbor_types.h:69
ip_neighbor_event_t
struct ip_neighbor_event_t_ ip_neighbor_event_t
ip_neighbor_event_flags_t
enum ip_neighbor_event_flags_t_ ip_neighbor_event_flags_t
ip_neighbor_event_t_::ipne_nbr
ip_neighbor_t ipne_nbr
Definition: ip_neighbor_types.h:115