#!/usr/pkg/bin/perl
#
# DO NOT ALTER THIS FILE
# IT IS WRITTEN BY Makefile.PL and inst/netsymbols.pl
# EDIT THOSE INSTEAD
#
package Net::Interface::NetSymbols;
use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS);

$VERSION = 1.01;

my @afs = qw(
	AF_UNSPEC
	AF_FILE
	AF_UNIX
	AF_LOCAL
	AF_INET
	AF_ISO
	AF_BRIDGE
	AF_DECnet
	AF_APPLETALK
	AF_LINK
	AF_IPX
	AF_INET6
	AF_ROUTE
	AF_PACKET
	AF_MAX
);
my @pfs = qw(
	PF_UNSPEC
	PF_UNIX
	PF_LOCAL
	PF_FILE
	PF_INET
	PF_ISO
	PF_BRIDGE
	PF_DECnet
	PF_APPLETALK
	PF_LINK
	PF_IPX
	PF_INET6
	PF_PACKET
	PF_ROUTE
	PF_MAX
);
my @ifs = qw(
	IFF_PROMISC
	IFCAP_CSUM_TCPv4_Tx
	IFF_LOOPBACK
	IFLINKSTR_UNSET
	IFCAP_CSUM_UDPv4_Rx
	IN6_IFF_ANYCAST
	IFLR_PREFIX
	IFF_BROADCAST
	IFF_DEBUG
	IFNAMSIZ
	IFNET_SLOWHZ
	IFF_NOARP
	IFF_MULTICAST
	IN6_IFF_DUPLICATED
	IF_NAMESIZE
	IFCAP_CSUM_UDPv4_Tx
	IFLINKSTR_QUERYLEN
	IN6_IFAUPDATE_DADDELAY
	IFF_LINK0
	IFCAP_CSUM_TCPv4_Rx
	IFF_OACTIVE
	IFQCTL_DROPS
	IN6_IFF_DETACHED
	IFF_SIMPLEX
	IFQCTL_LEN
	IFCAP_TSOv6
	IN6_IFF_TEMPORARY
	IFDESCRSIZE
	IFCAP_CSUM_IPv4_Tx
	IFCAP_TSOv4
	IFCAP_CSUM_TCPv6_Tx
	IFQCTL_MAXLEN
	IN6_IFF_NODAD
	IFCAP_LRO
	IFQCTL_PEAK
	IFLR_ACTIVE
	IFCAP_CSUM_UDPv6_Rx
	IFF_ALLMULTI
	IFF_POINTOPOINT
	IN6_IFF_TENTATIVE
	IFCAP_CSUM_UDPv6_Tx
	IFCAP_CSUM_IPv4_Rx
	IFA_DESTROYING
	IN6_IFF_AUTOCONF
	IFF_UP
	IFCAP_CSUM_TCPv6_Rx
	IFF_RUNNING
	IN6_IFF_DEPRECATED
	IFF_LINK2
	IFQ_MAXLEN
	IFLR_FACTORY
	IFAN_DEPARTURE
	IFAN_ARRIVAL
	IFHWADDRLEN
	IFF_LINK1
);
my @iffs = qw(
	IFF_ALLMULTI
	IFF_BROADCAST
	IFF_DEBUG
	IFF_LINK0
	IFF_LINK1
	IFF_LINK2
	IFF_LOOPBACK
	IFF_MULTICAST
	IFF_NOARP
	IFF_OACTIVE
	IFF_POINTOPOINT
	IFF_PROMISC
	IFF_RUNNING
	IFF_SIMPLEX
	IFF_UP
);
my @iffIN6 = qw(
	IN6_IFF_ANYCAST
	IN6_IFF_AUTOCONF
	IN6_IFF_DEPRECATED
	IN6_IFF_DETACHED
	IN6_IFF_DUPLICATED
	IN6_IFF_NODAD
	IN6_IFF_TEMPORARY
	IN6_IFF_TENTATIVE
);
my %unique = (
	0	=> 'AF_UNSPEC',
	1	=> 'AF_LOCAL',
	2	=> 'AF_INET',
	7	=> 'AF_ISO',
	12	=> 'AF_DECnet',
	16	=> 'AF_APPLETALK',
	18	=> 'AF_LINK',
	23	=> 'AF_IPX',
	24	=> 'AF_INET6',
	34	=> 'AF_ROUTE',
	37	=> 'AF_MAX',
	64	=> 'IFDESCRSIZE',
	128	=> 'IFF_NOARP',
	256	=> 'IFF_PROMISC',
	512	=> 'IFF_ALLMULTI',
	1024	=> 'IFF_OACTIVE',
	2048	=> 'IFF_SIMPLEX',
	4096	=> 'IFF_LINK0',
	8192	=> 'IFF_LINK1',
	16384	=> 'IFF_LINK2',
	32768	=> 'IFF_MULTICAST',
	65536	=> 'IFCAP_CSUM_UDPv6_Rx',
	131072	=> 'IFCAP_CSUM_UDPv6_Tx',
	262144	=> 'IFCAP_TSOv6',
	524288	=> 'IFCAP_LRO',
);

my @iftype = qw(
    IPV6_ADDR_ANY
    IPV6_ADDR_UNICAST
    IPV6_ADDR_MULTICAST
    IPV6_ADDR_ANYCAST
    IPV6_ADDR_LOOPBACK
    IPV6_ADDR_LINKLOCAL
    IPV6_ADDR_SITELOCAL
    IPV6_ADDR_COMPATv4
    IPV6_ADDR_SCOPE_MASK
    IPV6_ADDR_MAPPED
    IPV6_ADDR_RESERVED
    IPV6_ADDR_ULUA
    IPV6_ADDR_6TO4
    IPV6_ADDR_6BONE
    IPV6_ADDR_AGU
    IPV6_ADDR_UNSPECIFIED
    IPV6_ADDR_SOLICITED_NODE
    IPV6_ADDR_ISATAP
    IPV6_ADDR_PRODUCTIVE
    IPV6_ADDR_6TO4_MICROSOFT
    IPV6_ADDR_TEREDO
    IPV6_ADDR_ORCHID
    IPV6_ADDR_NON_ROUTE_DOC
);

my @scope = qw(
    RFC2373_GLOBAL
    RFC2373_ORGLOCAL
    RFC2373_SITELOCAL
    RFC2373_LINKLOCAL
    RFC2373_NODELOCAL
    LINUX_COMPATv4
);

@EXPORT_OK = (@afs,@pfs,@ifs,@iftype,@scope);
%EXPORT_TAGS = (
	all	=> [@afs,@pfs,@ifs,@iftype,@scope],
	afs	=> [@afs],
	pfs	=> [@pfs],
	ifs	=> [@ifs],
	iffs	=> [@iffs],
	iffIN6	=> [@iffIN6],
	iftype	=> [@iftype],
	scope	=> [@scope],
);

sub NI_ENDVAL {return 2147483647};
sub NI_UNIQUE {return \%unique};
sub DESTROY {};

1;
__END__

=head1 NAME

Net::Interface::NetSymbols - AF_ PF_ IFxxx type symbols

=head1 SYNOPSIS

This module is built for this specific architecture during the F<make> 
process using F<inst/netsymbols.pl>. Do not edit this module, edit
F<inst/netsymbols.pl> instead.

This module contains symbols arrays only for use by Net::Interface, in all other
respects it is NOT functional. It contains documentation and data arrays 
for this specific architecture.

B<NOTE:>	WARNING !!

     usage is Net::Interface

B<NOT>  Net::Interface::NetSymbols

use Net::Interface qw(

	Net::Interface::NetSymbols::NI_ENDVAL();
	Net::Interface::NetSymbols::NI_UNIQUE();
AF_UNSPEC AF_FILE AF_UNIX AF_LOCAL AF_INET AF_ISO AF_BRIDGE AF_DECnet AF_APPLETALK AF_LINK AF_IPX AF_INET6 AF_ROUTE AF_PACKET AF_MAX

PF_UNSPEC PF_UNIX PF_LOCAL PF_FILE PF_INET PF_ISO PF_BRIDGE PF_DECnet PF_APPLETALK PF_LINK PF_IPX PF_INET6 PF_PACKET PF_ROUTE PF_MAX

IFF_PROMISC IFCAP_CSUM_TCPv4_Tx IFF_LOOPBACK IFLINKSTR_UNSET IFCAP_CSUM_UDPv4_Rx IN6_IFF_ANYCAST IFLR_PREFIX IFF_BROADCAST IFF_DEBUG IFNAMSIZ IFNET_SLOWHZ IFF_NOARP IFF_MULTICAST IN6_IFF_DUPLICATED IF_NAMESIZE IFCAP_CSUM_UDPv4_Tx IFLINKSTR_QUERYLEN IN6_IFAUPDATE_DADDELAY IFF_LINK0 IFCAP_CSUM_TCPv4_Rx IFF_OACTIVE IFQCTL_DROPS IN6_IFF_DETACHED IFF_SIMPLEX IFQCTL_LEN IFCAP_TSOv6 IN6_IFF_TEMPORARY IFDESCRSIZE IFCAP_CSUM_IPv4_Tx IFCAP_TSOv4 IFCAP_CSUM_TCPv6_Tx IFQCTL_MAXLEN IN6_IFF_NODAD IFCAP_LRO IFQCTL_PEAK IFLR_ACTIVE IFCAP_CSUM_UDPv6_Rx IFF_ALLMULTI IFF_POINTOPOINT IN6_IFF_TENTATIVE IFCAP_CSUM_UDPv6_Tx IFCAP_CSUM_IPv4_Rx IFA_DESTROYING IN6_IFF_AUTOCONF IFF_UP IFCAP_CSUM_TCPv6_Rx IFF_RUNNING IN6_IFF_DEPRECATED IFF_LINK2 IFQ_MAXLEN IFLR_FACTORY IFAN_DEPARTURE IFAN_ARRIVAL IFHWADDRLEN IFF_LINK1

IFF_ALLMULTI IFF_BROADCAST IFF_DEBUG IFF_LINK0 IFF_LINK1 IFF_LINK2 IFF_LOOPBACK IFF_MULTICAST IFF_NOARP IFF_OACTIVE IFF_POINTOPOINT IFF_PROMISC IFF_RUNNING IFF_SIMPLEX IFF_UP

IN6_IFF_ANYCAST IN6_IFF_AUTOCONF IN6_IFF_DEPRECATED IN6_IFF_DETACHED IN6_IFF_DUPLICATED IN6_IFF_NODAD IN6_IFF_TEMPORARY IN6_IFF_TENTATIVE	populated for BSD flavored systems

:all :afs :pfs :ifs :iffs :iffIN6 :iftype :scope

);

=head1 DESCRIPTION

All of the AF_XXX and PF_XXX symbols available in local C<sys/socket.h> plus
usual aliases for AF_LOCAL i.e. (AF_FILE AF_UNIX PF_LOCAL PF_FILE PF_UNIX)

All of the IFxxxx and IN6_IF symbols in C<net/if.h, netinet/in.h, netinet/in_var.h> and
their includes.

Symbols may be accessed for their numeric value or their string name.

  i.e.	if ($family == AF_INET)
	    do something...

    or	print AF_INET
    will product the string "inet"

The same holds true for:

	printf("family is %s",AF_INET);
    or	sprint("family is %s",AF_INET);

To print the numeric value of the SYMBOL do:

	print (0 + SYMBOL), "\n";

On systems supporting IPV6, these additional symbols are available which
may be applied to the address I<type> to determine the address attributes.

    IPV6_ADDR_ANY		unknown
    IPV6_ADDR_UNICAST		unicast
    IPV6_ADDR_MULTICAST		multicast
    IPV6_ADDR_ANYCAST		anycast
    IPV6_ADDR_LOOPBACK		loopback
    IPV6_ADDR_LINKLOCAL		link-local
    IPV6_ADDR_SITELOCAL		site-local
    IPV6_ADDR_COMPATv4		compat-v4
    IPV6_ADDR_SCOPE_MASK	scope-mask
    IPV6_ADDR_MAPPED		mapped
    IPV6_ADDR_RESERVED		reserved
    IPV6_ADDR_ULUA		uniq-lcl-unicast
    IPV6_ADDR_6TO4		6to4
    IPV6_ADDR_6BONE		6bone
    IPV6_ADDR_AGU		global-unicast
    IPV6_ADDR_UNSPECIFIED	unspecified
    IPV6_ADDR_SOLICITED_NODE	solicited-node
    IPV6_ADDR_ISATAP		ISATAP
    IPV6_ADDR_PRODUCTIVE	productive
    IPV6_ADDR_6TO4_MICROSOFT	6to4-ms
    IPV6_ADDR_TEREDO		teredo
    IPV6_ADDR_ORCHID		orchid
    IPV6_ADDR_NON_ROUTE_DOC	non-routeable-doc

    if ($type & IPV6_ADDR_xxxx) {
	print IPV6_ADDR_xxxx,"\n";
    }

These symbols may be equated to the I<scope> of the address.

    RFC2373_GLOBAL		global-scope
    RFC2373_ORGLOCAL		org-local
    RFC2373_SITELOCAL		site-local
    RFC2373_LINKLOCAL		link-local
    RFC2373_NODELOCAL		loopback
    LINUX_COMPATv4		lx-compat-v4

    if ($scope eq RFC2373_xxxx) {
	print RFC2373_xxxx,"\n";
    }


=over 4

=item * :all	Import all symbols

=item * :afs	Import all AF_XXX symbols

=item * :pfs	Import all PF_XXX symbols

=item * :ifs	Import all IFxxxx symbols

=item * :iffs	Import all IFF symbols

=item * :iffIN6	Import all IN6_IFF symbols (BSD flavors only)

=item * :iftype	Import all IPV6 type symbols

=item * :scope	Import all IPV6 scope symbols

=back

=head1 non EXPORT functions

=over 4

=item * Net::Interface::NetSymbols::NI_ENDVAL();

Reports the highest symbol value +1 of :all symbols above. Used for testing.

=item * Net::Interface::NetSymbols::NI_UNIQUE();

Returns a hash pointer to the AF_ or PF_ symbol values mapped to their
character strings as defined for this architecture.

  i.e.
	0	=> 'AF_UNSPEC',
	1	=> 'AF_LOCAL',
	2	=> 'AF_INET',
	7	=> 'AF_ISO',
	12	=> 'AF_DECnet',
	16	=> 'AF_APPLETALK',
	18	=> 'AF_LINK',
	23	=> 'AF_IPX',
	24	=> 'AF_INET6',
	34	=> 'AF_ROUTE',
	37	=> 'AF_MAX',
	64	=> 'IFDESCRSIZE',
	128	=> 'IFF_NOARP',
	256	=> 'IFF_PROMISC',
	512	=> 'IFF_ALLMULTI',
	1024	=> 'IFF_OACTIVE',
	2048	=> 'IFF_SIMPLEX',
	4096	=> 'IFF_LINK0',
	8192	=> 'IFF_LINK1',
	16384	=> 'IFF_LINK2',
	32768	=> 'IFF_MULTICAST',
	65536	=> 'IFCAP_CSUM_UDPv6_Rx',
	131072	=> 'IFCAP_CSUM_UDPv6_Tx',
	262144	=> 'IFCAP_TSOv6',
	524288	=> 'IFCAP_LRO',

=head1 AUTHOR	Michael Robinton <michael@bizsystems.com>

=head1 COPYRIGHT	2023

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.

=cut

1;
