1/* $OpenBSD: lldp.h,v 1.1 2025/05/02 05:57:02 dlg Exp $ */
2
3/*
4 * Copyright (c) 2025 David Gwynne <dlg@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#ifndef _NET_LLDP_H_
20#define _NET_LLDP_H_
21
22#define LLDP_TLV_END 0
23#define LLDP_TLV_CHASSIS_ID 1
24#define LLDP_TLV_PORT_ID 2
25#define LLDP_TLV_TTL 3
26#define LLDP_TLV_PORT_DESCR 4
27#define LLDP_TLV_SYSTEM_NAME 5
28#define LLDP_TLV_SYSTEM_DESCR 6
29#define LLDP_TLV_SYSTEM_CAP 7
30#define LLDP_TLV_MANAGEMENT_ADDR 8
31#define LLDP_TLV_ORG 127
32
33/*
34 * Chassis ID subtype enumeration
35 */
36#define LLDP_CHASSIS_ID_CHASSIS 1 /* Chassis component */
37#define LLDP_CHASSIS_ID_IFALIAS 2 /* Interface alias */
38#define LLDP_CHASSIS_ID_PORT 3 /* Port component */
39#define LLDP_CHASSIS_ID_MACADDR 4 /* MAC address */
40#define LLDP_CHASSIS_ID_ADDR 5 /* Network address */
41#define LLDP_CHASSIS_ID_IFNAME 6 /* Interface name */
42#define LLDP_CHASSIS_ID_LOCAL 7 /* Locally assigned */
43
44/*
45 * Port ID subtype enumeration
46 */
47#define LLDP_PORT_ID_IFALIAS 1 /* Interface alias */
48#define LLDP_PORT_ID_PORT 2 /* Port component */
49#define LLDP_PORT_ID_MACADDR 3 /* MAC address */
50#define LLDP_PORT_ID_ADDR 4 /* Network address */
51#define LLDP_PORT_ID_IFNAME 5 /* Interface name */
52#define LLDP_PORT_ID_AGENTCID 6 /* Agent circuit ID */
53#define LLDP_PORT_ID_LOCAL 7 /* Locally assigned */
54
55/*
56 * System Capabilities bits
57 */
58#define LLDP_SYSTEM_CAP_OTHER (1 << 0)
59#define LLDP_SYSTEM_CAP_REPEATER (1 << 1)
60#define LLDP_SYSTEM_CAP_BRIDGE (1 << 2)
61#define LLDP_SYSTEM_CAP_WLAN (1 << 3)
62#define LLDP_SYSTEM_CAP_ROUTER (1 << 4)
63#define LLDP_SYSTEM_CAP_TELEPHONE (1 << 5)
64#define LLDP_SYSTEM_CAP_DOCSIS (1 << 6)
65#define LLDP_SYSTEM_CAP_STATION (1 << 7)
66
67#endif /* _NET_LLDP_H_ */