Codebase list libnet-frame-perl / upstream/1.21
New upstream version 1.21 Utkarsh Gupta 4 years ago
16 changed file(s) with 51 addition(s) and 44 deletion(s). Raw diff Collapse all Expand all
00 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
18
29 1.19 Thu 17 May 13:59:33 CEST 2018
310 - bugfix: test 13 when DNS getHostIpv6Addr() returns an IPv4 mapped to an IPv6 address
3131 "provides" : {
3232 "Net::Frame" : {
3333 "file" : "lib/Net/Frame.pm",
34 "version" : "1.19"
34 "version" : "1.21"
3535 },
3636 "Net::Frame::Layer" : {
3737 "file" : "lib/Net/Frame/Layer.pm"
7070 "http://www.perlfoundation.org/artistic_license_1_0"
7171 ]
7272 },
73 "version" : "1.19",
73 "version" : "1.21",
7474 "x_serialization_backend" : "JSON::PP version 2.27400_02"
7575 }
1414 provides:
1515 Net::Frame:
1616 file: lib/Net/Frame.pm
17 version: '1.19'
17 version: '1.21'
1818 Net::Frame::Layer:
1919 file: lib/Net/Frame/Layer.pm
2020 Net::Frame::Layer::ARP:
4343 perl: v5.6.1
4444 resources:
4545 license: http://www.perlfoundation.org/artistic_license_1_0
46 version: '1.19'
46 version: '1.21'
4747 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
3131 You may distribute this module under the terms of the Artistic license.
3232 See LICENSE.Artistic file in the source distribution archive.
3333
34 Copyright (c) 2006-2018, Patrice <GomoR> Auffret
34 Copyright (c) 2006-2019, Patrice <GomoR> Auffret
3535
00 #
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 $
22 #
33 package Net::Frame::Layer::ARP;
44 use strict;
375375
376376 =head1 COPYRIGHT AND LICENSE
377377
378 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
378 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
379379
380380 You may distribute this module under the terms of the Artistic license.
381381 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::ETH;
44 use strict;
404404
405405 =head1 COPYRIGHT AND LICENSE
406406
407 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
407 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
408408
409409 You may distribute this module under the terms of the Artistic license.
410410 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::IPv4;
44 use strict;
588588
589589 =head1 COPYRIGHT AND LICENSE
590590
591 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
591 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
592592
593593 You may distribute this module under the terms of the Artistic license.
594594 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::NULL;
44 use strict;
286286
287287 =head1 COPYRIGHT AND LICENSE
288288
289 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
289 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
290290
291291 You may distribute this module under the terms of the Artistic license.
292292 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::PPP;
44 use strict;
231231
232232 =head1 COPYRIGHT AND LICENSE
233233
234 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
234 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
235235
236236 You may distribute this module under the terms of the Artistic license.
237237 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::RAW;
44 use strict;
157157
158158 =head1 COPYRIGHT AND LICENSE
159159
160 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
160 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
161161
162162 You may distribute this module under the terms of the Artistic license.
163163 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::SLL;
44 use strict;
384384
385385 =head1 COPYRIGHT AND LICENSE
386386
387 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
387 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
388388
389389 You may distribute this module under the terms of the Artistic license.
390390 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::TCP;
44 use strict; use warnings;
461461
462462 =head1 COPYRIGHT AND LICENSE
463463
464 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
464 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
465465
466466 You may distribute this module under the terms of the Artistic license.
467467 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer::UDP;
44 use strict;
329329
330330 =head1 COPYRIGHT AND LICENSE
331331
332 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
332 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
333333
334334 You may distribute this module under the terms of the Artistic license.
335335 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame::Layer;
44 use strict;
503503
504504 =head1 COPYRIGHT AND LICENSE
505505
506 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
506 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
507507
508508 You may distribute this module under the terms of the Artistic license.
509509 See LICENSE.Artistic file in the source distribution archive.
00 #
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 $
22 #
33 package Net::Frame;
44 use strict;
55 use warnings;
66
7 our $VERSION = '1.19';
7 our $VERSION = '1.21';
88
99 1;
1010
8383
8484 =head1 COPYRIGHT AND LICENSE
8585
86 Copyright (c) 2006-2018, Patrice E<lt>GomoRE<gt> Auffret
86 Copyright (c) 2006-2019, Patrice E<lt>GomoRE<gt> Auffret
8787
8888 You may distribute this module under the terms of the Artistic license.
8989 See LICENSE.Artistic file in the source distribution archive.
22
33 use Net::Frame::Layer qw(:consts :subs);
44
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}$};
99
1010 #
1111 # IPv4 functions
1313 ok(
1414 sub {
1515 my $ip = getHostIpv4Addr($host);
16 if ($ip eq $ip4) {
16 if ($ip =~ $ip4) {
1717 print "[+] $ip\n";
1818 return 1; # OK
1919 }
20 print "[-] $ip\n";
20 printf(STDERR "[-] 1: $ip\n");
2121 return 0; # NOK
2222 },
2323 1,
3131 print "[+] ".unpack('H*', $a)."\n";
3232 return 1; # OK
3333 }
34 print "[-] ".unpack('H*', $a)."\n";
34 printf(STDERR "[-] 2: ".unpack('H*', $a)."\n");
3535 return 0; # NOK
3636 },
3737 1,
4545 print "[+] $a\n";
4646 return 1; # OK
4747 }
48 print "[-] $a\n";
48 printf(STDERR "[-] 3: $a\n");
4949 return 0; # NOK
5050 },
5151 1,
5858 ok(
5959 sub {
6060 my $ip = getHostIpv6Addr($host);
61 if ($ip eq $ip6 || $ip eq $ip6v4mapping) {
61 if ($ip =~ $ip6 || $ip =~ $ip6v4mapping) {
6262 print "[+] $ip\n";
6363 return 1; # OK
6464 }
65 print "[-] $ip\n";
65 printf(STDERR "[-] 4: $ip\n");
6666 return 0; # NOK
6767 },
6868 1,
7171
7272 ok(
7373 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') {
7676 print "[+] ".unpack('H*', $a)."\n";
7777 return 1; # OK
7878 }
79 print "[-] ".unpack('H*', $a)."\n";
79 printf(STDERR "[-] 5: ".unpack('H*', $a)."\n");
8080 return 0; # NOK
8181 },
8282 1,
8585
8686 ok(
8787 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) {
9090 print "[+] $a\n";
9191 return 1; # OK
9292 }
93 print "[-] $a\n";
93 printf(STDERR "[-] 6: $a\n");
9494 return 0; # NOK
9595 },
9696 1,