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