FD.io VPP  v20.01-48-g3e0dafb74
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/ip6_packet.h>
23 #include <vnet/fib/fib_types.h>
24 
25 #define IP_SCAN_DISABLED 0
26 #define IP_SCAN_V4_NEIGHBORS (1 << 0)
27 #define IP_SCAN_V6_NEIGHBORS (1 << 1)
28 #define IP_SCAN_V46_NEIGHBORS (IP_SCAN_V4_NEIGHBORS | IP_SCAN_V6_NEIGHBORS)
29 
30 typedef struct
31 {
32  u8 mode; /* 0: disable, 1: ip4, 2: ip6, 3: both */
33  u8 scan_interval; /* neighbor scan interval in minutes */
34  u8 max_proc_time; /* max processing time per run, in usecs */
35  u8 max_update; /* max probe/delete operations per run */
36  u8 scan_int_delay; /* delay in msecs, to resume scan on max */
37  u8 stale_threshold; /* Threshold in minutes to delete nei entry */
39 
41 {
47 } __attribute__ ((packed)) ip_neighbor_flags_t;
48 
49 typedef struct ip_neighbor_watcher_t_
50 {
54 
55 extern u8 *format_ip_neighbor_watcher (u8 * s, va_list * args);
56 
57 typedef struct ip_neighbor_key_t_
58 {
59  ip46_address_t ipnk_ip;
63 
64 /**
65  * A representation of an IP neighbour/peer
66  */
67 typedef struct ip_neighbor_t_
68 {
69  /**
70  * The idempotent key
71  */
73 
74  /**
75  * The learned MAC address of the neighbour
76  */
78 
79  /**
80  * Falgs for this object
81  */
83 
84  /**
85  * Aging related data
86  * - last time the neighbour was probed
87  * - number of probes - 3 and it's dead
88  */
92 
93  /**
94  * The index of the adj fib created for this neighbour
95  */
98 
99 extern u8 *format_ip_neighbor_flags (u8 * s, va_list * args);
100 extern u8 *format_ip_neighbor_key (u8 * s, va_list * args);
101 extern u8 *format_ip_neighbor (u8 * s, va_list * args);
102 
103 extern ip_neighbor_t *ip_neighbor_get (index_t ipni);
104 
105 typedef struct ip_neighbor_learn_t_
106 {
107  ip46_address_t ip;
112 
113 typedef struct ip_neighbor_event_t_
114 {
118 
119 #endif /* __INCLUDE_IP_NEIGHBOR_H__ */
120 
121 /*
122  * fd.io coding-style-patch-verification: ON
123  *
124  * Local Variables:
125  * eval: (c-set-style "gnu")
126  * End:
127  */
f64 ipn_time_last_updated
Aging related data.
struct ip_neighbor_learn_t_ ip_neighbor_learn_t
ip46_address_t ipnk_ip
u8 * format_ip_neighbor_flags(u8 *s, va_list *args)
ip_neighbor_t * ip_neighbor_get(index_t ipni)
Definition: ip_neighbor.c:88
u8 * format_ip_neighbor_watcher(u8 *s, va_list *args)
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:41
u8 * format_ip_neighbor(u8 *s, va_list *args)
struct ip_neighbor_t_ ip_neighbor_t
A representation of an IP neighbour/peer.
unsigned char u8
Definition: types.h:56
double f64
Definition: types.h:142
A representation of an IP neighbour/peer.
ip_neighbor_flags_t_
struct ip_neighbor_key_t_ ip_neighbor_key_t
unsigned int u32
Definition: types.h:88
mac_address_t ipn_mac
The learned MAC address of the neighbour.
fib_node_index_t ipn_fib_entry_index
The index of the adj fib created for this neighbour.
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:30
u8 * format_ip_neighbor_key(u8 *s, va_list *args)
struct ip_neighbor_watcher_t_ ip_neighbor_watcher_t
ip_neighbor_key_t * ipn_key
The idempotent key.
struct ip_neighbor_event_t_ ip_neighbor_event_t
ip_neighbor_flags_t ipn_flags
Falgs for this object.
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
ip_neighbor_watcher_t ipne_watch
ip46_type_t
Definition: ip46_address.h:22