Merge remote-tracking branch 'upstream/master'
[torrus-plus.git] / src / lib / Torrus / DevDiscover / Thomson_xDSL.pm
blob117933ea0856c666c0d379834255cfa5e4d295ec
1 # Copyright (C) 2011 Stanislav Sinyagin
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 # Technicolor Thomson xDSL gateways
18 # Only interface indexing and naming is handled here.
20 package Torrus::DevDiscover::Thomson_xDSL;
22 use strict;
23 use warnings;
25 use Torrus::Log;
27 our $VERSION = 1.0;
29 $Torrus::DevDiscover::registry{'Thomson_xDSL'} = {
30 'sequence' => 500,
31 'checkdevtype' => \&checkdevtype,
32 'discover' => \&discover,
33 'buildConfig' => \&buildConfig
37 our %oiddef =
39 'thomson_xDSL_products' => '1.3.6.1.4.1.2863.405',
43 sub checkdevtype
45 my $dd = shift;
46 my $devdetails = shift;
48 if( not $dd->oidBaseMatch
49 ( 'thomson_xDSL_products',
50 $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) )
52 return 0;
55 $devdetails->setCap('interfaceIndexingPersistent');
57 &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter
58 ($devdetails,
60 'BRG' => {
61 'ifType' => 6, # ethernetCsmacd
62 'ifDescr' => '^BRG:' } });
64 return 1;
68 sub discover
70 my $dd = shift;
71 my $devdetails = shift;
73 my $data = $devdetails->data();
74 my $session = $dd->session();
76 $data->{'nameref'}{'ifSubtreeName'} = 'ifNameT';
77 $data->{'nameref'}{'ifReferenceName'} = 'ifName';
78 $data->{'nameref'}{'ifNick'} = 'ifIndex';
79 $data->{'nameref'}{'ifNodeid'} = 'ifIndex';
81 undef $data->{'nameref'}{'ifComment'};
83 $data->{'param'}{'snmp-oids-per-pdu'} = 10;
84 return 1;
88 sub buildConfig
90 my $devdetails = shift;
91 my $cb = shift;
92 my $devNode = shift;
93 return;
101 # Local Variables:
102 # mode: perl
103 # indent-tabs-mode: nil
104 # perl-indent-level: 4
105 # End: