lldp_debug.c File Reference

Data logging functions for debugging purpose (LLDP) More...

#include "core/net.h"
#include "lldp/lldp.h"
#include "lldp/lldp_ext_dot1.h"
#include "lldp/lldp_ext_dot3.h"
#include "lldp/lldp_ext_med.h"
#include "lldp/lldp_ext_pno.h"
#include "lldp/lldp_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   LLDP_TRACE_LEVEL
 

Functions

void lldpDumpDataUnit (LldpDataUnit *lldpdu)
 Dump LLDP data unit. More...
 
void lldpDumpTlv (const LldpTlv *tlv)
 Dump TLV structure. More...
 
const char_tlldpGetParamName (uint_t value, const LldpParamName *paramList, size_t paramListLen)
 Convert a parameter to string representation. More...
 

Variables

const LldpParamName lldpTlvTypeList []
 
const LldpParamName lldpOuiList []
 
const LldpParamName lldpDot1SubtypeList []
 
const LldpParamName lldpDot3SubtypeList []
 
const LldpParamName lldpMedSubtypeList []
 
const LldpParamName lldpPnoSubtypeList []
 

Detailed Description

Data logging functions for debugging purpose (LLDP)

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file lldp_debug.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   LLDP_TRACE_LEVEL

Definition at line 32 of file lldp_debug.c.

Function Documentation

◆ lldpDumpDataUnit()

void lldpDumpDataUnit ( LldpDataUnit lldpdu)

Dump LLDP data unit.

Parameters
[in]lldpduPointer to the LLDPDU

Definition at line 126 of file lldp_debug.c.

◆ lldpDumpTlv()

void lldpDumpTlv ( const LldpTlv tlv)

Dump TLV structure.

Parameters
[in]tlvPointer to the TLV

Definition at line 153 of file lldp_debug.c.

◆ lldpGetParamName()

const char_t* lldpGetParamName ( uint_t  value,
const LldpParamName paramList,
size_t  paramListLen 
)

Convert a parameter to string representation.

Parameters
[in]valueParameter value
[in]paramListList of acceptable parameters
[in]paramListLenNumber of entries in the list
Returns
NULL-terminated string describing the parameter

Definition at line 245 of file lldp_debug.c.

Variable Documentation

◆ lldpDot1SubtypeList

const LldpParamName lldpDot1SubtypeList[]
Initial value:
=
{
{LLDP_DOT1_SUBTYPE_PORT_VLAN_ID, "Port VLAN ID"},
{LLDP_DOT1_SUBTYPE_PORT_PROTO_VLAN_ID, "Port And Protocol VLAN ID"},
{LLDP_DOT1_SUBTYPE_PROTOCOL_ID, "Protocol Identity"}
}

Definition at line 72 of file lldp_debug.c.

◆ lldpDot3SubtypeList

const LldpParamName lldpDot3SubtypeList[]
Initial value:
=
{
{LLDP_DOT3_SUBTYPE_MAC_PHY_CONFIG_STATUS, "MAC/PHY Configuration/Status"},
{LLDP_DOT3_SUBTYPE_POWER_VIA_MDI, "Power Via MDI"},
{LLDP_DOT3_SUBTYPE_LINK_AGGREGATION, "Link Aggregation"},
{LLDP_DOT3_SUBTYPE_MAX_FRAME_SIZE, "Maximum Frame Size"}
}

Definition at line 82 of file lldp_debug.c.

◆ lldpMedSubtypeList

const LldpParamName lldpMedSubtypeList[]
Initial value:
=
{
{LLDP_MED_SUBTYPE_LLDP_MED_CAP, "LLDP-MED Capabilities"},
{LLDP_MED_SUBTYPE_NETWORK_POLICY, "Network Policy"},
{LLDP_MED_SUBTYPE_LOCATION_ID, "Location Identification"},
{LLDP_MED_SUBTYPE_EXT_POWER_VIA_MDI, "Extended Power-via-MDI"},
{LLDP_MED_SUBTYPE_HARDWARE_REVISION, "Inventory - Hardware Revision"},
{LLDP_MED_SUBTYPE_FIRMWARE_REVISION, "Inventory - Firmware Revision"},
{LLDP_MED_SUBTYPE_SOFTWARE_REVISION, "Inventory - Software Revision"},
{LLDP_MED_SUBTYPE_SERIAL_NUMBER, "Inventory - Serial Number"},
{LLDP_MED_SUBTYPE_MANUFACTURER_NAME, "Inventory - Manufacturer Name"},
{LLDP_MED_SUBTYPE_MODEL_NAME, "Inventory - Model Name"},
{LLDP_MED_SUBTYPE_ASSET_ID, "Inventory - Asset ID"}
}

