The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lldp.h File Reference

Provides basic Link Layer Discovery Protocol (LLDP) definitions and accessor functions for LLPD packets. More...

#include <projectcommon.h>
#include <sys/types.h>
#include <glib.h>
Include dependency graph for lldp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LLDP_INVAL   65535
 
#define LLDP_TLV_END   0
 end of TLV - Length must be zero More...
 
#define LLDP_TLV_CHID   1
 Chassis ID. More...
 
#define LLDP_TLV_PID   2
 Port ID. More...
 
#define LLDP_TLV_TTL   3
 Time to Live (seconds) More...
 
#define LLDP_TLV_PORT_DESCR   4
 Port description. More...
 
#define LLDP_TLV_SYS_NAME   5
 System name. More...
 
#define LLDP_TLV_SYS_DESCR   6
 System description. More...
 
#define LLDP_TLV_SYS_CAPS   7
 System capabilities. More...
 
#define LLDP_TLV_MGMT_ADDR   8
 System capabilities. More...
 
#define LLDP_TLV_ORG_SPECIFIC   127
 So-called organizationally specific TLVs. More...
 
#define LLDP_CHIDTYPE_COMPONENT   1
 entPhysicalAlias when entPhysicalClass More...
 
#define LLDP_CHIDTYPE_ALIAS   2
 ifAlias - RFC 2863 More...
 
#define LLDP_CHIDTYPE_PORT   3
 entPhysicalAlias when entPhysical More...
 
#define LLDP_CHIDTYPE_MACADDR   4
 IEEE Std 802-2001. More...
 
#define LLDP_CHIDTYPE_NETADDR   5
 Network address w/family number. More...
 
#define LLDP_CHIDTYPE_IFNAME   6
 RFC 2863. More...
 
#define LLDP_CHIDTYPE_LOCAL   7
 "local" alphanumeric string More...
 
#define LLDP_PIDTYPE_ALIAS   1
 ifAlias RFC 2863 More...
 
#define LLDP_PIDTYPE_COMPONENT   2
 entPhysicalAlias when entPhysicalClass More...
 
#define LLDP_PIDTYPE_MACADDR   3
 IEEE Std 802-2001. More...
 
#define LLDP_PIDTYPE_NETADDR   4
 Network address w/family number. More...
 
#define LLDP_PIDTYPE_IFNAME   5
 RFC 2863. More...
 
#define LLDP_PIDTYPE_CIRCUITID   6
 agent circuit ID RFC 3046 More...
 
#define LLDP_PIDTYPE_LOCAL   7
 "local" alphanumeric string More...
 
#define LLDP_CAPMASK_REPEATER   0x02
 RFC 2108. More...
 
#define LLDP_CAPMASK_BRIDGE   0x04
 RFC 2674. More...
 
#define LLDP_CAPMASK_WLAN_AP   0x08
 802.11 MIB (Access Point) More...
 
#define LLDP_CAPMASK_ROUTER   0x10
 RFC 1812. More...
 
#define LLDP_CAPMASK_PHONE   0x20
 RFC 2011. More...
 
#define LLDP_CAPMASK_DOCSIS   0x40
 RFC 2669 + 2670. More...
 
#define LLDP_CAPMASK_STATION   0x80
 RFC 2011. More...
 
#define LLDP_ORG802_1_VLAN_PVID   1
 Section F.2 - Port VLAN ID. More...
 
#define LLDP_ORG802_1_VLAN_PORTPROTO   2
 Section F.3 - Port and Protocol VLAN ID. More...
 
#define LLDP_ORG802_1_VLAN_NAME   3
 Section F.4 - VLAN Name. More...
 
#define LLDP_ORG802_1_VLAN_PROTOID   4
 Section F.5 - Protocol Identity TLV. More...
 
#define LLDP_ORG802_3_PHY_CONFIG   1
 Section G.2 - Physical setup. More...
 
#define LLDP_ORG802_3_POWERVIAMDI   2
 Section G.3 - PoE status. More...
 
#define LLDP_ORG802_3_LINKAGG   3
 Section G.4 - Link Aggregation. More...
 
#define LLDP_ORG802_3_MTU   4
 Section G.5 - MTU. More...
 

Functions

WINEXPORT unsigned get_lldp_chassis_id_type (gconstpointer tlv_vp, gconstpointer tlv_vpend)
 
WINEXPORT gconstpointer get_lldp_chassis_id (gconstpointer tlv_vp, gssize *idlength, gconstpointer tlv_vpend)
 Return a pointer to the chassis id Value entry, and its length. More...
 
