]> git.proxmox.com Git - mirror_frr.git/blame - include/linux/neighbour.h
Merge pull request #7550 from volta-networks/fix_bfd_isis
[mirror_frr.git] / include / linux / neighbour.h
CommitLineData
d3d7feb5 1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
ba777396
RW
2#ifndef __LINUX_NEIGHBOUR_H
3#define __LINUX_NEIGHBOUR_H
4
5#include <linux/types.h>
6#include <linux/netlink.h>
7
8struct ndmsg {
9 __u8 ndm_family;
10 __u8 ndm_pad1;
11 __u16 ndm_pad2;
12 __s32 ndm_ifindex;
13 __u16 ndm_state;
14 __u8 ndm_flags;
15 __u8 ndm_type;
16};
17
18enum {
19 NDA_UNSPEC,
20 NDA_DST,
21 NDA_LLADDR,
22 NDA_CACHEINFO,
23 NDA_PROBES,
24 NDA_VLAN,
25 NDA_PORT,
26 NDA_VNI,
27 NDA_IFINDEX,
28 NDA_MASTER,
29 NDA_LINK_NETNSID,
30 NDA_SRC_VNI,
d3d7feb5 31 NDA_PROTOCOL, /* Originator of entry */
e41c38fd 32 NDA_NH_ID,
4bcdb608 33 NDA_FDB_EXT_ATTRS,
3a059b04 34 NDA_EXT_FLAGS,
ba777396
RW
35 __NDA_MAX
36};
37
38#define NDA_MAX (__NDA_MAX - 1)
39
40/*
41 * Neighbor Cache Entry Flags
42 */
43
44#define NTF_USE 0x01
45#define NTF_SELF 0x02
46#define NTF_MASTER 0x04
47#define NTF_PROXY 0x08 /* == ATF_PUBL */
48#define NTF_EXT_LEARNED 0x10
49#define NTF_OFFLOADED 0x20
d3d7feb5 50#define NTF_STICKY 0x40
ba777396
RW
51#define NTF_ROUTER 0x80
52
3a059b04
AK
53/* Neighbor Cache Entry extended flags, part of NDA_EXT_FLAGS attribute */
54#define NTF_E_WEAK_OVERRIDE_STATE 0x01
55#define NTF_E_MH_PEER_SYNC 0x02
56
ba777396
RW
57/*
58 * Neighbor Cache Entry States.
59 */
60
61#define NUD_INCOMPLETE 0x01
62#define NUD_REACHABLE 0x02
63#define NUD_STALE 0x04
64#define NUD_DELAY 0x08
65#define NUD_PROBE 0x10
66#define NUD_FAILED 0x20
67
68/* Dummy states */
69#define NUD_NOARP 0x40
70#define NUD_PERMANENT 0x80
71#define NUD_NONE 0x00
72
73/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
74 and make no address resolution or NUD.
75 NUD_PERMANENT also cannot be deleted by garbage collectors.
76 */
77
78struct nda_cacheinfo {
79 __u32 ndm_confirmed;
80 __u32 ndm_used;
81 __u32 ndm_updated;
82 __u32 ndm_refcnt;
83};
84
85/*****************************************************************
86 * Neighbour tables specific messages.
87 *
88 * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
89 * NLM_F_DUMP flag set. Every neighbour table configuration is
90 * spread over multiple messages to avoid running into message
91 * size limits on systems with many interfaces. The first message
92 * in the sequence transports all not device specific data such as
93 * statistics, configuration, and the default parameter set.
94 * This message is followed by 0..n messages carrying device
95 * specific parameter sets.
96 * Although the ordering should be sufficient, NDTA_NAME can be
97 * used to identify sequences. The initial message can be identified
98 * by checking for NDTA_CONFIG. The device specific messages do
99 * not contain this TLV but have NDTPA_IFINDEX set to the
100 * corresponding interface index.
101 *
102 * To change neighbour table attributes, send RTM_SETNEIGHTBL
103 * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
104 * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
105 * otherwise. Device specific parameter sets can be changed by
106 * setting NDTPA_IFINDEX to the interface index of the corresponding
107 * device.
108 ****/
109
110struct ndt_stats {
111 __u64 ndts_allocs;
112 __u64 ndts_destroys;
113 __u64 ndts_hash_grows;
114 __u64 ndts_res_failed;
115 __u64 ndts_lookups;
116 __u64 ndts_hits;
117 __u64 ndts_rcv_probes_mcast;
118 __u64 ndts_rcv_probes_ucast;
119 __u64 ndts_periodic_gc_runs;
120 __u64 ndts_forced_gc_runs;
121 __u64 ndts_table_fulls;
122};
123
124enum {
125 NDTPA_UNSPEC,
126 NDTPA_IFINDEX, /* u32, unchangeable */
127 NDTPA_REFCNT, /* u32, read-only */
128 NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
129 NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
130 NDTPA_RETRANS_TIME, /* u64, msecs */
131 NDTPA_GC_STALETIME, /* u64, msecs */
132 NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
133 NDTPA_QUEUE_LEN, /* u32 */
134 NDTPA_APP_PROBES, /* u32 */
135 NDTPA_UCAST_PROBES, /* u32 */
136 NDTPA_MCAST_PROBES, /* u32 */
137 NDTPA_ANYCAST_DELAY, /* u64, msecs */
138 NDTPA_PROXY_DELAY, /* u64, msecs */
139 NDTPA_PROXY_QLEN, /* u32 */
140 NDTPA_LOCKTIME, /* u64, msecs */
141 NDTPA_QUEUE_LENBYTES, /* u32 */
142 NDTPA_MCAST_REPROBES, /* u32 */
143 NDTPA_PAD,
144 __NDTPA_MAX
145};
146#define NDTPA_MAX (__NDTPA_MAX - 1)
147
148struct ndtmsg {
149 __u8 ndtm_family;
150 __u8 ndtm_pad1;
151 __u16 ndtm_pad2;
152};
153
154struct ndt_config {
155 __u16 ndtc_key_len;
156 __u16 ndtc_entry_size;
157 __u32 ndtc_entries;
158 __u32 ndtc_last_flush; /* delta to now in msecs */
159 __u32 ndtc_last_rand; /* delta to now in msecs */
160 __u32 ndtc_hash_rnd;
161 __u32 ndtc_hash_mask;
162 __u32 ndtc_hash_chain_gc;
163 __u32 ndtc_proxy_qlen;
164};
165
166enum {
167 NDTA_UNSPEC,
168 NDTA_NAME, /* char *, unchangeable */
169 NDTA_THRESH1, /* u32 */
170 NDTA_THRESH2, /* u32 */
171 NDTA_THRESH3, /* u32 */
172 NDTA_CONFIG, /* struct ndt_config, read-only */
173 NDTA_PARMS, /* nested TLV NDTPA_* */
174 NDTA_STATS, /* struct ndt_stats, read-only */
175 NDTA_GC_INTERVAL, /* u64, msecs */
176 NDTA_PAD,
177 __NDTA_MAX
178};
179#define NDTA_MAX (__NDTA_MAX - 1)
180
4bcdb608
NA
181/* FDB activity notification bits used in NFEA_ACTIVITY_NOTIFY:
182 * - FDB_NOTIFY_BIT - notify on activity/expire for any entry
183 * - FDB_NOTIFY_INACTIVE_BIT - mark as inactive to avoid multiple notifications
184 */
185enum {
186 FDB_NOTIFY_BIT = (1 << 0),
187 FDB_NOTIFY_INACTIVE_BIT = (1 << 1)
188};
189
190/* embedded into NDA_FDB_EXT_ATTRS:
191 * [NDA_FDB_EXT_ATTRS] = {
192 * [NFEA_ACTIVITY_NOTIFY]
193 * ...
194 * }
195 */
196enum {
197 NFEA_UNSPEC,
198 NFEA_ACTIVITY_NOTIFY,
199 NFEA_DONT_REFRESH,
200 __NFEA_MAX
201};
202#define NFEA_MAX (__NFEA_MAX - 1)
203
ba777396 204#endif