in(3pm)

πŸ“¦
version 3.72 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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-by RIPE-NCC-MNT , RIPE-NCC-HM-MNT
  • status ALLOCATED 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