require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NETINET_IF_ETHER_H_)) {
    eval 'sub _NETINET_IF_ETHER_H_ () {1;}' unless defined(&_NETINET_IF_ETHER_H_);
    eval 'sub ETHER_ADDR_LEN () {6;}' unless defined(&ETHER_ADDR_LEN);
    eval 'sub ETHER_TYPE_LEN () {2;}' unless defined(&ETHER_TYPE_LEN);
    eval 'sub ETHER_CRC_LEN () {4;}' unless defined(&ETHER_CRC_LEN);
    eval 'sub ETHER_HDR_LEN () {(( &ETHER_ADDR_LEN * 2) +  &ETHER_TYPE_LEN);}' unless defined(&ETHER_HDR_LEN);
    eval 'sub ETHER_MIN_LEN () {64;}' unless defined(&ETHER_MIN_LEN);
    eval 'sub ETHER_MAX_LEN () {1518;}' unless defined(&ETHER_MAX_LEN);
    eval 'sub ETHER_MAX_DIX_LEN () {1536;}' unless defined(&ETHER_MAX_DIX_LEN);
    eval 'sub ETHER_VLAN_ENCAP_LEN () {4;}' unless defined(&ETHER_VLAN_ENCAP_LEN);
    eval 'sub ETHER_ALIGN () {2;}' unless defined(&ETHER_ALIGN);
    require 'net/ethertypes.ph';
    eval 'sub ETHER_IS_MULTICAST {
        my($addr) = @_;
	    eval q((*($addr) & 0x1));
    }' unless defined(&ETHER_IS_MULTICAST);
    eval 'sub ETHERMTU () {( &ETHER_MAX_LEN -  &ETHER_HDR_LEN -  &ETHER_CRC_LEN);}' unless defined(&ETHERMTU);
    eval 'sub ETHERMIN () {( &ETHER_MIN_LEN -  &ETHER_HDR_LEN -  &ETHER_CRC_LEN);}' unless defined(&ETHERMIN);
    eval 'sub ETHER_CRC_POLY_LE () {0xedb88320;}' unless defined(&ETHER_CRC_POLY_LE);
    eval 'sub ETHER_CRC_POLY_BE () {0x4c11db6;}' unless defined(&ETHER_CRC_POLY_BE);
    eval 'sub M_HASFCS () { &M_LINK0;}' unless defined(&M_HASFCS);
    if(defined(&_KERNEL)) {
	eval 'sub ETHER_MAP_IP_MULTICAST {
	    my($ipaddr, $enaddr) = @_;
    	    eval q({ ($enaddr)[0] = 0x1; ($enaddr)[1] = 0x; ($enaddr)[2] = 0x5e; ($enaddr)[3] = (( &u_int8_t *)$ipaddr)[1] & 0x7f; ($enaddr)[4] = (( &u_int8_t *)$ipaddr)[2]; ($enaddr)[5] = (( &u_int8_t *)$ipaddr)[3]; });
	}' unless defined(&ETHER_MAP_IP_MULTICAST);
	eval 'sub ETHER_MAP_IPV6_MULTICAST {
	    my($ip6addr, $enaddr) = @_;
    	    eval q({ ($enaddr)[0] = 0x33; ($enaddr)[1] = 0x33; ($enaddr)[2] = (( &u_int8_t *)$ip6addr)[12]; ($enaddr)[3] = (( &u_int8_t *)$ip6addr)[13]; ($enaddr)[4] = (( &u_int8_t *)$ip6addr)[14]; ($enaddr)[5] = (( &u_int8_t *)$ip6addr)[15]; });
	}' unless defined(&ETHER_MAP_IPV6_MULTICAST);
    }
    eval 'sub arp_hrd () { ($ea_hdr->{ar_hrd});}' unless defined(&arp_hrd);
    eval 'sub arp_pro () { ($ea_hdr->{ar_pro});}' unless defined(&arp_pro);
    eval 'sub arp_hln () { ($ea_hdr->{ar_hln});}' unless defined(&arp_hln);
    eval 'sub arp_pln () { ($ea_hdr->{ar_pln});}' unless defined(&arp_pln);
    eval 'sub arp_op () { ($ea_hdr->{ar_op});}' unless defined(&arp_op);
    eval 'sub la_timer () { ($la_rt->{rt_rmx}->{rmx_expire});}' unless defined(&la_timer);
    eval 'sub SIN_PROXY () {1;}' unless defined(&SIN_PROXY);
    eval 'sub RTF_USETRAILERS () { &RTF_PROTO1;}' unless defined(&RTF_USETRAILERS);
    eval 'sub RTF_ANNOUNCE () { &RTF_PROTO2;}' unless defined(&RTF_ANNOUNCE);
    eval 'sub RTF_PERMANENT_ARP () { &RTF_PROTO3;}' unless defined(&RTF_PERMANENT_ARP);
    if(defined(&_KERNEL)) {
    }
    eval 'sub ETHER_LOOKUP_MULTI {
        my($addrlo, $addrhi, $ac, $enm) = @_;
	    eval q({  &for (($enm) =  &LIST_FIRST(($ac)-> &ac_multiaddrs); ($enm) !=  &LIST_END(($ac)-> &ac_multiaddrs)  && ( &bcmp(($enm)-> &enm_addrlo, ($addrlo),  &ETHER_ADDR_LEN) != 0||  &bcmp(($enm)-> &enm_addrhi, ($addrhi),  &ETHER_ADDR_LEN) != 0); ($enm) =  &LIST_NEXT(($enm),  &enm_list)); });
    }' unless defined(&ETHER_LOOKUP_MULTI);
    eval 'sub ETHER_NEXT_MULTI {
        my($step, $enm) = @_;
	    eval q({  &if ((($enm) = ($step). &e_enm) !=  &NULL) ($step). &e_enm =  &LIST_NEXT(($enm),  &enm_list); });
    }' unless defined(&ETHER_NEXT_MULTI);
    eval 'sub ETHER_FIRST_MULTI {
        my($step, $ac, $enm) = @_;
	    eval q({ ($step). &e_enm =  &LIST_FIRST(($ac)-> &ac_multiaddrs);  &ETHER_NEXT_MULTI(($step), ($enm)); });
    }' unless defined(&ETHER_FIRST_MULTI);
    if(defined(&_KERNEL)) {
    } else {
    }
}
1;
