File Coverage

blib/lib/STIX/Observable/IPv6Addr.pm
Criterion Covered Total %
statement 38 38 100.0
branch n/a
condition n/a
subroutine 13 13 100.0
pod n/a
total 51 51 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::IPv6Addr;
2              
3 24     24   569 use 5.010001;
  24         106  
4 24     24   151 use strict;
  24         52  
  24         640  
5 24     24   113 use warnings;
  24         46  
  24         1420  
6 24     24   142 use utf8;
  24         62  
  24         184  
7              
8 24     24   1170 use STIX::Common::List;
  24         51  
  24         1151  
9 24     24   137 use Types::Standard qw(Str InstanceOf);
  24         64  
  24         301  
10 24     24   77927 use Types::TypeTiny qw(ArrayLike);
  24         67  
  24         195  
11              
12 24     24   13620 use Moo;
  24         63  
  24         231  
13 24     24   10521 use namespace::autoclean;
  24         61  
  24         265  
14              
15             extends 'STIX::Observable';
16              
17 24         2574 use constant SCHEMA =>
18 24     24   2422 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/ipv6-addr.json';
  24         55  
19              
20 24         1728 use constant PROPERTIES => (
21             qw(type id),
22             qw(spec_version object_marking_refs granular_markings defanged extensions),
23             qw(value resolves_to_refs belongs_to_refs)
24 24     24   168 );
  24         73  
25              
26 24     24   146 use constant STIX_OBJECT => 'SCO';
  24         52  
  24         1249  
27 24     24   121 use constant STIX_OBJECT_TYPE => 'ipv6-addr';
  24         48  
  24         4765  
28              
29             has value => (is => 'rw', isa => Str, required => 1);
30              
31             has resolves_to_refs => (
32             is => 'rw',
33             isa => ArrayLike [InstanceOf ['STIX::Observable::MACAddr']],
34             default => sub { STIX::Common::List->new }
35             );
36              
37             has belongs_to_refs => (
38             is => 'rw',
39             isa => ArrayLike [InstanceOf ['STIX::Observable::AutonomousSystem']],
40             default => sub { STIX::Common::List->new }
41             );
42              
43             1;
44              
45             =encoding utf-8
46              
47             =head1 NAME
48              
49             STIX::Observable::IPv6Addr - STIX Cyber-observable Object (SCO) - IPv6 Address
50              
51             =head1 SYNOPSIS
52              
53             use STIX::Observable::IPv6Addr;
54              
55             my $ipv6_addr = STIX::Observable::IPv6Addr->new();
56              
57              
58             =head1 DESCRIPTION
59              
60             The IPv6 Address Object represents one or more IPv6 addresses expressed
61             using CIDR notation.
62              
63              
64             =head2 METHODS
65              
66             L inherits all methods from L
67             and implements the following new ones.
68              
69             =over
70              
71             =item STIX::Observable::IPv6Addr->new(%properties)
72              
73             Create a new instance of L.
74              
75             =item $ipv6_addr->belongs_to_refs
76              
77             Specifies a reference to one or more autonomous systems (AS) that the IPv6
78             address belongs to.
79              
80             =item $ipv6_addr->id
81              
82             =item $ipv6_addr->resolves_to_refs
83              
84             Specifies a list of references to one or more Layer 2 Media Access Control
85             (MAC) addresses that the IPv6 address resolves to.
86              
87             =item $ipv6_addr->type
88              
89             The value of this property MUST be C.
90              
91             =item $ipv6_addr->value
92              
93             Specifies one or more IPv6 addresses expressed using CIDR notation.
94              
95             =back
96              
97              
98             =head2 HELPERS
99              
100             =over
101              
102             =item $ipv6_addr->TO_JSON
103              
104             Encode the object in JSON.
105              
106             =item $ipv6_addr->to_hash
107              
108             Return the object HASH.
109              
110             =item $ipv6_addr->to_string
111              
112             Encode the object in JSON.
113              
114             =item $ipv6_addr->validate
115              
116             Validate the object using JSON Schema
117             (see L).
118              
119             =back
120              
121              
122             =head1 SUPPORT
123              
124             =head2 Bugs / Feature Requests
125              
126             Please report any bugs or feature requests through the issue tracker
127             at L.
128             You will be notified automatically of any progress on your issue.
129              
130             =head2 Source Code
131              
132             This is open source software. The code repository is available for
133             public review and contribution under the terms of the license.
134              
135             L
136              
137             git clone https://github.com/giterlizzi/perl-STIX.git
138              
139              
140             =head1 AUTHOR
141              
142             =over 4
143              
144             =item * Giuseppe Di Terlizzi
145              
146             =back
147              
148              
149             =head1 LICENSE AND COPYRIGHT
150              
151             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
152              
153             This is free software; you can redistribute it and/or modify it under
154             the same terms as the Perl 5 programming language system itself.
155              
156             =cut