| 1 | #!/usr/bin/false | ||
| 2 | # ABSTRACT: Rapid Commit option (code 14) — zero-length data | ||
| 3 | # PODNAME: Net::DHCPv6::Option::RapidCommit | ||
| 4 | package Net::DHCPv6::Option::RapidCommit; | ||
| 5 | $Net::DHCPv6::Option::RapidCommit::VERSION = '0.001'; | ||
| 6 | use strictures 2; | ||
| 7 | use Carp qw(croak); | ||
| 8 | use Net::DHCPv6::Constants; | ||
| 9 | use Net::DHCPv6::X::BadOption; | ||
| 10 | use parent 'Net::DHCPv6::Option'; | ||
| 11 | use namespace::clean; | ||
| 12 | |||
| 13 | sub new { | ||
| 14 | my ( $class, %args ) = @_; | ||
| 15 | $args{code} = $OPTION_RAPID_COMMIT; | ||
| 16 | my $self = $class->SUPER::new( code => $args{code} ); | ||
| 17 | bless $self, $class; | ||
| 18 | } | ||
| 19 | |||
| 20 | sub from_bytes_inner { | ||
| 21 | my ( $class, $code, $data ) = @_; | ||
| 22 | Net::DHCPv6::X::BadOption->throw( message => 'RapidCommit option must be empty' ) | ||
| 23 | if CORE::length( $data ) > 0; | ||
| 24 | return $class->new; | ||
| 25 | } | ||
| 26 | |||
| 27 | $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_RAPID_COMMIT} = __PACKAGE__; | ||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | __END__ |