require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NET_RADIX_H_)) {
    eval 'sub _NET_RADIX_H_ () {1;}' unless defined(&_NET_RADIX_H_);
    eval 'sub RNF_NORMAL () {1;}' unless defined(&RNF_NORMAL);
    eval 'sub RNF_ROOT () {2;}' unless defined(&RNF_ROOT);
    eval 'sub RNF_ACTIVE () {4;}' unless defined(&RNF_ACTIVE);
    if(defined(&RN_DEBUG)) {
    }
    eval 'sub rn_dupedkey () { ($rn_u->{rn_leaf}->{rn_Dupedkey});}' unless defined(&rn_dupedkey);
    eval 'sub rn_key () { ($rn_u->{rn_leaf}->{rn_Key});}' unless defined(&rn_key);
    eval 'sub rn_mask () { ($rn_u->{rn_leaf}->{rn_Mask});}' unless defined(&rn_mask);
    eval 'sub rn_off () { ($rn_u->{rn_node}->{rn_Off});}' unless defined(&rn_off);
    eval 'sub rn_l () { ($rn_u->{rn_node}->{rn_L});}' unless defined(&rn_l);
    eval 'sub rn_r () { ($rn_u->{rn_node}->{rn_R});}' unless defined(&rn_r);
    eval 'sub rm_mask () { ($rm_rmu->{rmu_mask});}' unless defined(&rm_mask);
    eval 'sub rm_leaf () { ($rm_rmu->{rmu_leaf});}' unless defined(&rm_leaf);
    eval 'sub MKGet {
        my($m) = @_;
	    eval q({  &if ( &rn_mkfreelist) { $m =  &rn_mkfreelist;  &rn_mkfreelist = ($m)-> &rm_mklist; }  &else  &R_Malloc($m, \'struct radix_mask\' *, $sizeof{($m)}); });
    }' unless defined(&MKGet);
    eval 'sub MKFree {
        my($m) = @_;
	    eval q({ ($m)-> &rm_mklist =  &rn_mkfreelist;  &rn_mkfreelist = ($m);});
    }' unless defined(&MKFree);
    if(defined(&_KERNEL)) {
	eval 'sub Bcmp {
	    my($a, $b, $n) = @_;
    	    eval q( &bcmp((), (), ($n)));
	}' unless defined(&Bcmp);
	eval 'sub Bcopy {
	    my($a, $b, $n) = @_;
    	    eval q( &bcopy((), (), ($n)));
	}' unless defined(&Bcopy);
	eval 'sub Bzero {
	    my($p, $n) = @_;
    	    eval q( &bzero(, ($n)););
	}' unless defined(&Bzero);
	eval 'sub R_Malloc {
	    my($p, $t, $n) = @_;
    	    eval q(($p = ($t)  &malloc(($n),  &M_RTABLE,  &M_DONTWAIT)));
	}' unless defined(&R_Malloc);
	eval 'sub Free {
	    my($p) = @_;
    	    eval q( &free($p,  &M_RTABLE););
	}' unless defined(&Free);
    }
}
1;