Definition at line 92 of file lldp_debug.c.

◆ lldpOuiList

const LldpParamName lldpOuiList[]
Initial value:
=
{
{LLDP_DOT1_OUI, "IEEE 802.1"},
{LLDP_DOT3_OUI, "IEEE 802.3"},
{LLDP_MED_OUI, "LLDP-MED"},
{LLDP_PNO_OUI, "PROFINET"}
}

Definition at line 63 of file lldp_debug.c.

◆ lldpPnoSubtypeList

const LldpParamName lldpPnoSubtypeList[]
Initial value:
=
{
{LLDP_PNO_SUBTYPE_MEASURED_DELAY_VALUES, "Measured Delay Values"},
{LLDP_PNO_SUBTYPE_PORT_STATUS, "Port Status"},
{LLDP_PNO_SUBTYPE_MRP_PORT_STATUS, "MRP Port Status"},
{LLDP_PNO_SUBTYPE_INTERFACE_MAC_ADDR, "Interface MAC address"},
{LLDP_PNO_SUBTYPE_PTCP_STATUS, "PTCP Status"},
}

Definition at line 109 of file lldp_debug.c.

◆ lldpTlvTypeList

const LldpParamName lldpTlvTypeList[]
Initial value:
=
{
{LLDP_TLV_TYPE_END_OF_LLDPDU, "End Of LLDPDU"},
{LLDP_TLV_TYPE_CHASSIS_ID, "Chassis ID"},
{LLDP_TLV_TYPE_PORT_ID, "Port ID"},
{LLDP_TLV_TYPE_TIME_TO_LIVE, "Time To Live"},
{LLDP_TLV_TYPE_PORT_DESC, "Port Description"},
{LLDP_TLV_TYPE_SYS_NAME, "System Name"},
{LLDP_TLV_TYPE_SYS_DESC, "System Description"},
{LLDP_TLV_TYPE_SYS_CAP, "System Capabilities"},
{LLDP_TLV_TYPE_MGMT_ADDR, "Management Address"},
{LLDP_TLV_TYPE_ORG_DEFINED, "Organizationally Specific"}
}

Definition at line 48 of file lldp_debug.c.

