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