Net::I...ymbols(3pm)
π NAME π
Net::Interface::NetSymbols β AF_ PF_ IFxxx type symbols
β¨ SYNOPSIS β¨
okay bestie, listen. this page is Net::Interface::NetSymbols, dropping out of the User Contributed Perl Documentation, section 3pm. it exists. it's real. but bestie β do not touch it π
this module gets built for your specific architecture during the make process, by inst/netsymbols.pl. So do NOT edit this module. edit inst/netsymbols.pl instead. that's the whole assignment π«Ά
and likeβ¦ what even is this file? it contains symbols arrays only for use by Net::Interface. in all other respects it is NOT functional. no cap. it's literally documentation and data arrays for this specific architecture. that's it, that's the vibes, that's the entire personality πΈ
β οΈ NOTE: WARNING !! the usage isNet::InterfaceNOTNet::Interface::NetSymbolsiykyk π
use Net::Interface qw(
Net::Interface::NetSymbols::NI_ENDVAL();
Net::Interface::NetSymbols::NI_UNIQUE();
AF_UNSPEC AF_FILE AF_LOCAL AF_UNIX AF_INET AF_AX25 AF_IPX AF_APPLETALK AF_X25 AF_INET6 AF_ROSE AF_DECnet AF_PACKET AF_ROUTE AF_ASH AF_ECONET AF_MAX
PF_UNSPEC PF_FILE PF_LOCAL PF_UNIX PF_INET PF_AX25 PF_IPX PF_APPLETALK
PF_X25 PF_INET6 PF_ROSE PF_DECnet PF_PACKET PF_ROUTE PF_ASH PF_ECONET
PF_MAX
IFF_ALLMULTI IFF_AUTOMEDIA IFF_BROADCAST IFF_DEBUG IFF_DYNAMIC
IFF_LOOPBACK IFF_MASTER IFF_MULTICAST IFF_NOARP IFF_NOTRAILERS
IFF_POINTOPOINT IFF_PORTSEL IFF_PROMISC IFF_RUNNING IFF_SLAVE IFF_UP
IFHWADDRLEN IFNAMSIZ IF_NAMESIZE
IFF_ALLMULTI IFF_AUTOMEDIA IFF_BROADCAST IFF_DEBUG IFF_DYNAMIC
IFF_LOOPBACK IFF_MASTER IFF_MULTICAST IFF_NOARP IFF_NOTRAILERS
IFF_POINTOPOINT IFF_PORTSEL IFF_PROMISC IFF_RUNNING IFF_SLAVE IFF_UP
:all :afs :pfs :ifs :iffs :iftype :scope
);
π¦ DESCRIPTION π¦
every single AF_XXX and PF_XXX symbol that's available in your local sys/socket.h, plus the usual aliases for AF_LOCAL, i.e. (AF_FILE AF_UNIX PF_LOCAL PF_FILE PF_UNIX). she's thorough π
also all of the IFxxxx and IN6_IF symbols in net/if.h, netinet/in.h, netinet/in_var.h and their includes. the whole friend group showed up π
symbols can be accessed for their numeric value or their string name. so you can do either, whichever hits different:
i.e. if ($family == AF_INET)
do something...
or print AF_INET
will product the string "inet"
so like β print AF_INET and it hands you back the string "inet". iconic honestly. same energy for:
printf("family is %s",AF_INET);
or sprint("family is %s",AF_INET);
and if you want the numeric value of the SYMBOL, lowkey just say:
print (0 + SYMBOL), "\n";
on systems supporting IPV6, these extra symbols are available β you can slap them on the address type to figure out the address attributes π
IPV6_ADDR_ANYβ unknownIPV6_ADDR_UNICASTβ unicastIPV6_ADDR_MULTICASTβ multicastIPV6_ADDR_ANYCASTβ anycastIPV6_ADDR_LOOPBACKβ loopbackIPV6_ADDR_LINKLOCALβ link-localIPV6_ADDR_SITELOCALβ site-localIPV6_ADDR_COMPATv4β compat-v4IPV6_ADDR_SCOPE_MASKβ scope-maskIPV6_ADDR_MAPPEDβ mappedIPV6_ADDR_RESERVEDβ reservedIPV6_ADDR_ULUAβ uniq-lcl-unicastIPV6_ADDR_6TO4β 6to4IPV6_ADDR_6BONEβ 6boneIPV6_ADDR_AGUβ global-unicastIPV6_ADDR_UNSPECIFIEDβ unspecifiedIPV6_ADDR_SOLICITED_NODEβ solicited-nodeIPV6_ADDR_ISATAPβ ISATAPIPV6_ADDR_PRODUCTIVEβ productiveIPV6_ADDR_6TO4_MICROSOFTβ 6to4-msIPV6_ADDR_TEREDOβ teredoIPV6_ADDR_ORCHIDβ orchidIPV6_ADDR_NON_ROUTE_DOCβ non-routeable-doc
if ($type & IPV6_ADDR_xxxx) {
print IPV6_ADDR_xxxx,"\n";
}
and these ones can be equated to the scope of the address. main character scope energy π
RFC2373_GLOBALβ global-scopeRFC2373_ORGLOCALβ org-localRFC2373_SITELOCALβ site-localRFC2373_LINKLOCALβ link-localRFC2373_NODELOCALβ loopbackLINUX_COMPATv4β lx-compat-v4
if ($scope eq RFC2373_xxxx) {
print RFC2373_xxxx,"\n";
}
and now the import tags, because the way that qw() just works π₯
:allβ import all symbols. yes, all of them. go crazy β¨:afsβ import allAF_XXXsymbols:pfsβ import allPF_XXXsymbols:ifsβ import allIFxxxxsymbols:iffsβ import allIFFsymbols:iftypeβ import all IPV6 type symbols:scopeβ import all IPV6 scope symbols
π non EXPORT functions π
these ones do not get exported, so call them fully qualified or they will simply not hear you π«Ά
Net::Interface::NetSymbols::NI_ENDVAL();β reports the highest symbol value +1 of the:allsymbols above. used for testing. that's her whole job πNet::Interface::NetSymbols::NI_UNIQUE();β returns a hash pointer to theAF_orPF_symbol values, mapped to their character strings as defined for this architecture. like a little name-tag situation for every number π
i.e.
0 => 'PF_UNSPEC',
1 => 'PF_LOCAL',
2 => 'PF_INET',
3 => 'PF_AX25',
4 => 'PF_IPX',
5 => 'PF_APPLETALK',
9 => 'PF_X25',
10 => 'PF_INET6',
11 => 'PF_ROSE',
12 => 'PF_DECnet',
17 => 'PF_PACKET',
18 => 'PF_ASH',
19 => 'PF_ECONET',
46 => 'PF_MAX',
π AUTHOR π
Michael Robinton <michael@bizsystems.com>
π COPYRIGHT π
2008-2009 Michael Robinton, all rights reserved.
this library is free software. you can distribute it and/or modify it under the same terms as Perl itself. slay, honestly π¦
and that's the whole page bestie, no notes. this was Net::Interface::NetSymbols from the User Contributed Perl Documentation, perl v5.42.3, dated 2026-08-19. go build something cute, and remember: it's Net::Interface, never Net::Interface::NetSymbols. periodt πβ¨
π¦ where this page comes from
- ubuntu stonking: libnet-interface-perl 1.016-4build1 Β· Artistic-1.0-Perl OR GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms