File Coverage

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