require '_h2ph_pre.ph';

unless(defined(&ETHER_ADDR_LEN)) {
    sub ETHER_ADDR_LEN () {	6;}
}
unless(defined(&ETHER_TYPE_LEN)) {
    sub ETHER_TYPE_LEN () {	2;}
}
unless(defined(&ETHER_CRC_LEN)) {
    sub ETHER_CRC_LEN () {	4;}
}
unless(defined(&ETHER_HDR_LEN)) {
    sub ETHER_HDR_LEN () {	( &ETHER_ADDR_LEN*2+ &ETHER_TYPE_LEN);}
}
unless(defined(&ETHERTYPE_PUP)) {
    sub ETHERTYPE_PUP () {	0x0200;}
}
unless(defined(&ETHERTYPE_IP)) {
    sub ETHERTYPE_IP () {	0x0800;}
}
unless(defined(&ETHERTYPE_ARP)) {
    sub ETHERTYPE_ARP () {	0x0806;}
}
unless(defined(&ETHERTYPE_REVARP)) {
    sub ETHERTYPE_REVARP () {	0x8035;}
}
unless(defined(&ETHERTYPE_8021Q)) {
    sub ETHERTYPE_8021Q () {	0x8100;}
}
unless(defined(&ETHERTYPE_IPV6)) {
    sub ETHERTYPE_IPV6 () {	0x86dd;}
}
unless(defined(&ETHERTYPE_PPPOEDISC)) {
    sub ETHERTYPE_PPPOEDISC () {	0x8863;}
}
unless(defined(&ETHERTYPE_PPPOE)) {
    sub ETHERTYPE_PPPOE () {	0x8864;}
}
unless(defined(&ETHERTYPE_LOOPBACK)) {
    sub ETHERTYPE_LOOPBACK () {	0x9000;}
}
unless(defined(&ETHERTYPE_TRAIL)) {
    sub ETHERTYPE_TRAIL () {	0x1000;}
}
unless(defined(&ETHERTYPE_NTRAILER)) {
    sub ETHERTYPE_NTRAILER () {	16;}
}
unless(defined(&ETHER_IS_MULTICAST)) {
    sub ETHER_IS_MULTICAST {
	local($addr) = @_;
	eval q((*($addr) & 0x01));
    }
}
unless(defined(&ETHERMTU)) {
    sub ETHERMTU () {	1500;}
}
unless(defined(&ETHERMIN)) {
    sub ETHERMIN () {	(60-14);}
}
if(defined(&_KERNEL)) {
    eval 'sub ETHER_MAP_IP_MULTICAST {
        local($ipaddr, $enaddr) = @_;
	    eval q({ [0] = 0x01; [1] = 0x00; [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);
}
unless(defined(&arp_hrd)) {
    sub arp_hrd () {	 ($ea_hdr->{ar_hrd});}
}
unless(defined(&arp_pro)) {
    sub arp_pro () {	 ($ea_hdr->{ar_pro});}
}
unless(defined(&arp_hln)) {
    sub arp_hln () {	 ($ea_hdr->{ar_hln});}
}
unless(defined(&arp_pln)) {
    sub arp_pln () {	 ($ea_hdr->{ar_pln});}
}
unless(defined(&arp_op)) {
    sub arp_op () {	 ($ea_hdr->{ar_op});}
}
unless(defined(&la_timer)) {
    sub la_timer () {	 ($la_rt->{rt_rmx}->{rmx_expire});}
}
unless(defined(&SIN_PROXY)) {
    sub SIN_PROXY () {	1;}
}
unless(defined(&RTF_USETRAILERS)) {
    sub RTF_USETRAILERS () {	 &RTF_PROTO1;}
}
unless(defined(&RTF_ANNOUNCE)) {
    sub RTF_ANNOUNCE () {	 &RTF_PROTO2;}
}
unless(defined(&RTF_PERMANENT_ARP)) {
    sub RTF_PERMANENT_ARP () {	 &RTF_PROTO3;}
}
if(defined(&_KERNEL)) {
}
unless(defined(&ETHER_LOOKUP_MULTI)) {
    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_NEXT_MULTI)) {
    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_FIRST_MULTI)) {
    sub ETHER_FIRST_MULTI {
	local($step, $ac, $enm) = @_;
	eval q({ ($step). &e_enm = ($ac)-> ($ac_multiaddrs->{lh_first});  &ETHER_NEXT_MULTI(($step), ($enm)); });
    }
}
if(defined(&_KERNEL)) {
} else {
}
1;
