require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NETIPX_IPX_H_)) {
    eval 'sub _NETIPX_IPX_H_ () {1;}' unless defined(&_NETIPX_IPX_H_);
    eval 'sub IPXPROTO_UNKWN () {0;}' unless defined(&IPXPROTO_UNKWN);
    eval 'sub IPXPROTO_RI () {1;}' unless defined(&IPXPROTO_RI);
    eval 'sub IPXPROTO_PXP () {4;}' unless defined(&IPXPROTO_PXP);
    eval 'sub IPXPROTO_SPX () {5;}' unless defined(&IPXPROTO_SPX);
    eval 'sub IPXPROTO_NCP () {17;}' unless defined(&IPXPROTO_NCP);
    eval 'sub IPXPROTO_NETBIOS () {20;}' unless defined(&IPXPROTO_NETBIOS);
    eval 'sub IPXPROTO_RAW () {255;}' unless defined(&IPXPROTO_RAW);
    eval 'sub IPXPROTO_MAX () {256;}' unless defined(&IPXPROTO_MAX);
    eval 'sub IPXPORT_RI () {1;}' unless defined(&IPXPORT_RI);
    eval 'sub IPXPORT_ECHO () {2;}' unless defined(&IPXPORT_ECHO);
    eval 'sub IPXPORT_RE () {3;}' unless defined(&IPXPORT_RE);
    eval 'sub IPXPORT_FSP () {0x451;}' unless defined(&IPXPORT_FSP);
    eval 'sub IPXPORT_SAP () {0x452;}' unless defined(&IPXPORT_SAP);
    eval 'sub IPXPORT_RIP () {0x453;}' unless defined(&IPXPORT_RIP);
    eval 'sub IPXPORT_NETBIOS () {0x455;}' unless defined(&IPXPORT_NETBIOS);
    eval 'sub IPXPORT_DIAGS () {0x456;}' unless defined(&IPXPORT_DIAGS);
    eval 'sub IPXPORT_SERIAL () {0x457;}' unless defined(&IPXPORT_SERIAL);
    eval 'sub IPXPORT_NLSP () {0x9001;}' unless defined(&IPXPORT_NLSP);
    eval 'sub IPXPORT_WAN () {0x9004;}' unless defined(&IPXPORT_WAN);
    eval 'sub IPXPORT_PING () {0x9086;}' unless defined(&IPXPORT_PING);
    eval 'sub IPXPORT_MOBILE () {0x9088;}' unless defined(&IPXPORT_MOBILE);
    eval 'sub IPXPORT_RESERVED () {0x4000;}' unless defined(&IPXPORT_RESERVED);
    eval 'sub IPXPORT_WELLKNOWN () {0x6000;}' unless defined(&IPXPORT_WELLKNOWN);
    eval 'sub IPX_FORWARDING () {0x1;}' unless defined(&IPX_FORWARDING);
    eval 'sub IPX_ROUTETOIF () {0x10;}' unless defined(&IPX_ROUTETOIF);
    eval 'sub IPX_ALLOWBROADCAST () { &SO_BROADCAST;}' unless defined(&IPX_ALLOWBROADCAST);
    eval 'sub IPX_MAXHOPS () {15;}' unless defined(&IPX_MAXHOPS);
    eval 'sub SO_HEADERS_ON_INPUT () {1;}' unless defined(&SO_HEADERS_ON_INPUT);
    eval 'sub SO_HEADERS_ON_OUTPUT () {2;}' unless defined(&SO_HEADERS_ON_OUTPUT);
    eval 'sub SO_DEFAULT_HEADERS () {3;}' unless defined(&SO_DEFAULT_HEADERS);
    eval 'sub SO_LAST_HEADER () {4;}' unless defined(&SO_LAST_HEADER);
    eval 'sub SO_IPXIP_ROUTE () {5;}' unless defined(&SO_IPXIP_ROUTE);
    eval 'sub SO_SEQNO () {6;}' unless defined(&SO_SEQNO);
    eval 'sub SO_ALL_PACKETS () {7;}' unless defined(&SO_ALL_PACKETS);
    eval 'sub SO_MTU () {8;}' unless defined(&SO_MTU);
    eval 'sub SO_IPXTUN_ROUTE () {9;}' unless defined(&SO_IPXTUN_ROUTE);
    eval 'sub SO_IPX_CHECKSUM () {10;}' unless defined(&SO_IPX_CHECKSUM);
    eval 'sub IPX_HOSTADDRLEN () {6;}' unless defined(&IPX_HOSTADDRLEN);
    eval 'sub IPX_NETADDRLEN () {4;}' unless defined(&IPX_NETADDRLEN);
    eval 'sub sipx_net () { ($sipx_addr->{ipx_net});}' unless defined(&sipx_net);
    eval 'sub sipx_network () { ($sipx_addr->{ipx_net}->{l_net});}' unless defined(&sipx_network);
    eval 'sub sipx_node () { ($sipx_addr->{ipx_host}->{c_host});}' unless defined(&sipx_node);
    eval 'sub sipx_port () { ($sipx_addr->{ipx_port});}' unless defined(&sipx_port);
    eval 'sub ipx_neteqnn {
        my($a,$b) = @_;
	    eval q(((($a). $s_net[0]==($b). $s_net[0])  && (($a). $s_net[1]==($b). $s_net[1])));
    }' unless defined(&ipx_neteqnn);
    eval 'sub ipx_neteq {
        my($a,$b) = @_;
	    eval q( &ipx_neteqnn(($a). &ipx_net, ($b). &ipx_net));
    }' unless defined(&ipx_neteq);
    eval 'sub satoipx_addr {
        my($sa) = @_;
	    eval q(((($sa))-> &sipx_addr));
    }' unless defined(&satoipx_addr);
    eval 'sub ipx_hosteqnh {
        my($s,$t) = @_;
	    eval q((($s). $s_host[0] == ($t). $s_host[0]  && ($s). $s_host[1] == ($t). $s_host[1]  && ($s). $s_host[2] == ($t). $s_host[2]));
    }' unless defined(&ipx_hosteqnh);
    eval 'sub ipx_hosteq {
        my($s,$t) = @_;
	    eval q(( &ipx_hosteqnh(($s). &ipx_host,($t). &ipx_host)));
    }' unless defined(&ipx_hosteq);
    eval 'sub ipx_nullnet {
        my($x) = @_;
	    eval q(((($x). ($ipx_net->{s_net[0]})==0)  && (($x). ($ipx_net->{s_net[1]})==0)));
    }' unless defined(&ipx_nullnet);
    eval 'sub ipx_nullhost {
        my($x) = @_;
	    eval q(((($x). ($ipx_host->{s_host[0]})==0)  && (($x). ($ipx_host->{s_host[1]})==0)  && (($x). ($ipx_host->{s_host[2]})==0)));
    }' unless defined(&ipx_nullhost);
    eval 'sub ipx_wildnet {
        my($x) = @_;
	    eval q(((($x). ($ipx_net->{s_net[0]})==0xffff)  && (($x). ($ipx_net->{s_net[1]})==0xffff)));
    }' unless defined(&ipx_wildnet);
    eval 'sub ipx_wildhost {
        my($x) = @_;
	    eval q(((($x). ($ipx_host->{s_host[0]})==0xffff)  && (($x). ($ipx_host->{s_host[1]})==0xffff)  && (($x). ($ipx_host->{s_host[2]})==0xffff)));
    }' unless defined(&ipx_wildhost);
    eval 'sub IPXPROTO_MAXID () {( &IPXPROTO_SPX + 1);}' unless defined(&IPXPROTO_MAXID);
    eval 'sub CTL_IPXPROTO_NAMES () {{ { "ipx",  &CTLTYPE_NODE }, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { "spx",  &CTLTYPE_NODE }, };}' unless defined(&CTL_IPXPROTO_NAMES);
    if(defined(&_KERNEL)) {
	eval 'sub satosipx {
	    my($a) = @_;
    	    eval q((($a)));
	}' unless defined(&satosipx);
	eval 'sub sipxtosa {
	    my($a) = @_;
    	    eval q((($a)));
	}' unless defined(&sipxtosa);
    }
    require 'sys/cdefs.ph';
}
1;
