| 1 | package Net::DNS::RR::EUI64; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | our $VERSION = (qw$Id: EUI64.pm 2003 2025-01-21 12:06:06Z willem $)[2]; | |||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use base qw(Net::DNS::RR); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | Net::DNS::RR::EUI64 - DNS EUI64 resource record | ||||||||||
| 13 | |||||||||||
| 14 | =cut | ||||||||||
| 15 | |||||||||||
| 16 | 1 | ▶ | use integer; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | 1 | ▶ | sub _decode_rdata { ## decode rdata from wire-format octet string | ||||||||
|
Subroutine
_decode_rdata: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 1 | my ( $self, $data, $offset ) = @_; | |||||||||
| 21 | |||||||||||
| 22 | 1 | $self->{address} = unpack "\@$offset a8", $$data; | |||||||||
| 23 | 1 | return; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | 5 | ▶ | sub _encode_rdata { ## encode rdata as wire-format octet string | ||||||||
|
Subroutine
_encode_rdata: called CC=1 SCAR=0.0
| |||||||||||
| 28 | 5 | my $self = shift; | |||||||||
| 29 | |||||||||||
| 30 | 5 | return pack 'a8', $self->{address}; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | 2 | ▶ | sub _format_rdata { ## format rdata portion of RR string. | ||||||||
|
Subroutine
_format_rdata: called CC=1 SCAR=0.0
| |||||||||||
| 35 | 2 | my $self = shift; | |||||||||
| 36 | |||||||||||
| 37 | 2 | return $self->address; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | |||||||||||
| 41 | 1 | ▶ | sub _parse_rdata { ## populate RR from rdata in argument list | ||||||||
|
Subroutine
_parse_rdata: called CC=1 SCAR=0.0
| |||||||||||
| 42 | 1 | my ( $self, @argument ) = @_; | |||||||||
| 43 | |||||||||||
| 44 | 1 | $self->address(@argument); | |||||||||
| 45 | 1 | return; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | |||||||||||
| 49 | 5 | ▶ | sub address { | ||||||||
|
Subroutine
address: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 50 | 5 | my ( $self, $address ) = @_; | |||||||||
| 51 | 5 | ▶ | $self->{address} = pack 'C8', map { hex($_) } split /[:-]/, $address if $address; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | 5 | ▶ | return defined(wantarray) ? join '-', unpack( 'H2H2H2H2H2H2H2H2', $self->{address} ) : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | 1 | 1; | |||||||||
| 57 | __END__ | ||||||||||