File Coverage

blib/lib/STIX/Observable/Extension/ICMP.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod n/a
total 39 39 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::Extension::ICMP;
2              
3 24     24   576 use 5.010001;
  24         113  
4 24     24   175 use strict;
  24         56  
  24         767  
5 24     24   132 use warnings;
  24         78  
  24         1364  
6 24     24   157 use utf8;
  24         54  
  24         196  
7              
8 24     24   13490 use STIX::Common::Hex;
  24         98  
  24         1187  
9 24     24   206 use Types::Standard qw(Str InstanceOf);
  24         57  
  24         312  
10              
11 24     24   48772 use Moo;
  24         68  
  24         148  
12 24     24   10610 use namespace::autoclean;
  24         89  
  24         328  
13              
14             extends 'STIX::Object';
15              
16 24         2473 use constant PROPERTIES => (qw[
17             icmp_type_hex
18             icmp_code_hex
19 24     24   3677 ]);
  24         82  
20              
21 24     24   176 use constant EXTENSION_TYPE => 'icmp-ext';
  24         55  
  24         6690  
22              
23             has icmp_type_hex => (
24             is => 'rw',
25             required => 1,
26             isa => InstanceOf ['STIX::Common::Hex'],
27             coerce => sub { ref($_[0]) ? $_[0] : STIX::Common::Hex->new($_[0]) }
28             );
29              
30             has icmp_code_hex => (
31             is => 'rw',
32             required => 1,
33             isa => InstanceOf ['STIX::Common::Hex'],
34             coerce => sub { ref($_[0]) ? $_[0] : STIX::Common::Hex->new($_[0]) }
35             );
36              
37             1;
38              
39             =encoding utf-8
40              
41             =head1 NAME
42              
43             STIX::Observable::Extension::ICMP - STIX Cyber-observable Object (SCO) - ICMP Extension
44              
45             =head1 SYNOPSIS
46              
47             use STIX::Observable::Extension::ICMP;
48              
49             my $icmp_ext = STIX::Observable::Extension::ICMP->new();
50              
51              
52             =head1 DESCRIPTION
53              
54             The ICMP extension specifies a default extension for capturing network traffic
55             properties specific to ICMP.
56              
57              
58             =head2 METHODS
59              
60             L inherits all methods from L
61             and implements the following new ones.
62              
63             =over
64              
65             =item STIX::Observable::Extension::ICMP->new(%properties)
66              
67             Create a new instance of L.
68              
69             =item $icmp_ext->icmp_type_hex
70              
71             Specifies the ICMP type byte.
72              
73             =item $icmp_ext->icmp_code_hex
74              
75             Specifies the ICMP code byte.
76              
77             =back
78              
79              
80             =head2 HELPERS
81              
82             =over
83              
84             =item $icmp_ext->TO_JSON
85              
86             Helper for JSON encoders.
87              
88             =item $icmp_ext->to_hash
89              
90             Return the object HASH.
91              
92             =item $icmp_ext->to_string
93              
94             Encode the object in JSON.
95              
96             =item $icmp_ext->validate
97              
98             Validate the object using JSON Schema (see L).
99              
100             =back
101              
102              
103             =head1 SUPPORT
104              
105             =head2 Bugs / Feature Requests
106              
107             Please report any bugs or feature requests through the issue tracker
108             at L.
109             You will be notified automatically of any progress on your issue.
110              
111             =head2 Source Code
112              
113             This is open source software. The code repository is available for
114             public review and contribution under the terms of the license.
115              
116             L
117              
118             git clone https://github.com/giterlizzi/perl-STIX.git
119              
120              
121             =head1 AUTHOR
122              
123             =over 4
124              
125             =item * Giuseppe Di Terlizzi
126              
127             =back
128              
129              
130             =head1 LICENSE AND COPYRIGHT
131              
132             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
133              
134             This is free software; you can redistribute it and/or modify it under
135             the same terms as the Perl 5 programming language system itself.
136              
137             =cut