in(3pm)
π NAME π
Net::RIPWhois::in β it's a Perl extension bestie, and its whole job is accessing inetnum objects from the RIPE whois database. That's it. That's the girl. π
β¨ SYNOPSIS β¨
okay so here's the vibe, copy-paste coded exactly like this:
use Net::RIPEWhois::in
$in = new Net::RIPEWhois::in;
@in = getIn($whois, $prefix, $ALLOCOPT);
$whois->closeWhois();
π¦ DESCRIPTION π¦
You're gonna go get inetnum objects from the RIPE whois server, and then validate them as an allocation object. That's the whole plot. π«Ά
π METHODS π
πΈ debug πΈ
Get the debug, or set the debug. Your choice, main character. π
$in->debug(1);
sets the debug.
$in->debug(undef);
turns off the $debug.
π error π
($errNo, $errMsg) = $in->error;
$in->(undef, undef, true);
^ that last one resets the error message.
So basically this gets you the last error no and error string. π
And heads up, if $whois->debug is set, then @{$in->{'errMsgAll'}} and @{$in->{'errNoAll'}} will have the list of all errors and error numbers. like, the whole receipts folder. π
β new β
$in = new Net::RIPEWhois::in
Creates a new inetnum object. Slay. β¨
It also cares about the ENV variables WHOISHOST and WHOISPORT β so set those or she's gonna be looking at you like π
π₯ getIn π₯
Returns a list of inetnum objects returned by whois. periodt.
$whois = new Net::RIPEWhois;
@in = $in->getIn($whois, $prefix, $ALLOCOPT);
Selected attributes of inetnum are stored in data structure inetnum. π
You should always query with fast raw output used by the RIPE whois db. no cap, don't be doing it any other way.
So the shape of it is:
$in->{inetnum}{attribute}
It returns undef on error β and when that happens, go use $in->error() to get the error no. and message. She's not gonna volunteer the info, you gotta ask. π
π§ splitWhoisAns π§
Splits the response string from whois ans and returns a list of inetnum on success.
@inList = $in->splitWhoisAns( $whoisAnsRef);
Returns undef on error. π
The splitting depends on fast raw output format from whois db β so use "-F" to get fast raw output. iykyk. π
πΈ validAlloc πΈ
Checks whether the inetnum is an allocation or not. vibe check on the inetnum, basically.
The tea:
- It uses netname same as regid, translated
"."to"-". mnt-byRIPE-NCC-MNT,RIPE-NCC-HM-MNTstatusALLOCATED PA,ALLOCATED PI,ALLOCATED UNSPECIFIEDβ and not in IANA Delegated list.
As specified in the specification, when queried "-L" "-T" in the range database it should return max 3 inetnum objects. Assignment, Allocation & IANA delegation to RIPE. Skip it if it is an IANA delegation and apply the previous check. π«‘
@valid = $in->validAlloc(@inlist);
undef on error.
π checkYYYYmmDD π
Function used to check whether dates are valid or not. It converts to UTC on YYYYMMDD and converts back to date format β if these two match, it's treated as a valid date. iconic behaviour honestly. β¨
$YYYYMMDD = checkYYYYmmDD($YYYYMMDD);
Accepts YYMMDD and YYYYMMDD formats. And lowkey important: YYMMDD is treated as 19YYMMDD. π
π FILES π
/ncc/ip-reg/delegationsβ perl file with list of IANA delegations.
π REQUIRES π
- perl module
ipv4pack
π AUTHOR π
Antony <antony@ripe.net> software group RIPE NCC <softies@ripe.net>
π¦ SEE ALSO π¦
perl(1), Net::RIPEWhois(3), whois(1)
and that's the whole page bestie!! this one's from perl v5.32.0, dated 2021-01-26, and yeah she's an in(3pm) girlie β User Contributed Perl Documentation section, as she should be. mwah, go read some inetnums π β¨
π¦ where this page comes from
- debian bookworm: asused 3.72-14 Β· MIT
- debian trixie: asused 3.72-14 Β· MIT
- ubuntu jammy: asused 3.72-14 Β· MIT
- ubuntu noble: asused 3.72-14 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms