1
# Copyright (C) 2012 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
# Comtech EF Data satellite modems
19
package Torrus::DevDiscover::ComtechEFData;
27
$Torrus::DevDiscover::registry{'ComtechEFData'} = {
29
'checkdevtype' => \&checkdevtype,
30
'discover' => \&discover,
31
'buildConfig' => \&buildConfig
37
'ComtechEFData' => '1.3.6.1.4.1.6247',
38
'cdm570' => '1.3.6.1.4.1.6247.24',
39
'cdm570TxFrequency' => '1.3.6.1.4.1.6247.24.1.2.2.1.0',
40
'cdm570TxDataRate' => '1.3.6.1.4.1.6247.24.1.2.2.2.0',
41
'cdm570RxFrequency' => '1.3.6.1.4.1.6247.24.1.2.3.1.0',
42
'cdm570RxDataRate' => '1.3.6.1.4.1.6247.24.1.2.3.2.0',
43
'cdmipWanFpgaRxPayLoadCount' => '1.3.6.1.4.1.6247.4.8.5.6.0',
48
'cdm570TxFrequency' => 'cdm-wan-tx-freq',
49
'cdm570TxDataRate' => 'cdm-wan-tx-rate',
50
'cdm570RxFrequency' => 'cdm-wan-rx-freq',
51
'cdm570RxDataRate' => 'cdm-wan-rx-rate',
57
my $devdetails = shift;
59
my $sysObjectID = $devdetails->snmpVar( $dd->oiddef('sysObjectID') );
61
if( not $dd->oidBaseMatch( 'ComtechEFData', $sysObjectID ) )
66
if( $dd->oidBaseMatch( 'cdm570', $sysObjectID ) )
68
$devdetails->setCap('cdm570');
71
$devdetails->setCap('interfaceIndexingPersistent');
73
&Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter
77
'ifType' => 24, # softwareLoopback
78
'ifDescr' => 'loopback'
89
my $devdetails = shift;
91
my $data = $devdetails->data();
92
my $session = $dd->session();
94
$data->{'param'}{'snmp-oids-per-pdu'} = 10;
96
# Get TX/RX frequency and data rate
97
if( $devdetails->hasCap('cdm570') )
100
foreach my $var ( sort keys %cdm570_OID )
102
push( @oids, $dd->oiddef($var) );
105
my $result = $session->get_request( -varbindlist => \@oids );
106
if( not defined $result )
108
Error('Failed to get CDM570 radio parameters');
112
foreach my $var ( keys %cdm570_OID )
114
my $val = $result->{$dd->oiddef($var)};
115
if( not defined($val) )
119
$data->{'cdm570'}{$var} = $val;
120
$data->{'param'}{$cdm570_OID{$var}} = $val;
124
# Check if IP cotroller is present
126
my $oid = $dd->oiddef('cdmipWanFpgaRxPayLoadCount');
127
my $result = $session->get_request( -varbindlist => [$oid] );
129
if( $session->error_status() == 0 and
130
defined( $result ) and
131
defined($result->{$oid}) )
133
$devdetails->setCap('CDMIPController');
142
my $devdetails = shift;
146
if( $devdetails->hasCap('cdm570') )
148
$cb->addTemplateApplication($devNode, 'ComtechEFData::cdm570');
151
if( $devdetails->hasCap('CDMIPController') )
153
$cb->addTemplateApplication($devNode, 'ComtechEFData::cdmip');
166
# indent-tabs-mode: nil
167
# perl-indent-level: 4