@ LLDP_MED_SUBTYPE_EXT_POWER_VIA_MDI
Extended Power-via-MDI.
Definition: lldp_ext_med.h:59
@ LLDP_MED_SUBTYPE_FIRMWARE_REVISION
Inventory - Firmware Revision.
Definition: lldp_ext_med.h:61
@ LLDP_TLV_TYPE_SYS_CAP
System Capabilities.
Definition: lldp_tlv.h:100
@ LLDP_DOT3_SUBTYPE_POWER_VIA_MDI
Power Via MDI.
Definition: lldp_ext_dot3.h:52
@ LLDP_DOT1_SUBTYPE_PORT_PROTO_VLAN_ID
Port And Protocol VLAN ID.
Definition: lldp_ext_dot1.h:62
@ LLDP_MED_SUBTYPE_MANUFACTURER_NAME
Inventory - Manufacturer Name.
Definition: lldp_ext_med.h:64
@ LLDP_MED_SUBTYPE_SOFTWARE_REVISION
Inventory - Software Revision.
Definition: lldp_ext_med.h:62
@ LLDP_TLV_TYPE_MGMT_ADDR
Management Address.
Definition: lldp_tlv.h:101
@ LLDP_TLV_TYPE_ORG_DEFINED
Organizationally Specific TLVs.
Definition: lldp_tlv.h:102
@ LLDP_MED_SUBTYPE_ASSET_ID
Inventory - Asset ID.
Definition: lldp_ext_med.h:66
@ LLDP_MED_SUBTYPE_MODEL_NAME
Inventory - Model Name.
Definition: lldp_ext_med.h:65
@ LLDP_PNO_OUI
PROFIBUS.
Definition: lldp_tlv.h:191
@ LLDP_PNO_SUBTYPE_ALIAS
Alias.
Definition: lldp_ext_pno.h:53
@ LLDP_DOT1_SUBTYPE_RESERVED
Reserved.
Definition: lldp_ext_dot1.h:60
@ LLDP_TLV_TYPE_END_OF_LLDPDU
End Of LLDPDU.
Definition: lldp_tlv.h:93
@ LLDP_DOT3_SUBTYPE_RESERVED
Reserved.
Definition: lldp_ext_dot3.h:50
@ LLDP_PNO_SUBTYPE_MEASURED_DELAY_VALUES
Measured Delay Values.
Definition: lldp_ext_pno.h:51
@ LLDP_MED_SUBTYPE_SERIAL_NUMBER
Inventory - Serial Number.
Definition: lldp_ext_med.h:63
@ LLDP_DOT1_SUBTYPE_PORT_VLAN_ID
Port VLAN ID.
Definition: lldp_ext_dot1.h:61
@ LLDP_MED_SUBTYPE_LLDP_MED_CAP
LLDP-MED Capabilities.
Definition: lldp_ext_med.h:56
@ LLDP_MED_SUBTYPE_NETWORK_POLICY
Network Policy.
Definition: lldp_ext_med.h:57
@ LLDP_MED_SUBTYPE_HARDWARE_REVISION
Inventory - Hardware Revision.
Definition: lldp_ext_med.h:60
@ LLDP_MED_OUI
LLDP-MED.
Definition: lldp_tlv.h:190
@ LLDP_DOT3_SUBTYPE_MAX_FRAME_SIZE
Maximum Frame Size.
Definition: lldp_ext_dot3.h:54
@ LLDP_DOT1_OUI
IEEE 802.1.
Definition: lldp_tlv.h:188
@ LLDP_TLV_TYPE_SYS_NAME
System Name.
Definition: lldp_tlv.h:98
@ LLDP_TLV_TYPE_CHASSIS_ID
Chassis ID.
Definition: lldp_tlv.h:94
@ LLDP_PNO_SUBTYPE_MRP_PORT_STATUS
MRP Port Status.
Definition: lldp_ext_pno.h:54
@ LLDP_PNO_SUBTYPE_INTERFACE_MAC_ADDR
Interface MAC address.
Definition: lldp_ext_pno.h:55
@ LLDP_PNO_SUBTYPE_PTCP_STATUS
PTCP Status.
Definition: lldp_ext_pno.h:56
@ LLDP_MED_SUBTYPE_RESERVED
Reserved.
Definition: lldp_ext_med.h:55
@ LLDP_TLV_TYPE_SYS_DESC
System Description.
Definition: lldp_tlv.h:99
@ LLDP_DOT3_OUI
IEEE 802.3.
Definition: lldp_tlv.h:189
@ LLDP_PNO_SUBTYPE_PORT_STATUS
Port Status.
Definition: lldp_ext_pno.h:52
@ LLDP_DOT1_SUBTYPE_VLAN_NAME
VLAN Name.
Definition: lldp_ext_dot1.h:63
@ LLDP_TLV_TYPE_PORT_ID
Port ID.
Definition: lldp_tlv.h:95
@ LLDP_MED_SUBTYPE_LOCATION_ID
Location Identification.
Definition: lldp_ext_med.h:58
@ LLDP_DOT1_SUBTYPE_PROTOCOL_ID
Protocol Identity.
Definition: lldp_ext_dot1.h:64
@ LLDP_DOT3_SUBTYPE_MAC_PHY_CONFIG_STATUS
MAC/PHY Configuration/Status.
Definition: lldp_ext_dot3.h:51
@ LLDP_DOT3_SUBTYPE_LINK_AGGREGATION
Link Aggregation.
Definition: lldp_ext_dot3.h:53
@ LLDP_TLV_TYPE_TIME_TO_LIVE
Time To Live.
Definition: lldp_tlv.h:96
@ LLDP_PNO_SUBTYPE_RESERVED
Reserved.
Definition: lldp_ext_pno.h:50
@ LLDP_TLV_TYPE_PORT_DESC
Port Description.
Definition: lldp_tlv.h:97