| 1 | #!/usr/local/bin/perl | ||||||||||||
| 2 | # | ||||||||||||
| 3 | 2 | our $VERSION = '0.2'; | |||||||||||
| 4 | |||||||||||||
| 5 | =head1 NAME | ||||||||||||
| 6 | |||||||||||||
| 7 | RRTYPEgen - Generate Net::DNS RR subtype packages | ||||||||||||
| 8 | |||||||||||||
| 9 | =head1 SYNOPSIS | ||||||||||||
| 10 | |||||||||||||
| 11 | RRTYPEgen RRTYPE=<version> <name>:<number <attribute> ... | ||||||||||||
| 12 | |||||||||||||
| 13 | =head1 DESCRIPTION | ||||||||||||
| 14 | |||||||||||||
| 15 | B<RRTYPEgen> builds a perl Net::DNS RR subtype implementation package | ||||||||||||
| 16 | from the DNS extension language specification using the code generator | ||||||||||||
| 17 | in Net::DNS::Extlang. It prints the generated code to stdout. | ||||||||||||
| 18 | |||||||||||||
| 19 | =cut | ||||||||||||
| 20 | |||||||||||||
| 21 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 23 | 2 | ▶ | use integer; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 24 | |||||||||||||
| 25 | 2 | ▶ | use Net::DNS::Extlang; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 26 | |||||||||||||
| 27 | |||||||||||||
| 28 | # see what we think of the arguments | ||||||||||||
| 29 | 2 | my ( $tag, $identity, @attribute ) = @ARGV; | |||||||||||
| 30 | |||||||||||||
| 31 | 2 | ▶ | exit unless defined $tag; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | |||||||||||||
| 33 | 1 | ▶ | die "$0: Invalid DNSextlang RRTYPE specification" unless $tag =~ /^RRTYPE=\d+$/; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 34 | |||||||||||||
| 35 | 1 | my $ext = new Net::DNS::Extlang(); | |||||||||||
| 36 | |||||||||||||
| 37 | 1 | my $rrr = $ext->xlstorerecord( $identity, @attribute ); | |||||||||||
| 38 | |||||||||||||
| 39 | 1 | ▶ | print( $ext->compilerr($rrr) || exit 1 ); # write package to STDOUT | ||||||||||
|
Condition50%1/2
$ext->compilerr($rrr) || exit 1
MC/DC0%0/1
$ext->compilerr($rrr) || exit 1
$ext->compilerr($rrr)
Truth table50%1/2
A
A= $ext->compilerr($rrr)
| |||||||||||||
| 40 | |||||||||||||
| 41 | 1 | exit; | |||||||||||
| 42 | |||||||||||||
| 43 | |||||||||||||
| 44 | =head1 COPYRIGHT | ||||||||||||
| 45 | |||||||||||||
| 46 | Copyright 2017 John R. Levine. | ||||||||||||
| 47 | |||||||||||||
| 48 | =head1 LICENSE | ||||||||||||
| 49 | |||||||||||||
| 50 | Permission to use, copy, modify, and distribute this software and its | ||||||||||||
| 51 | documentation for any purpose and without fee is hereby granted, provided | ||||||||||||
| 52 | that the above copyright notice appear in all copies and that both that | ||||||||||||
| 53 | copyright notice and this permission notice appear in supporting | ||||||||||||
| 54 | documentation, and that the name of the author not be used in advertising | ||||||||||||
| 55 | or publicity pertaining to distribution of the software without specific | ||||||||||||
| 56 | prior written permission. | ||||||||||||
| 57 | |||||||||||||
| 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||||||||||
| 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||||||||||
| 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||||||||||||
| 61 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||||||||||
| 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||||||||||||
| 63 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||||||||||
| 64 | DEALINGS IN THE SOFTWARE. | ||||||||||||
| 65 | |||||||||||||
| 66 | |||||||||||||
| 67 | =head1 SEE ALSO | ||||||||||||
| 68 | |||||||||||||
| 69 | L<perl>, L<Net::DNS:RR>, L<Net::DNS::Parameters>, L<Net::DNS::Extlang> | ||||||||||||
| 70 | |||||||||||||
| 71 | =cut | ||||||||||||