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

Implements server-side CDP capabilities - things the client side won't need. More...

#include <projectcommon.h>
#include <stdio.h>
#include <netinet/in.h>
#include "cdp.h"
#include <server_dump.h>
Include dependency graph for cdp.c:

Go to the source code of this file.

Functions

const char * get_cdp_type_string (unsigned cdptype)
 Translate a CDP TLV type into a string. More...
 
void dump_cdp_packet (const void *vpacket,const void *vpktend)
 Dump out a CDP packet - not very intelligently. More...
 

Detailed Description

Implements server-side CDP capabilities - things the client side won't need.

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.c.

Function Documentation

void dump_cdp_packet ( const void *  vpacket,
const void *  vpktend 
)

Dump out a CDP packet - not very intelligently.

Parameters
[in]vpacketPointer to a the start of a CDP packet
[in]vpktendPointer of first byte past end of CDP packet

Definition at line 87 of file cdp.c.

References dump_mem(), get_cdp_cksum(), get_cdp_ttl(), get_cdp_type_string(), get_cdp_vers(), get_cdptlv_body(), get_cdptlv_first(), get_cdptlv_next(), get_cdptlv_type(), get_cdptlv_vlen(), and is_valid_cdp_packet().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

const char * get_cdp_type_string ( unsigned  cdptype)

Translate a CDP TLV type into a string.

Returns
pointer to a constant/static string describing the type of this TLV.
Parameters
[in]cdptypeCDP TLV type

Definition at line 77 of file cdp.c.

References DIMOF.

Referenced by dump_cdp_packet().

Here is the caller graph for this function: