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

Header file for various basic CDP (Cisco Discovery Protocol definitions and accessor functions. More...

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

Go to the source code of this file.

Macros

#define CDP_TLV_DEVID   0x0001
 Hostname of the device or hardware serial number in ASCII. More...
 
#define CDP_TLV_ADDRESS   0x0002
 The L3 address of the interface that has sent the update. More...
 
#define CDP_TLV_PORTID   0x0003
 The port from which the CDP update has been sent (ASCII) More...
 
#define CDP_TLV_CAPS   0x0004
 Bit mask describing the functional capabilities of the device. More...
 
#define CDP_TLV_VERS   0x0005
 A character string containing the (IOS) software version (same as in show version). More...
 
#define CDP_TLV_PLATFORM   0x0006
 Hardware platform, such as WS-C5000, WS-C6009, or Cisco RSP. More...
 
#define CDP_TLV_IPPREFIX   0x0007
 4 bytes of IPv4 network prefix + 1 byte of CIDR-style netmask More...
 
#define CDP_TLV_HELLO   0x0008
 Protocol-Hello - encapsulates some other protocol - clustering? More...
 
#define CDP_TLV_VTPDOMAIN   0x0009
 The VTP Domain (VLAN management domain), if configured on the device. More...
 
#define CDP_TLV_NATIVEVLAN   0x000A
 In dot1q, this is the untagged VLAN. More...
 
#define CDP_TLV_DUPLEX   0x000B
 This field contains the duplex setting of the sending port. More...
 
#define CDP_TLV_VLREPLY   0x000E
 VOIP VLAN reply. More...
 
#define CDP_TLV_VLQUERY   0x000F
 VOIP VLAN query. More...
 
#define CDP_TLV_POWER   0x0010
 Power consumption in milliwatts. More...
 
#define CDP_TLV_MTU   0x0011
 Port MTU (integer) More...
 
#define CDP_TLV_TRUST_BITMAP   0x0012
 Trust bitmap (bit map) More...
 
#define CDP_TLV_UNTRUSTED_COS   0x0013
 Untrusted Port CoS. More...
 
#define CDP_TLV_SYSTEM_NAME   0x0014
 System name (string) More...
 
#define CDP_TLV_SYSTEM_OID   0x0015
 System Object ID. More...
 
#define CDP_TLV_MANAGEMENT_ADDR   0x0016
 Management address. More...
 
#define CDP_TLV_LOCATION   0x0017
 System location. More...
 
#define CDP_TLV_EXT_PORTID   0x0017
 External port id. More...
 
#define CDP_TLV_POWER_REQUESTED   0x0018
 Requested POE power. More...
 
#define CDP_TLV_POWER_AVAILABLE   0x0019
 Available POE Power. More...
 
#define CDP_TLV_UNIDIR   0x001B
 Port Unidirectional. More...
 
#define CDP_CAPMASK_ROUTER   0x01
 L3 Router (ROLE_router) More...
 
#define CDP_CAPMASK_TBBRIDGE   0x02
 TB (transparent) Bridge (ROLE_tb_bridge) More...
 
#define CDP_CAPMASK_SPBRIDGE   0x04
 SP (source route) Bridge (ROLE_srcbridge) More...
 
#define CDP_CAPMASK_SWITCH   0x08
 L2 Switch (ROLE_bridge) More...
 
#define CDP_CAPMASK_HOST   0x10
 ROLE_host. More...
 
#define CDP_CAPMASK_IGMPFILTER   0x20
 Does not forward IGMP report packets on non-routerports (ROLE_igcmp) More...
 
#define CDP_CAPMASK_REPEATER   0x40
 Repeater (ROLE_repeater) More...
 

Functions

WINEXPORT guint8 get_cdp_vers (gconstpointer pktptr, gconstpointer pktend)
 
WINEXPORT guint8 get_cdp_ttl (gconstpointer pktptr, gconstpointer pktend)
 
WINEXPORT guint16 get_cdp_cksum (gconstpointer pktptr, gconstpointer pktend)
 
WINEXPORT guint16 get_cdptlv_type (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gsize get_cdptlv_len (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gsize get_cdptlv_vlen (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gconstpointer get_cdptlv_body (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gconstpointer get_cdptlv_first (gconstpointer pkt, gconstpointer pktend)
 
WINEXPORT gconstpointer get_cdptlv_next (gconstpointer tlv_vp, gconstpointer pktend)
 
WINEXPORT gconstpointer get_cdp_chassis_id (gconstpointer packet, gssize *idlength, gconstpointer pktend)
 Get the chassis ID associated with this CDP packet. More...
 
WINEXPORT gconstpointer get_cdp_port_id (gconstpointer packet, gssize *idlength, gconstpointer pktend)
 get the port ID associated with this CDP packet More...
 
WINEXPORT gboolean is_valid_cdp_packet (gconstpointer packet, gconstpointer pktend)
 
WINEXPORT gboolean enable_cdp_packets (gboolean enableme)
 

Detailed Description

Header file for various basic CDP (Cisco Discovery Protocol definitions and accessor functions.

There is a lot that's not documented and not understood about this protocol. But what we understand is somewhat documented here.

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 cdp.h.

Function Documentation

WINEXPORT gboolean enable_cdp_packets ( gboolean  enableme)
WINEXPORT gconstpointer get_cdp_chassis_id ( gconstpointer  packet,
gssize *  idlength,
gconstpointer  pktend 
)

Get the chassis ID associated with this CDP packet.

Returns
pointer to chassis ID memory area and also length of the chassis ID
Parameters
[in]packetPointer to a the start of a CDP packet
[out]idlengthlength of chassis id
[in]pktendPointer of first byte past end of CDP packet

Definition at line 276 of file cdp_min.c.

References CDP_TLV_DEVID, get_cdptlv_body(), get_cdptlv_first(), get_cdptlv_next(), get_cdptlv_type(), and get_cdptlv_vlen().

Here is the call graph for this function:

WINEXPORT guint16 get_cdp_cksum ( gconstpointer  pktptr,
gconstpointer  pktend 
)
WINEXPORT gconstpointer get_cdp_port_id ( gconstpointer  packet,
gssize *  idlength,
gconstpointer  pktend 
)

get the port ID associated with this CDP packet

Returns
pointer to port ID memory area and also length of the port ID
Parameters
[in]packetPointer to a the start of a CDP packet
[out]idlengthlength of chassis id
[in]pktendPointer of first byte past end of CDP packet

Definition at line 297 of file cdp_min.c.

References CDP_TLV_PORTID, get_cdptlv_body(), get_cdptlv_first(), get_cdptlv_next(), get_cdptlv_type(), and get_cdptlv_vlen().

Here is the call graph for this function:

WINEXPORT guint8 get_cdp_ttl ( gconstpointer  pktptr,
gconstpointer  pktend 
)
WINEXPORT guint8 get_cdp_vers ( gconstpointer  pktptr,
gconstpointer  pktend 
)
WINEXPORT gconstpointer get_cdptlv_body ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT gconstpointer get_cdptlv_first ( gconstpointer  pkt,
gconstpointer  pktend 
)
WINEXPORT gsize get_cdptlv_len ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT gconstpointer get_cdptlv_next ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT guint16 get_cdptlv_type ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT gsize get_cdptlv_vlen ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
WINEXPORT gboolean is_valid_cdp_packet ( gconstpointer  packet,
gconstpointer  pktend 
)