| 1 | # SNMP::Info::Layer3::Steelfusion | ||
| 2 | # | ||
| 3 | # Copyright (c) 2013 Eric Miller | ||
| 4 | # All rights reserved. | ||
| 5 | # | ||
| 6 | # Redistribution and use in source and binary forms, with or without | ||
| 7 | # modification, are permitted provided that the following conditions are met: | ||
| 8 | # | ||
| 9 | # * Redistributions of source code must retain the above copyright notice, | ||
| 10 | # this list of conditions and the following disclaimer. | ||
| 11 | # * Redistributions in binary form must reproduce the above copyright | ||
| 12 | # notice, this list of conditions and the following disclaimer in the | ||
| 13 | # documentation and/or other materials provided with the distribution. | ||
| 14 | # * Neither the name of the University of California, Santa Cruz nor the | ||
| 15 | # names of its contributors may be used to endorse or promote products | ||
| 16 | # derived from this software without specific prior written permission. | ||
| 17 | # | ||
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| 22 | # LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 28 | # POSSIBILITY OF SUCH DAMAGE. | ||
| 29 | |||
| 30 | package SNMP::Info::Layer3::Steelfusion; | ||
| 31 | |||
| 32 | use strict; | ||
| 33 | use warnings; | ||
| 34 | use Exporter; | ||
| 35 | use SNMP::Info::Layer3; | ||
| 36 | |||
| 37 | @SNMP::Info::Layer3::Steelfusion::ISA | ||
| 38 | = qw/SNMP::Info::Layer3 Exporter/; | ||
| 39 | @SNMP::Info::Layer3::Steelfusion::EXPORT_OK = qw//; | ||
| 40 | |||
| 41 | our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE); | ||
| 42 | |||
| 43 | $VERSION = '3.985003'; | ||
| 44 | |||
| 45 | %MIBS = ( | ||
| 46 | %SNMP::Info::Layer3::MIBS, | ||
| 47 | 'STEELFUSIN-MIB' => 'serialNumber', | ||
| 48 | ); | ||
| 49 | |||
| 50 | %GLOBALS = ( | ||
| 51 | %SNMP::Info::Layer3::GLOBALS, | ||
| 52 | # Fully qualified to remove ambiguity of 'model' | ||
| 53 | 'rb_model' => 'STEELFUSION-MIB::model', | ||
| 54 | ); | ||
| 55 | |||
| 56 | %FUNCS = ( | ||
| 57 | %SNMP::Info::Layer3::FUNCS, | ||
| 58 | ); | ||
| 59 | |||
| 60 | %MUNGE = ( | ||
| 61 | %SNMP::Info::Layer3::MUNGE, | ||
| 62 | ); | ||
| 63 | |||
| 64 | sub layers { | ||
| 65 | return '01001100'; | ||
| 66 | } | ||
| 67 | |||
| 68 | sub vendor { | ||
| 69 | return 'riverbed'; | ||
| 70 | } | ||
| 71 | |||
| 72 | sub model { | ||
| 73 | my $riverbed = shift; | ||
| 74 | |||
| 75 | my $model = $riverbed->rb_model() || ''; | ||
| 76 | |||
| 77 | if ($model =~ /^(\d+)/) { | ||
| 78 | return $1; | ||
| 79 | } | ||
| 80 | return $model; | ||
| 81 | } | ||
| 82 | |||
| 83 | sub os { | ||
| 84 | return 'steelfusion'; | ||
| 85 | } | ||
| 86 | |||
| 87 | sub os_ver { | ||
| 88 | my $riverbed = shift; | ||
| 89 | |||
| 90 | my $ver = $riverbed->systemVersion() || ''; | ||
| 91 | |||
| 92 | if ( $ver =~ /(\d+[\.\d]+)/ ) { | ||
| 93 | return $1; | ||
| 94 | } | ||
| 95 | |||
| 96 | return $ver; | ||
| 97 | } | ||
| 98 | |||
| 99 | sub serial { | ||
| 100 | my $riverbed = shift; | ||
| 101 | |||
| 102 | return $riverbed->serialNumber(); | ||
| 103 | } | ||
| 104 | |||
| 105 | 1; | ||
| 106 | __END__ |