# Copyright (c) 2001-2012 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary Abstract base class for Switch CS modules ## @author dl-nacl-dev@netapp.com ## @status shared ## @pod here =head1 NAME NACL::CS::ComponentState::Switch =head1 SYNOPSIS use base 'NACL::CS::ComponentState::Switch'; =head1 DESCRIPTION NACL::CS::ComponentState::Switch is an abstract base class for all Switch Component state libraries. It is derived from L and it provides Switch specific component base class methods. The implementation and documentation of provided functionality is present in L. =head1 ATTRIBUTES Same as those of L (command interfaces are constrained to be sub-classes of C.) =cut package NACL::CS::ComponentState::Switch; use strict; use warnings; use base 'NACL::CS::ComponentState'; use NACL::C::Switch::Utils qw (_exit_config_modes_cisconetwork); use Class::MethodMaker [ scalar => [ { -type => 'NACL::C::Switch' }, 'command_interface', ], ]; #------------------------------------------------------------------------------ ##################### _PRIVATE_METHODS ####################### #------------------------------------------------------------------------------ ##---------------------------------------------------------------------------- ## Method: _expand_interface_type() ## Objective: Will expand short form of interface in following manner ## 1. Gi or gi => GigabitEthernet ## 2. Te or te => TenGigabitEthernet ## 3. Po or po => port-channel ## 4. Eth or eth => Ethernet ## 5. Fa => FastEthernet ## Details: See POD documentation at the end of this file. ##---------------------------------------------------------------------------- sub _expand_interface_type { my ( $pkg, $int_type ) = @_; if ( $int_type =~ /^Eth$/i ) { $int_type = "Ethernet"; } elsif ( $int_type =~ /^Po$/i ) { $int_type = "port-channel"; } elsif ( $int_type =~ /^Te$/i ) { $int_type = "TenGigabitEthernet"; } elsif ( $int_type =~ /^Gi$/i ) { $int_type = "GigabitEthernet"; } elsif ( $int_type =~ /^Fa$/i ) { $int_type = "FastEthernet"; } return $int_type; } ## end sub _expand_interface_type 1;