]> git.ipfire.org Git - thirdparty/lldpd.git/blob - src/lldp-const.h
priv: disable LLDP in firmware for Intel X7xx cards on FreeBSD
[thirdparty/lldpd.git] / src / lldp-const.h
1 /* -*- mode: c; c-file-style: "openbsd" -*- */
2 /*
3 * Copyright (c) 2008 Vincent Bernat <bernat@luffy.cx>
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18 #ifndef _LLDP_H
19 #define _LLDP_H
20
21 /* Definitions prefixed by `LLDP_` are constants from LLDP
22 * specifications. Definitions prefixed by `LLDPD_` are custom
23 * constants that are useful in the context of lldpd and its clients.
24 */
25
26 #define LLDP_TLV_ORG 127
27 #define LLDP_TLV_ORG_OUI_LEN 3
28 #define LLDP_TLV_ORG_OUI_INFO_MAXLEN 507
29
30 /* Chassis ID subtype */
31 #define LLDP_CHASSISID_SUBTYPE_CHASSIS 1
32 #define LLDP_CHASSISID_SUBTYPE_IFALIAS 2
33 #define LLDP_CHASSISID_SUBTYPE_PORT 3
34 #define LLDP_CHASSISID_SUBTYPE_LLADDR 4
35 #define LLDP_CHASSISID_SUBTYPE_ADDR 5
36 #define LLDP_CHASSISID_SUBTYPE_IFNAME 6
37 #define LLDP_CHASSISID_SUBTYPE_LOCAL 7
38
39 /* Port ID subtype */
40 #define LLDP_PORTID_SUBTYPE_UNKNOWN 0
41 #define LLDP_PORTID_SUBTYPE_IFALIAS 1
42 #define LLDP_PORTID_SUBTYPE_PORT 2
43 #define LLDP_PORTID_SUBTYPE_LLADDR 3
44 #define LLDP_PORTID_SUBTYPE_ADDR 4
45 #define LLDP_PORTID_SUBTYPE_IFNAME 5
46 #define LLDP_PORTID_SUBTYPE_AGENTCID 6
47 #define LLDP_PORTID_SUBTYPE_LOCAL 7
48 #define LLDP_PORTID_SUBTYPE_MAX LLDP_PORTID_SUBTYPE_LOCAL
49
50 /* Operational MAU Type field. See:
51 * https://www.iana.org/assignments/ianamau-mib/ianamau-mib */
52 #define LLDP_DOT3_MAU_AUI 1
53 #define LLDP_DOT3_MAU_10BASE5 2
54 #define LLDP_DOT3_MAU_FOIRL 3
55 #define LLDP_DOT3_MAU_10BASE2 4
56 #define LLDP_DOT3_MAU_10BASET 5
57 #define LLDP_DOT3_MAU_10BASEFP 6
58 #define LLDP_DOT3_MAU_10BASEFB 7
59 #define LLDP_DOT3_MAU_10BASEFL 8
60 #define LLDP_DOT3_MAU_10BROAD36 9
61 #define LLDP_DOT3_MAU_10BASETHD 10
62 #define LLDP_DOT3_MAU_10BASETFD 11
63 #define LLDP_DOT3_MAU_10BASEFLHD 12
64 #define LLDP_DOT3_MAU_10BASEFLFD 13
65 #define LLDP_DOT3_MAU_100BASET4 14
66 #define LLDP_DOT3_MAU_100BASETXHD 15
67 #define LLDP_DOT3_MAU_100BASETXFD 16
68 #define LLDP_DOT3_MAU_100BASEFXHD 17
69 #define LLDP_DOT3_MAU_100BASEFXFD 18
70 #define LLDP_DOT3_MAU_100BASET2HD 19
71 #define LLDP_DOT3_MAU_100BASET2FD 20
72 #define LLDP_DOT3_MAU_1000BASEXHD 21
73 #define LLDP_DOT3_MAU_1000BASEXFD 22
74 #define LLDP_DOT3_MAU_1000BASELXHD 23
75 #define LLDP_DOT3_MAU_1000BASELXFD 24
76 #define LLDP_DOT3_MAU_1000BASESXHD 25
77 #define LLDP_DOT3_MAU_1000BASESXFD 26
78 #define LLDP_DOT3_MAU_1000BASECXHD 27
79 #define LLDP_DOT3_MAU_1000BASECXFD 28
80 #define LLDP_DOT3_MAU_1000BASETHD 29
81 #define LLDP_DOT3_MAU_1000BASETFD 30
82 #define LLDP_DOT3_MAU_10GIGBASEX 31
83 #define LLDP_DOT3_MAU_10GIGBASELX4 32
84 #define LLDP_DOT3_MAU_10GIGBASER 33
85 #define LLDP_DOT3_MAU_10GIGBASEER 34
86 #define LLDP_DOT3_MAU_10GIGBASELR 35
87 #define LLDP_DOT3_MAU_10GIGBASESR 36
88 #define LLDP_DOT3_MAU_10GIGBASEW 37
89 #define LLDP_DOT3_MAU_10GIGBASEEW 38
90 #define LLDP_DOT3_MAU_10GIGBASELW 39
91 #define LLDP_DOT3_MAU_10GIGBASESW 40
92 #define LLDP_DOT3_MAU_10GIGBASECX4 41
93 #define LLDP_DOT3_MAU_2BASETL 42
94 #define LLDP_DOT3_MAU_10PASSTS 43
95 #define LLDP_DOT3_MAU_100BASEBX10D 44
96 #define LLDP_DOT3_MAU_100BASEBX10U 45
97 #define LLDP_DOT3_MAU_100BASELX10 46
98 #define LLDP_DOT3_MAU_1000BASEBX10D 47
99 #define LLDP_DOT3_MAU_1000BASEBX10U 48
100 #define LLDP_DOT3_MAU_1000BASELX10 49
101 #define LLDP_DOT3_MAU_1000BASEPX10D 50
102 #define LLDP_DOT3_MAU_1000BASEPX10U 51
103 #define LLDP_DOT3_MAU_1000BASEPX20D 52
104 #define LLDP_DOT3_MAU_1000BASEPX20U 53
105 #define LLDP_DOT3_MAU_10GBASET 54
106 #define LLDP_DOT3_MAU_10GBASELRM 55
107 #define LLDP_DOT3_MAU_1000BASEKX 56
108 #define LLDP_DOT3_MAU_10GBASEKX4 57
109 #define LLDP_DOT3_MAU_10GBASEKR 58
110 #define LLDP_DOT3_MAU_10G1GBASEPRXD1 59
111 #define LLDP_DOT3_MAU_10G1GBASEPRXD2 60
112 #define LLDP_DOT3_MAU_10G1GBASEPRXD3 61
113 #define LLDP_DOT3_MAU_10G1GBASEPRXU1 62
114 #define LLDP_DOT3_MAU_10G1GBASEPRXU2 63
115 #define LLDP_DOT3_MAU_10G1GBASEPRXU3 64
116 #define LLDP_DOT3_MAU_10GBASEPRD1 65
117 #define LLDP_DOT3_MAU_10GBASEPRD2 66
118 #define LLDP_DOT3_MAU_10GBASEPRD3 67
119 #define LLDP_DOT3_MAU_10GBASEPRU1 68
120 #define LLDP_DOT3_MAU_10GBASEPRU3 69
121 #define LLDP_DOT3_MAU_40GBASEKR4 70
122 #define LLDP_DOT3_MAU_40GBASECR4 71
123 #define LLDP_DOT3_MAU_40GBASESR4 72
124 #define LLDP_DOT3_MAU_40GBASEFR 73
125 #define LLDP_DOT3_MAU_40GBASELR4 74
126 #define LLDP_DOT3_MAU_100GBASECR10 75
127 #define LLDP_DOT3_MAU_100GBASESR10 76
128 #define LLDP_DOT3_MAU_100GBASELR4 77
129 #define LLDP_DOT3_MAU_100GBASEER4 78
130 #define LLDP_DOT3_MAU_1000BASET1 79
131 #define LLDP_DOT3_MAU_1000BASEPX30D 80
132 #define LLDP_DOT3_MAU_1000BASEPX30U 81
133 #define LLDP_DOT3_MAU_1000BASEPX40D 82
134 #define LLDP_DOT3_MAU_1000BASEPX40U 83
135 #define LLDP_DOT3_MAU_10G1GBASEPRXD4 84
136 #define LLDP_DOT3_MAU_10G1GBASEPRXU4 85
137 #define LLDP_DOT3_MAU_10GBASEPRD4 86
138 #define LLDP_DOT3_MAU_10GBASEPRU4 87
139 #define LLDP_DOT3_MAU_25GBASECR 88
140 #define LLDP_DOT3_MAU_25GBASECRS 89
141 #define LLDP_DOT3_MAU_25GBASEKR 90
142 #define LLDP_DOT3_MAU_25GBASEKRS 91
143 #define LLDP_DOT3_MAU_25GBASER 92
144 #define LLDP_DOT3_MAU_25GBASESR 93
145 #define LLDP_DOT3_MAU_25GBASET 94
146 #define LLDP_DOT3_MAU_40GBASEER4 95
147 #define LLDP_DOT3_MAU_40GBASER 96
148 #define LLDP_DOT3_MAU_40GBASET 97
149 #define LLDP_DOT3_MAU_100GBASECR4 98
150 #define LLDP_DOT3_MAU_100GBASEKR4 99
151 #define LLDP_DOT3_MAU_100GBASEKP4 100
152 #define LLDP_DOT3_MAU_100GBASER 101
153 #define LLDP_DOT3_MAU_100GBASESR4 102
154 #define LLDP_DOT3_MAU_2P5GIGT 103
155 #define LLDP_DOT3_MAU_5GIGT 104
156 #define LLDP_DOT3_MAU_100BASET1 105
157 #define LLDP_DOT3_MAU_1000BASERHA 106
158 #define LLDP_DOT3_MAU_1000BASERHB 107
159 #define LLDP_DOT3_MAU_1000BASERHC 108
160 #define LLDP_DOT3_MAU_2P5GBASEKX 109
161 #define LLDP_DOT3_MAU_2P5GBASEX 110
162 #define LLDP_DOT3_MAU_5GBASEKR 111
163 #define LLDP_DOT3_MAU_5GBASER 112
164 #define LLDP_DOT3_MAU_10GPASSXR 113
165 #define LLDP_DOT3_MAU_25GBASELR 114
166 #define LLDP_DOT3_MAU_25GBASEER 115
167 #define LLDP_DOT3_MAU_50GBASER 116
168 #define LLDP_DOT3_MAU_50GBASECR 117
169 #define LLDP_DOT3_MAU_50GBASEKR 118
170 #define LLDP_DOT3_MAU_50GBASESR 119
171 #define LLDP_DOT3_MAU_50GBASEFR 120
172 #define LLDP_DOT3_MAU_50GBASELR 121
173 #define LLDP_DOT3_MAU_50GBASEER 122
174 #define LLDP_DOT3_MAU_100GBASECR2 123
175 #define LLDP_DOT3_MAU_100GBASEKR2 124
176 #define LLDP_DOT3_MAU_100GBASESR2 125
177 #define LLDP_DOT3_MAU_100GBASEDR 126
178 #define LLDP_DOT3_MAU_200GBASER 127
179 #define LLDP_DOT3_MAU_200GBASEDR4 128
180 #define LLDP_DOT3_MAU_200GBASEFR4 129
181 #define LLDP_DOT3_MAU_200GBASELR4 130
182 #define LLDP_DOT3_MAU_200GBASECR4 131
183 #define LLDP_DOT3_MAU_200GBASEKR4 132
184 #define LLDP_DOT3_MAU_200GBASESR4 133
185 #define LLDP_DOT3_MAU_200GBASEER4 134
186 #define LLDP_DOT3_MAU_400GBASER 135
187 #define LLDP_DOT3_MAU_400GBASESR16 136
188 #define LLDP_DOT3_MAU_400GBASEDR4 137
189 #define LLDP_DOT3_MAU_400GBASEFR8 138
190 #define LLDP_DOT3_MAU_400GBASELR8 139
191 #define LLDP_DOT3_MAU_400GBASEER8 140
192 #define LLDP_DOT3_MAU_10BASET1L 141
193 #define LLDP_DOT3_MAU_10BASET1SHD 142
194 #define LLDP_DOT3_MAU_10BASET1SMD 143
195 #define LLDP_DOT3_MAU_10BASET1SFD 144
196
197 /* Dot3 Power Devicetype */
198 #define LLDP_DOT3_POWER_PSE 1
199 #define LLDP_DOT3_POWER_PD 2
200
201 /* Dot3 Power Pairs (RFC 3621) */
202 #define LLDP_DOT3_POWERPAIRS_SIGNAL 1
203 #define LLDP_DOT3_POWERPAIRS_SPARE 2
204
205 /* Dot3 Power type (for 802.3at) */
206 #define LLDP_DOT3_POWER_8023AT_OFF 0
207 #define LLDP_DOT3_POWER_8023AT_TYPE1 1
208 #define LLDP_DOT3_POWER_8023AT_TYPE2 2
209
210 /* 802.3bt additions */
211 #define LLDP_DOT3_POWER_8023BT_OFF 0
212 #define LLDP_DOT3_POWER_8023BT_TYPE3 1
213 #define LLDP_DOT3_POWER_8023BT_TYPE4 2
214
215 /* Dot3 power source */
216 #define LLDP_DOT3_POWER_SOURCE_UNKNOWN 0
217 #define LLDP_DOT3_POWER_SOURCE_PRIMARY 1
218 #define LLDP_DOT3_POWER_SOURCE_PSE 1
219 #define LLDP_DOT3_POWER_SOURCE_BACKUP 2
220 #define LLDP_DOT3_POWER_SOURCE_LOCAL 2
221 #define LLDP_DOT3_POWER_SOURCE_BOTH 3
222
223 /* Dot3 power priority */
224 #define LLDP_DOT3_POWER_PRIO_UNKNOWN 0
225 #define LLDP_DOT3_POWER_PRIO_CRITICAL 1
226 #define LLDP_DOT3_POWER_PRIO_HIGH 2
227 #define LLDP_DOT3_POWER_PRIO_LOW 3
228
229 /* PMD Auto-Negotiation Advertised Capability field, from RFC 3636 (see
230 * IANAifMauAutoNegCapBits). Unfortunately, we are limited to two bytes, so
231 * higher speed capabilities will map to "other". */
232 #define LLDP_DOT3_LINK_AUTONEG_OTHER 0x8000
233 #define LLDP_DOT3_LINK_AUTONEG_10BASE_T 0x4000
234 #define LLDP_DOT3_LINK_AUTONEG_10BASET_FD 0x2000
235 #define LLDP_DOT3_LINK_AUTONEG_100BASE_T4 0x1000
236 #define LLDP_DOT3_LINK_AUTONEG_100BASE_TX 0x0800
237 #define LLDP_DOT3_LINK_AUTONEG_100BASE_TXFD 0x0400
238 #define LLDP_DOT3_LINK_AUTONEG_100BASE_T2 0x0200
239 #define LLDP_DOT3_LINK_AUTONEG_100BASE_T2FD 0x0100
240 #define LLDP_DOT3_LINK_AUTONEG_FDX_PAUSE 0x0080
241 #define LLDP_DOT3_LINK_AUTONEG_FDX_APAUSE 0x0040
242 #define LLDP_DOT3_LINK_AUTONEG_FDX_SPAUSE 0x0020
243 #define LLDP_DOT3_LINK_AUTONEG_FDX_BPAUSE 0x0010
244 #define LLDP_DOT3_LINK_AUTONEG_1000BASE_X 0x0008
245 #define LLDP_DOT3_LINK_AUTONEG_1000BASE_XFD 0x0004
246 #define LLDP_DOT3_LINK_AUTONEG_1000BASE_T 0x0002
247 #define LLDP_DOT3_LINK_AUTONEG_1000BASE_TFD 0x0001
248
249 /* Capabilities */
250 #define LLDP_CAP_OTHER 0x01
251 #define LLDP_CAP_REPEATER 0x02
252 #define LLDP_CAP_BRIDGE 0x04
253 #define LLDP_CAP_WLAN 0x08
254 #define LLDP_CAP_ROUTER 0x10
255 #define LLDP_CAP_TELEPHONE 0x20
256 #define LLDP_CAP_DOCSIS 0x40
257 #define LLDP_CAP_STATION 0x80
258 #define LLDP_CAP_CVLAN 0x100
259 #define LLDP_CAP_SVLAN 0x200
260 #define LLDP_CAP_TPMRCOMP 0x400
261
262 #define LLDP_PPVID_CAP_SUPPORTED (1 << 1)
263 #define LLDP_PPVID_CAP_ENABLED (1 << 2)
264
265 /* see http://www.iana.org/assignments/address-family-numbers */
266 #define LLDP_MGMT_ADDR_NONE 0
267 #define LLDP_MGMT_ADDR_IP4 1
268 #define LLDP_MGMT_ADDR_IP6 2
269
270 #define LLDP_MGMT_IFACE_UNKNOWN 1
271 #define LLDP_MGMT_IFACE_IFINDEX 2
272 #define LLDP_MGMT_IFACE_SYSPORT 3
273
274 #define LLDP_MED_CLASS_I 1
275 #define LLDP_MED_CLASS_II 2
276 #define LLDP_MED_CLASS_III 3
277 #define LLDP_MED_NETWORK_DEVICE 4
278
279 /* LLDP MED application ttpes */
280 #define LLDP_MED_APPTYPE_UNDEFINED 0
281 #define LLDP_MED_APPTYPE_VOICE 1
282 #define LLDP_MED_APPTYPE_VOICESIGNAL 2
283 #define LLDP_MED_APPTYPE_GUESTVOICE 3
284 #define LLDP_MED_APPTYPE_GUESTVOICESIGNAL 4
285 #define LLDP_MED_APPTYPE_SOFTPHONEVOICE 5
286 #define LLDP_MED_APPTYPE_VIDEOCONFERENCE 6
287 #define LLDP_MED_APPTYPE_VIDEOSTREAM 7
288 #define LLDP_MED_APPTYPE_VIDEOSIGNAL 8
289 #define LLDP_MED_APPTYPE_LAST LLDP_MED_APPTYPE_VIDEOSIGNAL
290
291 /* LLDP MED location formats */
292 #define LLDP_MED_LOCFORMAT_COORD 1
293 #define LLDP_MED_LOCFORMAT_CIVIC 2
294 #define LLDP_MED_LOCFORMAT_ELIN 3
295 #define LLDP_MED_LOCFORMAT_LAST LLDP_MED_LOCFORMAT_ELIN
296
297 #define LLDP_MED_LOCATION_GEOID_WGS84 1
298 #define LLDP_MED_LOCATION_GEOID_NAD83 2
299 #define LLDP_MED_LOCATION_GEOID_NAD83_MLLW 3
300
301 #define LLDP_MED_LOCATION_ALTITUDE_UNIT_METER 1
302 #define LLDP_MED_LOCATION_ALTITUDE_UNIT_FLOOR 2
303
304 /* LLDP MED power related constants */
305 #define LLDP_MED_POW_TYPE_PSE 1
306 #define LLDP_MED_POW_TYPE_PD 2
307 #define LLDP_MED_POW_TYPE_RESERVED 3
308
309 #define LLDP_MED_POW_SOURCE_UNKNOWN 1
310 #define LLDP_MED_POW_SOURCE_PRIMARY 2
311 #define LLDP_MED_POW_SOURCE_BACKUP 3
312 #define LLDP_MED_POW_SOURCE_RESERVED 4
313 #define LLDP_MED_POW_SOURCE_PSE 5
314 #define LLDP_MED_POW_SOURCE_LOCAL 6
315 #define LLDP_MED_POW_SOURCE_BOTH 7
316
317 #define LLDP_MED_POW_PRIO_UNKNOWN 0
318 #define LLDP_MED_POW_PRIO_CRITICAL 1
319 #define LLDP_MED_POW_PRIO_HIGH 2
320 #define LLDP_MED_POW_PRIO_LOW 3
321
322 /* LLDP MED capabilities */
323 #define LLDP_MED_CAP_CAP 0x01
324 #define LLDP_MED_CAP_POLICY 0x02
325 #define LLDP_MED_CAP_LOCATION 0x04
326 #define LLDP_MED_CAP_MDI_PSE 0x08
327 #define LLDP_MED_CAP_MDI_PD 0x10
328 #define LLDP_MED_CAP_IV 0x20
329
330 /* Protocol constants for multi-protocol lldpd */
331 #define LLDPD_MODE_LLDP 1
332 #define LLDPD_MODE_CDPV1 2
333 #define LLDPD_MODE_CDPV2 3
334 #define LLDPD_MODE_SONMP 4
335 #define LLDPD_MODE_EDP 5
336 #define LLDPD_MODE_FDP 6
337 #define LLDPD_MODE_MAX LLDPD_MODE_FDP
338
339 /* Bond slave src mac type constants */
340 #define LLDP_BOND_SLAVE_SRC_MAC_TYPE_UNKNOWN 0
341 #define LLDP_BOND_SLAVE_SRC_MAC_TYPE_REAL 1
342 #define LLDP_BOND_SLAVE_SRC_MAC_TYPE_ZERO 2
343 #define LLDP_BOND_SLAVE_SRC_MAC_TYPE_FIXED 3
344 #define LLDP_BOND_SLAVE_SRC_MAC_TYPE_LOCALLY_ADMINISTERED 4
345 #define LLDP_BOND_SLAVE_SRC_MAC_TYPE_MAX \
346 LLDP_BOND_SLAVE_SRC_MAC_TYPE_LOCALLY_ADMINISTERED
347
348 /* Agent types */
349 #define LLDP_AGENT_TYPE_UNKNOWN 0
350 #define LLDP_AGENT_TYPE_NEAREST_BRIDGE 1
351 #define LLDP_AGENT_TYPE_NEAREST_NONTPMR_BRIDGE 2
352 #define LLDP_AGENT_TYPE_NEAREST_CUSTOMER_BRIDGE 3
353 #define LLDP_AGENT_TYPE_MAX LLDP_AGENT_TYPE_NEAREST_CUSTOMER_BRIDGE
354
355 #endif /* _LLDP_H */