require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NETINET6_IP6_VAR_H_)) {
    eval 'sub _NETINET6_IP6_VAR_H_ () {1;}' unless defined(&_NETINET6_IP6_VAR_H_);
    require 'sys/types.ph';
    require 'sys/queue.ph';
    require 'sys/socketvar.ph';
    require 'net/if.ph';
    require 'net/route.ph';
    require 'netinet/in.ph';
    require 'netinet/ip6.ph';
    eval 'sub ip6po_rthdr () { ($ip6po_rhinfo->{ip6po_rhi_rthdr});}' unless defined(&ip6po_rthdr);
    eval 'sub ip6po_route () { ($ip6po_rhinfo->{ip6po_rhi_route});}' unless defined(&ip6po_route);
    eval 'sub ip6po_nexthop () { ($ip6po_nhinfo->{ip6po_nhi_nexthop});}' unless defined(&ip6po_nexthop);
    eval 'sub ip6po_nextroute () { ($ip6po_nhinfo->{ip6po_nhi_route});}' unless defined(&ip6po_nextroute);
    eval 'sub IP6PO_MINMTU_MCASTONLY () {-1;}' unless defined(&IP6PO_MINMTU_MCASTONLY);
    eval 'sub IP6PO_MINMTU_DISABLE () {0;}' unless defined(&IP6PO_MINMTU_DISABLE);
    eval 'sub IP6PO_MINMTU_ALL () {1;}' unless defined(&IP6PO_MINMTU_ALL);
    eval 'sub IP6PO_TEMPADDR_SYSTEM () {-1;}' unless defined(&IP6PO_TEMPADDR_SYSTEM);
    eval 'sub IP6PO_TEMPADDR_NOTPREFER () {0;}' unless defined(&IP6PO_TEMPADDR_NOTPREFER);
    eval 'sub IP6PO_TEMPADDR_PREFER () {1;}' unless defined(&IP6PO_TEMPADDR_PREFER);
    if(0) {
	eval 'sub IP6PO_REACHCONF () {0x1;}' unless defined(&IP6PO_REACHCONF);
	eval 'sub IP6PO_MINMTU () {0x2;}' unless defined(&IP6PO_MINMTU);
    }
    eval 'sub IP6PO_DONTFRAG () {0x4;}' unless defined(&IP6PO_DONTFRAG);
    eval 'sub IP6_STAT_TOTAL () {0;}' unless defined(&IP6_STAT_TOTAL);
    eval 'sub IP6_STAT_TOOSHORT () {1;}' unless defined(&IP6_STAT_TOOSHORT);
    eval 'sub IP6_STAT_TOOSMALL () {2;}' unless defined(&IP6_STAT_TOOSMALL);
    eval 'sub IP6_STAT_FRAGMENTS () {3;}' unless defined(&IP6_STAT_FRAGMENTS);
    eval 'sub IP6_STAT_FRAGDROPPED () {4;}' unless defined(&IP6_STAT_FRAGDROPPED);
    eval 'sub IP6_STAT_FRAGTIMEOUT () {5;}' unless defined(&IP6_STAT_FRAGTIMEOUT);
    eval 'sub IP6_STAT_FRAGOVERFLOW () {6;}' unless defined(&IP6_STAT_FRAGOVERFLOW);
    eval 'sub IP6_STAT_FORWARD () {7;}' unless defined(&IP6_STAT_FORWARD);
    eval 'sub IP6_STAT_CANTFORWARD () {8;}' unless defined(&IP6_STAT_CANTFORWARD);
    eval 'sub IP6_STAT_REDIRECTSENT () {9;}' unless defined(&IP6_STAT_REDIRECTSENT);
    eval 'sub IP6_STAT_DELIVERED () {10;}' unless defined(&IP6_STAT_DELIVERED);
    eval 'sub IP6_STAT_LOCALOUT () {11;}' unless defined(&IP6_STAT_LOCALOUT);
    eval 'sub IP6_STAT_ODROPPED () {12;}' unless defined(&IP6_STAT_ODROPPED);
    eval 'sub IP6_STAT_REASSEMBLED () {13;}' unless defined(&IP6_STAT_REASSEMBLED);
    eval 'sub IP6_STAT_FRAGMENTED () {14;}' unless defined(&IP6_STAT_FRAGMENTED);
    eval 'sub IP6_STAT_OFRAGMENTS () {15;}' unless defined(&IP6_STAT_OFRAGMENTS);
    eval 'sub IP6_STAT_CANTFRAG () {16;}' unless defined(&IP6_STAT_CANTFRAG);
    eval 'sub IP6_STAT_BADOPTIONS () {17;}' unless defined(&IP6_STAT_BADOPTIONS);
    eval 'sub IP6_STAT_NOROUTE () {18;}' unless defined(&IP6_STAT_NOROUTE);
    eval 'sub IP6_STAT_BADVERS () {19;}' unless defined(&IP6_STAT_BADVERS);
    eval 'sub IP6_STAT_RAWOUT () {20;}' unless defined(&IP6_STAT_RAWOUT);
    eval 'sub IP6_STAT_BADSCOPE () {21;}' unless defined(&IP6_STAT_BADSCOPE);
    eval 'sub IP6_STAT_NOTMEMBER () {22;}' unless defined(&IP6_STAT_NOTMEMBER);
    eval 'sub IP6_STAT_NXTHIST () {23;}' unless defined(&IP6_STAT_NXTHIST);
    eval 'sub IP6_STAT_M1 () {279;}' unless defined(&IP6_STAT_M1);
    eval 'sub IP6_STAT_M2M () {280;}' unless defined(&IP6_STAT_M2M);
    eval 'sub IP6_STAT_MEXT1 () {312;}' unless defined(&IP6_STAT_MEXT1);
    eval 'sub IP6_STAT_MEXT2M () {313;}' unless defined(&IP6_STAT_MEXT2M);
    eval 'sub IP6_STAT_EXTHDRTOOLONG () {314;}' unless defined(&IP6_STAT_EXTHDRTOOLONG);
    eval 'sub IP6_STAT_NOGIF () {315;}' unless defined(&IP6_STAT_NOGIF);
    eval 'sub IP6_STAT_TOOMANYHDR () {316;}' unless defined(&IP6_STAT_TOOMANYHDR);
    eval 'sub IP6_STAT_SOURCES_NONE () {317;}' unless defined(&IP6_STAT_SOURCES_NONE);
    eval 'sub IP6_STAT_SOURCES_SAMEIF () {318;}' unless defined(&IP6_STAT_SOURCES_SAMEIF);
    eval 'sub IP6_STAT_SOURCES_OTHERIF () {334;}' unless defined(&IP6_STAT_SOURCES_OTHERIF);
    eval 'sub IP6_STAT_SOURCES_SAMESCOPE () {350;}' unless defined(&IP6_STAT_SOURCES_SAMESCOPE);
    eval 'sub IP6_STAT_SOURCES_OTHERSCOPE () {366;}' unless defined(&IP6_STAT_SOURCES_OTHERSCOPE);
    eval 'sub IP6_STAT_SOURCES_DEPRECATED () {382;}' unless defined(&IP6_STAT_SOURCES_DEPRECATED);
    eval 'sub IP6_STAT_FORWARD_CACHEHIT () {398;}' unless defined(&IP6_STAT_FORWARD_CACHEHIT);
    eval 'sub IP6_STAT_FORWARD_CACHEMISS () {399;}' unless defined(&IP6_STAT_FORWARD_CACHEMISS);
    eval 'sub IP6_STAT_FASTFORWARD () {400;}' unless defined(&IP6_STAT_FASTFORWARD);
    eval 'sub IP6_STAT_FASTFORWARDFLOWS () {401;}' unless defined(&IP6_STAT_FASTFORWARDFLOWS);
    eval 'sub IP6_STAT_NOIPSEC () {402;}' unless defined(&IP6_STAT_NOIPSEC);
    eval 'sub IP6_STAT_PFILDROP_IN () {403;}' unless defined(&IP6_STAT_PFILDROP_IN);
    eval 'sub IP6_STAT_PFILDROP_OUT () {404;}' unless defined(&IP6_STAT_PFILDROP_OUT);
    eval 'sub IP6_STAT_IPSECDROP_IN () {405;}' unless defined(&IP6_STAT_IPSECDROP_IN);
    eval 'sub IP6_STAT_IPSECDROP_OUT () {406;}' unless defined(&IP6_STAT_IPSECDROP_OUT);
    eval 'sub IP6_STAT_IFDROP () {407;}' unless defined(&IP6_STAT_IFDROP);
    eval 'sub IP6_STAT_IDROPPED () {408;}' unless defined(&IP6_STAT_IDROPPED);
    eval 'sub IP6_STAT_TIMXCEED () {409;}' unless defined(&IP6_STAT_TIMXCEED);
    eval 'sub IP6_STAT_TOOBIG () {410;}' unless defined(&IP6_STAT_TOOBIG);
    eval 'sub IP6_STAT_RTREJECT () {411;}' unless defined(&IP6_STAT_RTREJECT);
    eval 'sub IP6_NSTATS () {412;}' unless defined(&IP6_NSTATS);
    eval 'sub IP6FLOW_HASHBITS () {6;}' unless defined(&IP6FLOW_HASHBITS);
    if(defined(&_KERNEL)) {
	require 'sys/protosw.ph';
	require 'sys/cprng.ph';
	eval 'sub IPV6_UNSPECSRC () {0x1;}' unless defined(&IPV6_UNSPECSRC);
	eval 'sub IPV6_FORWARDING () {0x2;}' unless defined(&IPV6_FORWARDING);
	eval 'sub IPV6_MINMTU () {0x4;}' unless defined(&IPV6_MINMTU);
	if(defined(&GATEWAY)) {
	}
	eval 'sub ip6_randomid {
	    my($void) = @_;
    	    eval q({  &cprng_fast32(); });
	}' unless defined(&ip6_randomid);
	eval 'sub ip6_randomflowlabel {
	    my($void) = @_;
    	    eval q({  &cprng_fast32() & 0xfffff; });
	}' unless defined(&ip6_randomflowlabel);
	eval 'sub ip6_dad_enabled {
	    my($void) = @_;
    	    eval q({  &ip6_dad_count > 0; });
	}' unless defined(&ip6_dad_enabled);
    }
}
1;