gconstpointer get_lldp_port_id (gconstpointer tlv_vp, gssize *idlength, gconstpointer tlv_vpend)
 Return a pointer to the port id Value entry, and its length. More...
 
WINEXPORT unsigned get_lldp_port_id_type (gconstpointer tlv_vp, gconstpointer tlv_vpend)
 
WINEXPORT guint8 get_lldptlv_type (gconstpointer tlvp_vp, gconstpointer pktend)
 
WINEXPORT gsize get_lldptlv_len (gconstpointer tlvp_vp, gconstpointer pktend)
 
WINEXPORT gconstpointer get_lldptlv_first (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gconstpointer get_lldptlv_next (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gconstpointer get_lldptlv_body (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gconstpointer find_next_lldptlv_type (gconstpointer tlv_vp, unsigned tlvtype, gconstpointer tlv_vpend)
 
WINEXPORT gboolean is_valid_lldp_packet (gconstpointer tlv_vp, gconstpointer tlv_vpend)
 
WINEXPORT gboolean enable_lldp_packets (gboolean enableme)
 

Detailed Description

Provides basic Link Layer Discovery Protocol (LLDP) definitions and accessor functions for LLPD packets.

Most of these definitions are encodings of the IEEE Standard 802.1AB "Station and Media Access Control Connectivity Discovery" (6 May 2005)

See Also
http://standards.ieee.org/getieee802/download/802.1AB-2009.pdf
http://en.wikipedia.org/wiki/Link_Layer_Discovery_Protocol

This file is part of the Assimilation Project.

Author
Copyright © 2011, 2012 - Alan Robertson alanr.nosp@m.@uni.nosp@m.x.sh
The Assimilation software 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 3 of the License, or (at your option) any later version.

The Assimilation software 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 the Assimilation Project software. If not, see http://www.gnu.org/licenses/

Definition in file lldp.h.

Macro Definition Documentation

#define LLDP_INVAL   65535

Definition at line 35 of file lldp.h.

Function Documentation

WINEXPORT gboolean enable_lldp_packets ( gboolean  enableme)
WINEXPORT gconstpointer find_next_lldptlv_type ( gconstpointer  tlv_vp,
unsigned  tlvtype,
gconstpointer  tlv_vpend 
)
WINEXPORT gconstpointer get_lldp_chassis_id ( gconstpointer  tlv_vp,
gssize *  idlength,
gconstpointer  pktend 
)

Return a pointer to the chassis id Value entry, and its length.

Returns
pointer to the chassis ID value, and its length.
Parameters
[in]tlv_vpPointer to beginning of LLDP packet
[out]idlengthLength of the chassis id
[in]pktendPointer to first byte beyond packet.

Definition at line 224 of file lldp_min.c.

References find_next_lldptlv_type(), get_lldptlv_body(), get_lldptlv_first(), get_lldptlv_len(), and LLDP_TLV_CHID.

Here is the call graph for this function:

WINEXPORT unsigned get_lldp_chassis_id_type ( gconstpointer  tlv_vp,
gconstpointer  tlv_vpend 
)
gconstpointer get_lldp_port_id ( gconstpointer  tlv_vp,
gssize *  idlength,
gconstpointer  pktend 
)

Return a pointer to the port id Value entry, and its length.

Returns
pointer to the port ID value, and its length.
Parameters
[in]tlv_vpPointer to beginning of LLDP packet
[out]idlengthLength of the port id value
[in]pktendPointer to first byte beyond packet.

Definition at line 241 of file lldp_min.c.

References find_next_lldptlv_type(), get_lldptlv_body(), get_lldptlv_first(), get_lldptlv_len(), and LLDP_TLV_PID.

Here is the call graph for this function:

WINEXPORT unsigned get_lldp_port_id_type ( gconstpointer  tlv_vp,
gconstpointer  tlv_vpend 
)
WINEXPORT gconstpointer get_lldptlv_body ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT gconstpointer get_lldptlv_first ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT gsize get_lldptlv_len ( gconstpointer  tlvp_vp,
gconstpointer  pktend 
)
WINEXPORT gconstpointer get_lldptlv_next ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT guint8 get_lldptlv_type ( gconstpointer  tlvp_vp,
gconstpointer  pktend 
)
WINEXPORT gboolean is_valid_lldp_packet ( gconstpointer  tlv_vp,
gconstpointer  tlv_vpend 
)