New upstream version 1.21
Utkarsh Gupta
4 years ago
0 | 0 | Revision history for Perl extension Net::Frame. |
1 | ||
2 | 1.21 Thu 23 May 07:54:16 CEST 2019 | |
3 | - update: copyright notice | |
4 | ||
5 | 1.20 Wed 22 May 11:15:40 CEST 2019 | |
6 | - bugfix: tests for IPv4 & IPv6 DNS resolutions | |
7 | => https://rt.cpan.org/Ticket/Display.html?id=129409 | |
1 | 8 | |
2 | 9 | 1.19 Thu 17 May 13:59:33 CEST 2018 |
3 | 10 | - bugfix: test 13 when DNS getHostIpv6Addr() returns an IPv4 mapped to an IPv6 address |
31 | 31 | "provides" : { |
32 | 32 | "Net::Frame" : { |
33 | 33 | "file" : "lib/Net/Frame.pm", |
34 | "version" : "1.19" | |
34 | "version" : "1.21" | |
35 | 35 | }, |
36 | 36 | "Net::Frame::Layer" : { |
37 | 37 | "file" : "lib/Net/Frame/Layer.pm" |
70 | 70 | "http://www.perlfoundation.org/artistic_license_1_0" |
71 | 71 | ] |
72 | 72 | }, |
73 | "version" : "1.19", | |
73 | "version" : "1.21", | |
74 | 74 | "x_serialization_backend" : "JSON::PP version 2.27400_02" |
75 | 75 | } |
14 | 14 | provides: |
15 | 15 | Net::Frame: |
16 | 16 | file: lib/Net/Frame.pm |
17 | version: '1.19' | |
17 | version: '1.21' | |
18 | 18 | Net::Frame::Layer: |
19 | 19 | file: lib/Net/Frame/Layer.pm |
20 | 20 | Net::Frame::Layer::ARP: |
43 | 43 | perl: v5.6.1 |
44 | 44 | resources: |
45 | 45 | license: http://www.perlfoundation.org/artistic_license_1_0 |
46 | version: '1.19' | |
46 | version: '1.21' | |
47 | 47 | x_serialization_backend: 'CPAN::Meta::YAML version 0.018' |
31 | 31 | You may distribute this module under the terms of the Artistic license. |
32 | 32 | See LICENSE.Artistic file in the source distribution archive. |
33 | 33 | |
34 | Copyright (c) 2006-2018, Patrice <GomoR> Auffret | |
34 | Copyright (c) 2006-2019, Patrice <GomoR> Auffret | |
35 | 35 |
0 | 0 | # |
1 | # $Id: ARP.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: ARP.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::ARP; |
4 | 4 | use strict; |
375 | 375 | |
376 | 376 | =head1 COPYRIGHT AND LICENSE |
377 | 377 | |
378 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
378 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
379 | 379 | |
380 | 380 | You may distribute this module under the terms of the Artistic license. |
381 | 381 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: ETH.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: ETH.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::ETH; |
4 | 4 | use strict; |
404 | 404 | |
405 | 405 | =head1 COPYRIGHT AND LICENSE |
406 | 406 | |
407 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
407 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
408 | 408 | |
409 | 409 | You may distribute this module under the terms of the Artistic license. |
410 | 410 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: IPv4.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: IPv4.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::IPv4; |
4 | 4 | use strict; |
588 | 588 | |
589 | 589 | =head1 COPYRIGHT AND LICENSE |
590 | 590 | |
591 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
591 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
592 | 592 | |
593 | 593 | You may distribute this module under the terms of the Artistic license. |
594 | 594 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: NULL.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: NULL.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::NULL; |
4 | 4 | use strict; |
286 | 286 | |
287 | 287 | =head1 COPYRIGHT AND LICENSE |
288 | 288 | |
289 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
289 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
290 | 290 | |
291 | 291 | You may distribute this module under the terms of the Artistic license. |
292 | 292 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: PPP.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: PPP.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::PPP; |
4 | 4 | use strict; |
231 | 231 | |
232 | 232 | =head1 COPYRIGHT AND LICENSE |
233 | 233 | |
234 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
234 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
235 | 235 | |
236 | 236 | You may distribute this module under the terms of the Artistic license. |
237 | 237 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: RAW.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: RAW.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::RAW; |
4 | 4 | use strict; |
157 | 157 | |
158 | 158 | =head1 COPYRIGHT AND LICENSE |
159 | 159 | |
160 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
160 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
161 | 161 | |
162 | 162 | You may distribute this module under the terms of the Artistic license. |
163 | 163 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: SLL.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: SLL.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::SLL; |
4 | 4 | use strict; |
384 | 384 | |
385 | 385 | =head1 COPYRIGHT AND LICENSE |
386 | 386 | |
387 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
387 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
388 | 388 | |
389 | 389 | You may distribute this module under the terms of the Artistic license. |
390 | 390 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: TCP.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: TCP.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::TCP; |
4 | 4 | use strict; use warnings; |
461 | 461 | |
462 | 462 | =head1 COPYRIGHT AND LICENSE |
463 | 463 | |
464 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
464 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
465 | 465 | |
466 | 466 | You may distribute this module under the terms of the Artistic license. |
467 | 467 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: UDP.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: UDP.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer::UDP; |
4 | 4 | use strict; |
329 | 329 | |
330 | 330 | =head1 COPYRIGHT AND LICENSE |
331 | 331 | |
332 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
332 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
333 | 333 | |
334 | 334 | You may distribute this module under the terms of the Artistic license. |
335 | 335 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: Layer.pm,v 7609c9d085d3 2018/03/15 15:17:19 gomor $ | |
1 | # $Id: Layer.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame::Layer; |
4 | 4 | use strict; |
503 | 503 | |
504 | 504 | =head1 COPYRIGHT AND LICENSE |
505 | 505 | |
506 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
506 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
507 | 507 | |
508 | 508 | You may distribute this module under the terms of the Artistic license. |
509 | 509 | See LICENSE.Artistic file in the source distribution archive. |
0 | 0 | # |
1 | # $Id: Frame.pm,v e0c446e27ca9 2018/05/17 11:59:58 gomor $ | |
1 | # $Id: Frame.pm,v ce68fbcc7f6d 2019/05/23 05:58:40 gomor $ | |
2 | 2 | # |
3 | 3 | package Net::Frame; |
4 | 4 | use strict; |
5 | 5 | use warnings; |
6 | 6 | |
7 | our $VERSION = '1.19'; | |
7 | our $VERSION = '1.21'; | |
8 | 8 | |
9 | 9 | 1; |
10 | 10 | |
83 | 83 | |
84 | 84 | =head1 COPYRIGHT AND LICENSE |
85 | 85 | |
86 | Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret | |
86 | Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret | |
87 | 87 | |
88 | 88 | You may distribute this module under the terms of the Artistic license. |
89 | 89 | See LICENSE.Artistic file in the source distribution archive. |
2 | 2 | |
3 | 3 | use Net::Frame::Layer qw(:consts :subs); |
4 | 4 | |
5 | my $host = 'gomor.org'; | |
6 | my $ip6 = '2001:41d0:2:1a47::2'; | |
7 | my $ip6v4mapping = '::ffff:94.23.25.71'; | |
8 | my $ip4 = '94.23.25.71'; | |
5 | my $host = 'google.com'; | |
6 | my $ip6 = qr{^[a-f0-9:]+$}; | |
7 | my $ip6v4mapping = qr{^::ffff:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$}; | |
8 | my $ip4 = qr{^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$}; | |
9 | 9 | |
10 | 10 | # |
11 | 11 | # IPv4 functions |
13 | 13 | ok( |
14 | 14 | sub { |
15 | 15 | my $ip = getHostIpv4Addr($host); |
16 | if ($ip eq $ip4) { | |
16 | if ($ip =~ $ip4) { | |
17 | 17 | print "[+] $ip\n"; |
18 | 18 | return 1; # OK |
19 | 19 | } |
20 | print "[-] $ip\n"; | |
20 | printf(STDERR "[-] 1: $ip\n"); | |
21 | 21 | return 0; # NOK |
22 | 22 | }, |
23 | 23 | 1, |
31 | 31 | print "[+] ".unpack('H*', $a)."\n"; |
32 | 32 | return 1; # OK |
33 | 33 | } |
34 | print "[-] ".unpack('H*', $a)."\n"; | |
34 | printf(STDERR "[-] 2: ".unpack('H*', $a)."\n"); | |
35 | 35 | return 0; # NOK |
36 | 36 | }, |
37 | 37 | 1, |
45 | 45 | print "[+] $a\n"; |
46 | 46 | return 1; # OK |
47 | 47 | } |
48 | print "[-] $a\n"; | |
48 | printf(STDERR "[-] 3: $a\n"); | |
49 | 49 | return 0; # NOK |
50 | 50 | }, |
51 | 51 | 1, |
58 | 58 | ok( |
59 | 59 | sub { |
60 | 60 | my $ip = getHostIpv6Addr($host); |
61 | if ($ip eq $ip6 || $ip eq $ip6v4mapping) { | |
61 | if ($ip =~ $ip6 || $ip =~ $ip6v4mapping) { | |
62 | 62 | print "[+] $ip\n"; |
63 | 63 | return 1; # OK |
64 | 64 | } |
65 | print "[-] $ip\n"; | |
65 | printf(STDERR "[-] 4: $ip\n"); | |
66 | 66 | return 0; # NOK |
67 | 67 | }, |
68 | 68 | 1, |
71 | 71 | |
72 | 72 | ok( |
73 | 73 | sub { |
74 | my $a = inet6Aton($ip6); | |
75 | if ($a && unpack('H*', $a) eq '200141d000021a470000000000000002') { | |
74 | my $a = inet6Aton('::1'); | |
75 | if ($a && unpack('H*', $a) eq '00000000000000000000000000000001') { | |
76 | 76 | print "[+] ".unpack('H*', $a)."\n"; |
77 | 77 | return 1; # OK |
78 | 78 | } |
79 | print "[-] ".unpack('H*', $a)."\n"; | |
79 | printf(STDERR "[-] 5: ".unpack('H*', $a)."\n"); | |
80 | 80 | return 0; # NOK |
81 | 81 | }, |
82 | 82 | 1, |
85 | 85 | |
86 | 86 | ok( |
87 | 87 | sub { |
88 | my $a = inet6Ntoa(pack('H*', '200141d000021a470000000000000002')); | |
89 | if ($a && $a eq $ip6) { | |
88 | my $a = inet6Ntoa(pack('H*', '00000000000000000000000000000001')); | |
89 | if ($a && $a =~ $ip6) { | |
90 | 90 | print "[+] $a\n"; |
91 | 91 | return 1; # OK |
92 | 92 | } |
93 | print "[-] $a\n"; | |
93 | printf(STDERR "[-] 6: $a\n"); | |
94 | 94 | return 0; # NOK |
95 | 95 | }, |
96 | 96 | 1, |