| 1 | package Net::Cisco::ObjectGroup::Network; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use base qw(Net::Cisco::ObjectGroup::Base); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings FATAL => qw(all); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 6 | ▶ | sub push { | ||||||||||||||||||||||||||
|
Subroutine
push: called CC=9 SCAR=22.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 6 | my $self = shift; | |||||||||||||||||||||||||||
| 11 | 6 | my $arg_ref = shift; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | croak 'must specify either group-object or IP network' | ||||||||||||||||||||||||||||
| 14 | if !defined $arg_ref->{group_object} | ||||||||||||||||||||||||||||
| 15 | 6 | ▶ | and !defined $arg_ref->{net_addr}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $arg_ref->{"group_object"} or defined $arg_ref->{"net_addr"}
MC/DC100%2/2
defined $arg_ref->{"group_object"} or defined $arg_ref->{"net_addr"}
defined $arg_ref->{"group_object"}
defined $arg_ref->{"net_addr"}
Truth table100%3/3
A or B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"net_addr"}
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | croak 'cannot specify both group-object and IP network' | ||||||||||||||||||||||||||||
| 18 | if defined $arg_ref->{group_object} | ||||||||||||||||||||||||||||
| 19 | 5 | ▶ | and defined $arg_ref->{net_addr}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $arg_ref->{"group_object"} and defined $arg_ref->{"net_addr"}
MC/DC100%2/2
defined $arg_ref->{"group_object"} and defined $arg_ref->{"net_addr"}
defined $arg_ref->{"group_object"}
defined $arg_ref->{"net_addr"}
Truth table100%3/3
A and B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"net_addr"}
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | croak 'bad group-object' | ||||||||||||||||||||||||||||
| 22 | if defined $arg_ref->{group_object} | ||||||||||||||||||||||||||||
| 23 | 4 | ▶ | and ! UNIVERSAL::isa( $arg_ref->{group_object}, __PACKAGE__ ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $arg_ref->{"group_object"} and not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
MC/DC100%2/2
defined $arg_ref->{"group_object"} and not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
defined $arg_ref->{"group_object"}
not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
Truth table100%3/3
A and not(B)
A= defined $arg_ref->{"group_object"}B= not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | my $line = defined $arg_ref->{group_object} | ||||||||||||||||||||||||||||
| 26 | ? 'group-object '. $arg_ref->{group_object}->get_name | ||||||||||||||||||||||||||||
| 27 | : defined $arg_ref->{netmask} | ||||||||||||||||||||||||||||
| 28 | 3 | ▶ | ? "network-object $arg_ref->{net_addr} $arg_ref->{netmask}" | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 29 | : "network-object host $arg_ref->{net_addr}"; | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 3 | push @{$self->get_objs}, $line; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 3 | return $self; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 2 | 1; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | # Copyright (c) The University of Oxford 2006. All Rights Reserved. | ||||||||||||||||||||||||||||
| 39 | # | ||||||||||||||||||||||||||||
| 40 | # This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||
| 41 | # under the terms of version 2 of the GNU General Public License as published | ||||||||||||||||||||||||||||
| 42 | # by the Free Software Foundation. | ||||||||||||||||||||||||||||
| 43 | # | ||||||||||||||||||||||||||||
| 44 | # This program is distributed in the hope that it will be useful, but WITHOUT | ||||||||||||||||||||||||||||
| 45 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||||||||||||||||||||||||||
| 46 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||||||||||||||||||||||||||||
| 47 | # more details. | ||||||||||||||||||||||||||||
| 48 | # | ||||||||||||||||||||||||||||
| 49 | # You should have received a copy of the GNU General Public License along with | ||||||||||||||||||||||||||||
| 50 | # this program; if not, write to the Free Software Foundation, Inc., 51 | ||||||||||||||||||||||||||||
| 51 | # Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||||||||||||||||||||||||||||