require '_h2ph_pre.ph';

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 ETHERTYPE_PUP () {0x200;}' unless defined(&ETHERTYPE_PUP);
    eval 'sub ETHERTYPE_IP () {0x800;}' unless defined(&ETHERTYPE_IP);
    eval 'sub ETHERTYPE_ARP () {0x806;}' unless defined(&ETHERTYPE_ARP);
    eval 'sub ETHERTYPE_REVARP () {0x8035;}' unless defined(&ETHERTYPE_REVARP);
    eval 'sub ETHERTYPE_8021Q () {0x8100;}' unless defined(&ETHERTYPE_8021Q);
    eval 'sub ETHERTYPE_IPV6 () {0x86dd;}' unless defined(&ETHERTYPE_IPV6);
    eval 'sub ETHERTYPE_PPPOEDISC () {0x8863;}' unless defined(&ETHERTYPE_PPPOEDISC);
    eval 'sub ETHERTYPE_PPPOE () {0x8864;}' unless defined(&ETHERTYPE_PPPOE);
    eval 'sub ETHERTYPE_LOOPBACK () {0x9000;}' unless defined(&ETHERTYPE_LOOPBACK);
    eval 'sub ETHERTYPE_TRAIL () {0x1000;}' unless defined(&ETHERTYPE_TRAIL);
    eval 'sub ETHERTYPE_NTRAILER () {16;}' unless defined(&ETHERTYPE_NTRAILER);
    eval 'sub ETHER_IS_MULTICAST {
        local($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);
    if(defined(&_KERNEL)) {
	eval 'sub ETHER_MAP_IP_MULTICAST {
	    local($ipaddr, $enaddr) = @_;
    	    eval q({ [0] = 0x1; [1] = 0x; [2] = 0x5e; [3] = [1] & 0x7f; [4] = [2]; [5] = ($ipaddr)[3]; });
	}' unless defined(&ETHER_MAP_IP_MULTICAST);
	eval 'sub ETHER_MAP_IPV6_MULTICAST {
	    local($ip6addr, $enaddr) = @_;
    	    eval q({ [0] = 0x33; [1] = 0x33; [2] = [12]; [3] = [13]; [4] = [14]; [5] = ($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 {
        local($addrlo, $addrhi, $ac, $enm) = @_;
	    eval q({  &for (($enm) = ($ac)-> ($ac_multiaddrs->{lh_first}); ($enm) !=  &NULL  && ( &bcmp(($enm)-> &enm_addrlo, ($addrlo),  &ETHER_ADDR_LEN) != 0||  &bcmp(($enm)-> &enm_addrhi, ($addrhi),  &ETHER_ADDR_LEN) != 0); ($enm) = ($enm)-> ($enm_list->{le_next})); });
    }' unless defined(&ETHER_LOOKUP_MULTI);
    eval 'sub ETHER_NEXT_MULTI {
        local($step, $enm) = @_;
	    eval q({  &if ((($enm) = ($step). &e_enm) !=  &NULL) ($step). &e_enm = ($enm)-> ($enm_list->{le_next}); });
    }' unless defined(&ETHER_NEXT_MULTI);
    eval 'sub ETHER_FIRST_MULTI {
        local($step, $ac, $enm) = @_;
	    eval q({ ($step). &e_enm = ($ac)-> ($ac_multiaddrs->{lh_first});  &ETHER_NEXT_MULTI(($step), ($enm)); });
    }' unless defined(&ETHER_FIRST_MULTI);
    if(defined(&_KERNEL)) {
    } else {
    }
}
1;
