From 4b75ef1889968aa1ed25643ae820bd4810e7f686 Mon Sep 17 00:00:00 2001 From: pyro3d Date: Fri, 19 Apr 2019 22:46:33 -0700 Subject: [PATCH] Add DOCSIS head end support (#317) * Add DOCSIS CMTS support for cable modem discovery * Remove whitespace and update pod --- lib/SNMP/Info.pm | 6 ++ lib/SNMP/Info/DocsisHE.pm | 119 ++++++++++++++++++++++++++++++++++++++ lib/SNMP/Info/Layer2.pm | 9 ++- lib/SNMP/Info/Layer3.pm | 7 ++- 4 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 lib/SNMP/Info/DocsisHE.pm diff --git a/lib/SNMP/Info.pm b/lib/SNMP/Info.pm index c3edbb63..056136b8 100644 --- a/lib/SNMP/Info.pm +++ b/lib/SNMP/Info.pm @@ -338,6 +338,12 @@ F See documentation in L for details. +=item SNMP::Info::DocsisHE + +SNMP Interface for DOCSIS CMTS + +See documentation in L for details. + =item SNMP::Info::EDP Extreme Discovery Protocol. F diff --git a/lib/SNMP/Info/DocsisHE.pm b/lib/SNMP/Info/DocsisHE.pm new file mode 100644 index 00000000..4d650cd8 --- /dev/null +++ b/lib/SNMP/Info/DocsisHE.pm @@ -0,0 +1,119 @@ +package SNMP::Info::DocsisHE; + +use strict; +use Exporter; + +use SNMP::Info; + +@SNMP::Info::DocsisHE::ISA = qw/SNMP::Info Exporter/; +@SNMP::Info::DocsisHE::EXPORT_OK = qw//; + +use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/; + +$VERSION = '3.65'; + +%MIBS = ( + 'DOCS-IF3-MIB' => 'docsIf3Mib', + 'DOCS-IF-MIB' => 'docsIfMib' +); + +%GLOBALS = (); + +%FUNCS = ( + # DOCSIS 3.0 (DOCS-IF3-MIB) from CableLabs + 'docs_if3_cmts_cm_status_md_if_index'=> 'docsIf3CmtsCmRegStatusMdIfIndex', + # DOCSIS (1.1, etc) from IETF + 'docs_if_cmts_cm_status_inet_address_type' => 'docsIfCmtsCmStatusInetAddressType', + 'docs_if_cmts_cm_status_inet_address' => 'docsIfCmtsCmStatusInetAddress', + 'docs_cmts_cm_down_channel_if_index' => 'docsIfCmtsCmStatusDownChannelIfIndex', + 'docs_cmts_cm_up_channel_if_index' => 'docsIfCmtsCmStatusUpChannelIfIndex' +); + +%MUNGE = (); + + 1; +__END__ + +=head1 NAME +SNMP::Info::DocsisHE - SNMP Interface for F and F + +=head1 AUTHOR +Ryan Gasik + +=head1 SYNOPSIS + + my $cmts = new SNMP::Info( + AutoSpecify => 1, + Debug => 1, + DestHost => 'cmts', + Community => 'public', + Version => 2 + ); + # Get a list of modems off the DOCSIS CMTS + my $modems = $cmts->docs_if_cmts_cm_status_inet_address() + +=head1 DESCRIPTION +SNMP::Info::DocsisHE is a subclass of SNMP::Info that provides information +about the cable modems of a DOCSIS CMTS. + +=head2 Inherited Classes + +None. + +=head2 Required MIBs + +=over + +=item F +Standard IETF MIBs for DOCSIS 1.1 + +=item F +CableLabs MIBs for DOCSIS 3 + +=back + +=head1 GLOBAL METHODS + +None. + +=head1 TABLE METHODS + +=over + +=item $info->docs_if3_cmts_cm_status_md_if_index() + +Returns reference to hash of the IfIndex associated with each cable modem. + +(C) + +=item $info->docs_if_cmts_cm_status_inet_address_type() + +Returns reference to hash of the type of IP address (ie, IPv4, IPv6) +associated with each cable modem + +(C) + +=item $info->docs_if_cmts_cm_status_inet_address() + +Returns reference to hash of the IP address associated with each +cable modem. + +(C) + +=item $info->docs_cmts_cm_down_channel_if_index() + +Returns reference to hash of the IfIndex of the down channel +(for DOCSIS 1.1) or a down channel (DOCSIS 3+) associated with each +cable modem. + +(C) + +=item $info->docs_cmts_cm_up_channel_if_index() + +Returns reference to hash of the IfIndex of the up channel +(for DOCSIS 1.1) or a up channel (DOCSIS 3+) associated with each +cable modem. + +(C) + +=back diff --git a/lib/SNMP/Info/Layer2.pm b/lib/SNMP/Info/Layer2.pm index f19e9f55..6c266331 100644 --- a/lib/SNMP/Info/Layer2.pm +++ b/lib/SNMP/Info/Layer2.pm @@ -39,9 +39,10 @@ use SNMP::Info::Bridge; use SNMP::Info::Entity; use SNMP::Info::PowerEthernet; use SNMP::Info::LLDP; +use SNMP::Info::DocsisHE; @SNMP::Info::Layer2::ISA - = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::Entity SNMP::Info::PowerEthernet SNMP::Info::LLDP Exporter/; + = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::Entity SNMP::Info::PowerEthernet SNMP::Info::LLDP SNMP::Info::DocsisHE Exporter/; @SNMP::Info::Layer2::EXPORT_OK = qw//; use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/; @@ -51,12 +52,13 @@ $VERSION = '3.66'; %MIBS = ( %SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS, %SNMP::Info::Entity::MIBS, %SNMP::Info::PowerEthernet::MIBS, - %SNMP::Info::LLDP::MIBS, + %SNMP::Info::LLDP::MIBS, %SNMP::Info::DocsisHE::MIBS, ); %GLOBALS = ( %SNMP::Info::GLOBALS, %SNMP::Info::Bridge::GLOBALS, + %SNMP::Info::DocsisHE::GLOBALS, %SNMP::Info::Entity::GLOBALS, %SNMP::Info::PowerEthernet::GLOBALS, %SNMP::Info::LLDP::GLOBALS, @@ -67,7 +69,7 @@ $VERSION = '3.66'; %FUNCS = ( %SNMP::Info::FUNCS, %SNMP::Info::Bridge::FUNCS, %SNMP::Info::Entity::FUNCS, %SNMP::Info::PowerEthernet::FUNCS, - %SNMP::Info::LLDP::FUNCS, + %SNMP::Info::LLDP::FUNCS, %SNMP::Info::DocsisHE::FUNCS, ); %MUNGE = ( @@ -75,6 +77,7 @@ $VERSION = '3.66'; # Inherit all the built in munging %SNMP::Info::MUNGE, %SNMP::Info::Bridge::MUNGE, + %SNMP::Info::DocsisHE::MUNGE, %SNMP::Info::Entity::MUNGE, %SNMP::Info::PowerEthernet::MUNGE, %SNMP::Info::LLDP::MUNGE, diff --git a/lib/SNMP/Info/Layer3.pm b/lib/SNMP/Info/Layer3.pm index 1bb26f56..4182ef12 100644 --- a/lib/SNMP/Info/Layer3.pm +++ b/lib/SNMP/Info/Layer3.pm @@ -42,12 +42,13 @@ use SNMP::Info::PowerEthernet; use SNMP::Info::IPv6; use SNMP::Info::AdslLine; use SNMP::Info::LLDP; +use SNMP::Info::DocsisHE; @SNMP::Info::Layer3::ISA = qw/ SNMP::Info::PowerEthernet SNMP::Info::IPv6 SNMP::Info::Entity SNMP::Info::EtherLike SNMP::Info::Bridge SNMP::Info::AdslLine - SNMP::Info::LLDP + SNMP::Info::LLDP SNMP::Info::DocsisHE SNMP::Info Exporter/; @SNMP::Info::Layer3::EXPORT_OK = qw//; @@ -59,6 +60,7 @@ $VERSION = '3.66'; %SNMP::Info::MIBS, %SNMP::Info::AdslLine::MIBS, %SNMP::Info::Bridge::MIBS, + %SNMP::Info::DocsisHE::MIBS, %SNMP::Info::EtherLike::MIBS, %SNMP::Info::Entity::MIBS, %SNMP::Info::PowerEthernet::MIBS, @@ -76,6 +78,7 @@ $VERSION = '3.66'; %SNMP::Info::GLOBALS, %SNMP::Info::AdslLine::GLOBALS, %SNMP::Info::Bridge::GLOBALS, + %SNMP::Info::DocsisHE::GLOBALS, %SNMP::Info::EtherLike::GLOBALS, %SNMP::Info::Entity::GLOBALS, %SNMP::Info::PowerEthernet::GLOBALS, @@ -93,6 +96,7 @@ $VERSION = '3.66'; %SNMP::Info::FUNCS, %SNMP::Info::AdslLine::FUNCS, %SNMP::Info::Bridge::FUNCS, + %SNMP::Info::DocsisHE::FUNCS, %SNMP::Info::EtherLike::FUNCS, %SNMP::Info::Entity::FUNCS, %SNMP::Info::PowerEthernet::FUNCS, @@ -167,6 +171,7 @@ $VERSION = '3.66'; %SNMP::Info::AdslLine::MUNGE, %SNMP::Info::Bridge::MUNGE, %SNMP::Info::EtherLike::MUNGE, + %SNMP::Info::DocsisHE::MUNGE, %SNMP::Info::Entity::MUNGE, %SNMP::Info::PowerEthernet::MUNGE, %SNMP::Info::IPv6::MUNGE,