| 1 | package Farly::ASA::ICMPFormatter; | ||
| 2 | |||
| 3 | 10 | ▶ | use 5.008008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 10 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 10 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 10 | our $VERSION = '0.26'; | |
| 8 | |||
| 9 | 10 | our $String_To_Int = { | |
| 10 | "echo-reply" => 0, | ||
| 11 | "unreachable" => 3, | ||
| 12 | "source-quench" => 4, | ||
| 13 | "redirect" => 5, | ||
| 14 | "alternate-address" => 6, | ||
| 15 | "echo" => 8, | ||
| 16 | "router-advertisement" => 9, | ||
| 17 | "router-solicitation" => 10, | ||
| 18 | "time-exceeded" => 11, | ||
| 19 | "parameter-problem" => 12, | ||
| 20 | "timestamp-request" => 13, | ||
| 21 | "timestamp-reply" => 14, | ||
| 22 | "information-request" => 15, | ||
| 23 | "information-reply" => 16, | ||
| 24 | "mask-request" => 17, | ||
| 25 | "mask-reply" => 18, | ||
| 26 | "traceroute" => 30, | ||
| 27 | "conversion-error" => 31, | ||
| 28 | "mobile-redirect" => 32, | ||
| 29 | }; | ||
| 30 | |||
| 31 | 10 | our $Int_To_String = { reverse %$String_To_Int }; | |
| 32 | |||
| 33 | 9 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 34 | 9 | return bless {}, $_[0]; | |
| 35 | } | ||
| 36 | |||
| 37 | 3 | ▶ | sub as_string { |
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||
| 38 | 3 | return $Int_To_String->{ $_[1] }; | |
| 39 | } | ||
| 40 | |||
| 41 | 41 | ▶ | sub as_integer { |
|
Subroutine
as_integer: called CC=1 SCAR=0.0
Pod
documented
| |||
| 42 | 41 | return $String_To_Int->{ $_[1] }; | |
| 43 | } | ||
| 44 | |||
| 45 | 10 | 1; | |
| 46 | __END__ | ||