| 1 | #!/bin/false | ||
| 2 | # ABSTRACT: Subscriber ID option (code 38) -- opaque subscriber identification | ||
| 3 | # PODNAME: Net::DHCPv6::Option::SubscriberId | ||
| 4 | use strictures 2; | ||
| 5 | |||
| 6 | package Net::DHCPv6::Option::SubscriberId; | ||
| 7 | $Net::DHCPv6::Option::SubscriberId::VERSION = '0.002'; | ||
| 8 | use Net::DHCPv6::OptionList; | ||
| 9 | use Net::DHCPv6::Constants; | ||
| 10 | use parent 'Net::DHCPv6::Option'; | ||
| 11 | use namespace::clean; | ||
| 12 | my $EMPTY = q(); | ||
| 13 | |||
| 14 | sub new { | ||
| 15 | my ( $class, %args ) = @_; | ||
| 16 | my $subscriber_id = $args{subscriber_id} // $EMPTY; | ||
| 17 | $args{code} = $OPTION_SUBSCRIBER_ID; | ||
| 18 | $args{data} = $subscriber_id; | ||
| 19 | my $self = $class->SUPER::new( %args ); | ||
| 20 | $self->{subscriber_id} = $subscriber_id; | ||
| 21 | return bless $self, $class; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub subscriber_id { return shift->{subscriber_id} } | ||
| 25 | |||
| 26 | sub from_bytes_inner { | ||
| 27 | my ( $class, $code, $payload ) = @_; | ||
| 28 | return $class->new( subscriber_id => $payload ); | ||
| 29 | } | ||
| 30 | |||
| 31 | $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_SUBSCRIBER_ID} = __PACKAGE__; | ||
| 32 | 1; | ||
| 33 | |||
| 34 | __END__ |