1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 #ifndef foosdlldphfoo 3 #define foosdlldphfoo 4 5 /*** 6 systemd is free software; you can redistribute it and/or modify it 7 under the terms of the GNU Lesser General Public License as published by 8 the Free Software Foundation; either version 2.1 of the License, or 9 (at your option) any later version. 10 11 systemd is distributed in the hope that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public License 17 along with systemd; If not, see <http://www.gnu.org/licenses/>. 18 ***/ 19 20 #include <inttypes.h> 21 22 #include "_sd-common.h" 23 24 _SD_BEGIN_DECLARATIONS; 25 26 /* IEEE 802.1AB-2009 Clause 8: TLV Types */ 27 enum { 28 SD_LLDP_TYPE_END = 0, 29 SD_LLDP_TYPE_CHASSIS_ID = 1, 30 SD_LLDP_TYPE_PORT_ID = 2, 31 SD_LLDP_TYPE_TTL = 3, 32 SD_LLDP_TYPE_PORT_DESCRIPTION = 4, 33 SD_LLDP_TYPE_SYSTEM_NAME = 5, 34 SD_LLDP_TYPE_SYSTEM_DESCRIPTION = 6, 35 SD_LLDP_TYPE_SYSTEM_CAPABILITIES = 7, 36 SD_LLDP_TYPE_MGMT_ADDRESS = 8, 37 SD_LLDP_TYPE_PRIVATE = 127, 38 }; 39 40 /* IEEE 802.1AB-2009 Clause 8.5.2: Chassis subtypes */ 41 enum { 42 SD_LLDP_CHASSIS_SUBTYPE_RESERVED = 0, 43 SD_LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT = 1, 44 SD_LLDP_CHASSIS_SUBTYPE_INTERFACE_ALIAS = 2, 45 SD_LLDP_CHASSIS_SUBTYPE_PORT_COMPONENT = 3, 46 SD_LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS = 4, 47 SD_LLDP_CHASSIS_SUBTYPE_NETWORK_ADDRESS = 5, 48 SD_LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME = 6, 49 SD_LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED = 7, 50 }; 51 52 /* IEEE 802.1AB-2009 Clause 8.5.3: Port subtype */ 53 enum { 54 SD_LLDP_PORT_SUBTYPE_RESERVED = 0, 55 SD_LLDP_PORT_SUBTYPE_INTERFACE_ALIAS = 1, 56 SD_LLDP_PORT_SUBTYPE_PORT_COMPONENT = 2, 57 SD_LLDP_PORT_SUBTYPE_MAC_ADDRESS = 3, 58 SD_LLDP_PORT_SUBTYPE_NETWORK_ADDRESS = 4, 59 SD_LLDP_PORT_SUBTYPE_INTERFACE_NAME = 5, 60 SD_LLDP_PORT_SUBTYPE_AGENT_CIRCUIT_ID = 6, 61 SD_LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED = 7, 62 }; 63 64 /* IEEE 802.1AB-2009 Clause 8.5.8: System capabilities */ 65 enum { 66 SD_LLDP_SYSTEM_CAPABILITIES_OTHER = 1 << 0, 67 SD_LLDP_SYSTEM_CAPABILITIES_REPEATER = 1 << 1, 68 SD_LLDP_SYSTEM_CAPABILITIES_BRIDGE = 1 << 2, 69 SD_LLDP_SYSTEM_CAPABILITIES_WLAN_AP = 1 << 3, 70 SD_LLDP_SYSTEM_CAPABILITIES_ROUTER = 1 << 4, 71 SD_LLDP_SYSTEM_CAPABILITIES_PHONE = 1 << 5, 72 SD_LLDP_SYSTEM_CAPABILITIES_DOCSIS = 1 << 6, 73 SD_LLDP_SYSTEM_CAPABILITIES_STATION = 1 << 7, 74 SD_LLDP_SYSTEM_CAPABILITIES_CVLAN = 1 << 8, 75 SD_LLDP_SYSTEM_CAPABILITIES_SVLAN = 1 << 9, 76 SD_LLDP_SYSTEM_CAPABILITIES_TPMR = 1 << 10, 77 }; 78 79 #define SD_LLDP_SYSTEM_CAPABILITIES_ALL UINT16_MAX 80 81 #define SD_LLDP_SYSTEM_CAPABILITIES_ALL_ROUTERS \ 82 ((uint16_t) \ 83 (SD_LLDP_SYSTEM_CAPABILITIES_REPEATER | \ 84 SD_LLDP_SYSTEM_CAPABILITIES_BRIDGE | \ 85 SD_LLDP_SYSTEM_CAPABILITIES_WLAN_AP | \ 86 SD_LLDP_SYSTEM_CAPABILITIES_ROUTER | \ 87 SD_LLDP_SYSTEM_CAPABILITIES_DOCSIS | \ 88 SD_LLDP_SYSTEM_CAPABILITIES_CVLAN | \ 89 SD_LLDP_SYSTEM_CAPABILITIES_SVLAN | \ 90 SD_LLDP_SYSTEM_CAPABILITIES_TPMR)) 91 92 #define SD_LLDP_OUI_802_1 (const uint8_t[]) { 0x00, 0x80, 0xc2 } 93 #define SD_LLDP_OUI_802_3 (const uint8_t[]) { 0x00, 0x12, 0x0f } 94 95 #define _SD_LLDP_OUI_IANA 0x00, 0x00, 0x5E 96 #define SD_LLDP_OUI_IANA (const uint8_t[]) { _SD_LLDP_OUI_IANA } 97 98 #define SD_LLDP_OUI_IANA_SUBTYPE_MUD 0x01 99 #define SD_LLDP_OUI_IANA_MUD \ 100 (const uint8_t[]) { _SD_LLDP_OUI_IANA, SD_LLDP_OUI_IANA_SUBTYPE_MUD } 101 102 /* IEEE 802.1AB-2009 Annex E */ 103 enum { 104 SD_LLDP_OUI_802_1_SUBTYPE_PORT_VLAN_ID = 1, 105 SD_LLDP_OUI_802_1_SUBTYPE_PORT_PROTOCOL_VLAN_ID = 2, 106 SD_LLDP_OUI_802_1_SUBTYPE_VLAN_NAME = 3, 107 SD_LLDP_OUI_802_1_SUBTYPE_PROTOCOL_IDENTITY = 4, 108 SD_LLDP_OUI_802_1_SUBTYPE_VID_USAGE_DIGEST = 5, 109 SD_LLDP_OUI_802_1_SUBTYPE_MANAGEMENT_VID = 6, 110 SD_LLDP_OUI_802_1_SUBTYPE_LINK_AGGREGATION = 7, 111 }; 112 113 /* IEEE 802.1AB-2009 Annex F */ 114 enum { 115 SD_LLDP_OUI_802_3_SUBTYPE_MAC_PHY_CONFIG_STATUS = 1, 116 SD_LLDP_OUI_802_3_SUBTYPE_POWER_VIA_MDI = 2, 117 SD_LLDP_OUI_802_3_SUBTYPE_LINK_AGGREGATION = 3, 118 SD_LLDP_OUI_802_3_SUBTYPE_MAXIMUM_FRAME_SIZE = 4, 119 }; 120 121 _SD_END_DECLARATIONS; 122 123 #endif 124