| 1 | package Net::Cisco::ObjectGroup::Service; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use base qw(Net::Cisco::ObjectGroup::Base); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings FATAL => qw(all); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | sub _init { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 5 | my $arg_ref = shift; | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | croak 'missing parameter "protocol" when creating service group' | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | ▶ | if !defined $arg_ref->{protocol}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | croak "unrecognized protocol type: '$arg_ref->{protocol}'" | ||||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | ▶ | if $arg_ref->{protocol} !~ m/^(?:tcp|udp|tcp-udp)$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 3 | $self->set_name( $self->get_name ." $arg_ref->{protocol}" ); | |||||||||||||||||||||||||||||||||||||||||
| 20 | 3 | $self->SUPER::_init( $arg_ref ); | |||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 3 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 8 | ▶ | sub push { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
push: called CC=20 SCAR=30.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 8 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 8 | my $arg_ref = shift; | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | croak 'must specify either group-object or service definition' | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 8 | ▶ | if !defined $arg_ref->{group_object} and !defined $arg_ref->{svc}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $arg_ref->{"group_object"} or defined $arg_ref->{"svc"}
MC/DC100%2/2
defined $arg_ref->{"group_object"} or defined $arg_ref->{"svc"}
defined $arg_ref->{"group_object"}
defined $arg_ref->{"svc"}
Truth table100%3/3
A or B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"svc"}
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | croak 'cannot specify both group-object and service definition' | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 7 | ▶ | if defined $arg_ref->{group_object} and defined $arg_ref->{svc}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $arg_ref->{"group_object"} and defined $arg_ref->{"svc"}
MC/DC100%2/2
defined $arg_ref->{"group_object"} and defined $arg_ref->{"svc"}
defined $arg_ref->{"group_object"}
defined $arg_ref->{"svc"}
Truth table100%3/3
A and B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"svc"}
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | croak 'missing service operator' | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 6 | ▶ | if defined $arg_ref->{svc} and !defined $arg_ref->{svc_op}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $arg_ref->{"svc"} and not defined $arg_ref->{"svc_op"}
MC/DC100%2/2
defined $arg_ref->{"svc"} and not defined $arg_ref->{"svc_op"}
defined $arg_ref->{"svc"}
not defined $arg_ref->{"svc_op"}
Truth table100%3/3
A and not(B)
A= defined $arg_ref->{"svc"}B= not defined $arg_ref->{"svc_op"}
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | croak "unrecognized service operator: '$arg_ref->{svc_op}'" | ||||||||||||||||||||||||||||||||||||||||||
| 39 | if defined $arg_ref->{svc_op} | ||||||||||||||||||||||||||||||||||||||||||
| 40 | 5 | ▶ | and $arg_ref->{svc_op} !~ m/^(?:eq|range)$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $arg_ref->{"svc_op"} and not $arg_ref->{"svc_op"} =~ /^(?:eq|range)$/
MC/DC100%2/2
defined $arg_ref->{"svc_op"} and not $arg_ref->{"svc_op"} =~ /^(?:eq|range)$/
defined $arg_ref->{"svc_op"}
not $arg_ref->{"svc_op"} =~ /^(?:eq|range)$/
Truth table100%3/3
A and not(B)
A= defined $arg_ref->{"svc_op"}B= not $arg_ref->{"svc_op"} =~ /^(?:eq|range)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | croak 'bad group-object' | ||||||||||||||||||||||||||||||||||||||||||
| 43 | if defined $arg_ref->{group_object} | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 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__)
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 3 | ▶ | if (defined $arg_ref->{svc} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
defined $arg_ref->{"svc"} and defined __PACKAGE__->__dict and exists __PACKAGE__->__dict->{$arg_ref->{"svc"}}
defined $arg_ref->{"svc"} and defined __PACKAGE__->__dict
MC/DC66%2/3
defined $arg_ref->{"svc"} and defined __PACKAGE__->__dict and exists __PACKAGE__->__dict->{$arg_ref->{"svc"}}
defined $arg_ref->{"svc"}
defined __PACKAGE__->__dict
exists __PACKAGE__->__dict->{$arg_ref->{"svc"}}
Truth table75%3/4
A and B and C
A= defined $arg_ref->{"svc"}B= defined __PACKAGE__->__dictC= exists __PACKAGE__->__dict->{$arg_ref->{"svc"}}
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | and defined __PACKAGE__->__dict | ||||||||||||||||||||||||||||||||||||||||||
| 49 | and exists __PACKAGE__->__dict->{$arg_ref->{svc}}) { | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | $arg_ref->{svc} = __PACKAGE__->__dict->{$arg_ref->{svc}}; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 3 | ▶ | if (defined $arg_ref->{svc_hi} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
defined $arg_ref->{"svc_hi"} and defined __PACKAGE__->__dict and exists __PACKAGE__->__dict->{$arg_ref->{"svc_hi"}}
defined $arg_ref->{"svc_hi"} and defined __PACKAGE__->__dict
MC/DC0%0/3
defined $arg_ref->{"svc_hi"} and defined __PACKAGE__->__dict and exists __PACKAGE__->__dict->{$arg_ref->{"svc_hi"}}
defined $arg_ref->{"svc_hi"}
defined __PACKAGE__->__dict
exists __PACKAGE__->__dict->{$arg_ref->{"svc_hi"}}
Truth table50%2/4
A and B and C
A= defined $arg_ref->{"svc_hi"}B= defined __PACKAGE__->__dictC= exists __PACKAGE__->__dict->{$arg_ref->{"svc_hi"}}
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | and defined __PACKAGE__->__dict | ||||||||||||||||||||||||||||||||||||||||||
| 56 | and exists __PACKAGE__->__dict->{$arg_ref->{svc_hi}}) { | ||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | $arg_ref->{svc_hi} = __PACKAGE__->__dict->{$arg_ref->{svc_hi}}; | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | my $line = defined $arg_ref->{group_object} | ||||||||||||||||||||||||||||||||||||||||||
| 62 | ? 'group-object '. $arg_ref->{group_object}->get_name | ||||||||||||||||||||||||||||||||||||||||||
| 63 | : defined $arg_ref->{svc_hi} | ||||||||||||||||||||||||||||||||||||||||||
| 64 | 3 | ▶ | ? "port-object $arg_ref->{svc_op} $arg_ref->{svc} $arg_ref->{svc_hi}" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | : "port-object $arg_ref->{svc_op} $arg_ref->{svc}"; | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | 3 | ▶ | $line =~ s/ \S+$// if defined $arg_ref->{group_object}; # chop off proto | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | 3 | push @{$self->get_objs}, $line; | |||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 3 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | # Copyright (c) The University of Oxford 2006. All Rights Reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 77 | # | ||||||||||||||||||||||||||||||||||||||||||
| 78 | # This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||||||||||||||||
| 79 | # under the terms of version 2 of the GNU General Public License as published | ||||||||||||||||||||||||||||||||||||||||||
| 80 | # by the Free Software Foundation. | ||||||||||||||||||||||||||||||||||||||||||
| 81 | # | ||||||||||||||||||||||||||||||||||||||||||
| 82 | # This program is distributed in the hope that it will be useful, but WITHOUT | ||||||||||||||||||||||||||||||||||||||||||
| 83 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||||||||||||||||||||||||||||||||||||||||
| 84 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||||||||||||||||||||||||||||||||||||||||||
| 85 | # more details. | ||||||||||||||||||||||||||||||||||||||||||
| 86 | # | ||||||||||||||||||||||||||||||||||||||||||
| 87 | # You should have received a copy of the GNU General Public License along with | ||||||||||||||||||||||||||||||||||||||||||
| 88 | # this program; if not, write to the Free Software Foundation, Inc., 51 | ||||||||||||||||||||||||||||||||||||||||||
| 89 | # Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | __DATA__ | ||||||||||||||||||||||||||||||||||||||||||