• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

恥ずかしい勘違いから生まれた、DHCP6の不要かつ部分的な実装


Commit MetaInfo

Revisionca2acefbd41244bc0bab4bb1ea4322f5f4cc355e (tree)
Time2021-08-12 19:56:59
Authordyknon <dyknon@user...>
Commiterdyknon

Log Message

new abstruct option: Ipv6AddrList

Change Summary

Incremental Difference

--- /dev/null
+++ b/Net/DHCP6/AbstractOption/Ipv6AddrList.pm
@@ -0,0 +1,34 @@
1+package Net::DHCP6::AbstractOption::Ipv6AddrList;
2+
3+use strict;
4+use warnings;
5+use Net::DHCP6::AbstractOption::Vector;
6+use Net::DHCP6::Value::Ipv6Addr;
7+
8+our $VERSION = "0.0.1";
9+our @ISA = qw/Net::DHCP6::AbstractOption::Vector/;
10+
11+use constant len_elem => 16;
12+
13+sub serialize_elem {
14+ my $class_or_self = shift;
15+ shift->raw;
16+}
17+
18+sub parse_elem {
19+ my $class_or_self = shift;
20+ Net::DHCP6::Value::Ipv6Addr->from_bytes(shift);
21+}
22+
23+sub coerce {
24+ my $class_or_self = shift;
25+ Net::DHCP6::Value::Ipv6Addr->new(shift);
26+}
27+
28+sub stringify_elem {
29+ my $class_or_self = shift;
30+ my $elem = shift;
31+ "$elem";
32+}
33+
34+1;
--- a/Net/DHCP6/Option/DnsServer.pm
+++ b/Net/DHCP6/Option/DnsServer.pm
@@ -3,37 +3,14 @@ package Net::DHCP6::Option::DnsServer;
33
44 use strict;
55 use warnings;
6-use Net::DHCP6::AbstractOption::Vector;
6+use Net::DHCP6::AbstractOption::Ipv6AddrList;
77 use Net::DHCP6::Parameters qw/DHCP6_OPT_DNS_SERVERS/;
8-use Net::DHCP6::Value::Ipv6Addr;
98
109 our $VERSION = "0.0.1";
11-our @ISA = qw/Net::DHCP6::AbstractOption::Vector/;
10+our @ISA = qw/Net::DHCP6::AbstractOption::Ipv6AddrList/;
1211
1312 use constant code => DHCP6_OPT_DNS_SERVERS;
1413 use constant name => "DnsServer";
15-use constant len_elem => 16;
16-
17-sub serialize_elem {
18- my $class_or_self = shift;
19- shift->raw;
20-}
21-
22-sub parse_elem {
23- my $class_or_self = shift;
24- Net::DHCP6::Value::Ipv6Addr->from_bytes(shift);
25-}
26-
27-sub coerce {
28- my $class_or_self = shift;
29- Net::DHCP6::Value::Ipv6Addr->new(shift);
30-}
31-
32-sub stringify_elem {
33- my $class_or_self = shift;
34- my $elem = shift;
35- "$elem";
36-}
3714
3815 __PACKAGE__->register_option;
3916 1;