The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::Frame::Layer::CDP - Cisco Discovery Protocol layer object

SYNOPSIS

   use Net::Frame::Simple;
   use Net::Frame::Layer::CDP qw(:consts);

   my $layer = Net::Frame::Layer::CDP->new(
      version  => NF_CDP_VERSION_2,
      ttl      => 180,
      checksum => 0,
   );

   #
   # Read a raw layer
   #
   my $layer = Net::Frame::Layer::CDP->new(raw => $raw);

   print $layer->print."\n";
   print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
      if $layer->payload;

DESCRIPTION

This modules implements the encoding and decoding of the CDP layer.

See also Net::Frame::Layer for other attributes and methods.

ATTRIBUTES

version

CDP version.

ttl

Amount of time, in seconds, that a receiver should retain the information.

checksum

CDP checksum.

The following are inherited attributes. See Net::Frame::Layer for more information.

raw
payload
nextLayer

METHODS

new
new (hash)

Object constructor. You can pass attributes that will overwrite default ones. See SYNOPSIS for default values.

computeChecksums

Computes the CDP checksum.

The following are inherited methods. Some of them may be overriden in this layer, and some others may not be meaningful in this layer. See Net::Frame::Layer for more information.

layer
computeLengths
pack
unpack
encapsulate
getLength
getOptionsLength
getPayloadLength
print
dump

CONSTANTS

Load them: use Net::Frame::Layer::CDP qw(:consts);

NF_CDP_MAC

Default Layer 2 destination address.

NF_CDP_VERSION_1
NF_CDP_VERSION_2

CDP version.

SEE ALSO

Net::Frame::Layer

AUTHOR

Michael Vincent

ACKNOWLEDGEMENTS

Ported from the Net::Packet::CDP modules by Patrice <GomoR> Auffret.

COPYRIGHT AND LICENSE

Copyright (c) 2013, Michael Vincent

You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.