require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NET_IF_DL_H_)) {
    eval 'sub _NET_IF_DL_H_ () {1;}' unless defined(&_NET_IF_DL_H_);
    require 'sys/ansi.ph';
    unless(defined(&sa_family_t)) {
	eval 'sub sa_family_t () { &__sa_family_t;}' unless defined(&sa_family_t);
    }
    unless(defined(&socklen_t)) {
	eval 'sub socklen_t () { &__socklen_t;}' unless defined(&socklen_t);
    }
    eval 'sub sdl_type () { ($sdl_addr->{dl_type});}' unless defined(&sdl_type);
    eval 'sub sdl_nlen () { ($sdl_addr->{dl_nlen});}' unless defined(&sdl_nlen);
    eval 'sub sdl_alen () { ($sdl_addr->{dl_alen});}' unless defined(&sdl_alen);
    eval 'sub sdl_slen () { ($sdl_addr->{dl_slen});}' unless defined(&sdl_slen);
    eval 'sub sdl_data () { ($sdl_addr->{dl_data});}' unless defined(&sdl_data);
    eval 'sub satosdl {
        my($__sa) = @_;
	    eval q((($__sa)));
    }' unless defined(&satosdl);
    eval 'sub satocsdl {
        my($__sa) = @_;
	    eval q((( &const \'struct sockaddr_dl\' *)($__sa)));
    }' unless defined(&satocsdl);
    eval 'sub LLADDR {
        my($s) = @_;
	    eval q(((($s)-> &sdl_data + ($s)-> &sdl_nlen)));
    }' unless defined(&LLADDR);
    eval 'sub CLLADDR {
        my($s) = @_;
	    eval q((( &const \'char\' *)(($s)-> &sdl_data + ($s)-> &sdl_nlen)));
    }' unless defined(&CLLADDR);
    if(defined(&_KERNEL)) {
    } else {
	require 'sys/cdefs.ph';
    }
    if(defined(&_KERNEL) || defined(&_TEST)) {
	eval 'sub LINK_ADDRSTRLEN () {((255* 4) + 5);}' unless defined(&LINK_ADDRSTRLEN);
	eval 'sub LLA_ADDRSTRLEN () {(16* 3);}' unless defined(&LLA_ADDRSTRLEN);
	eval 'sub DL_PRINT {
	    my($b, $a) = @_;
    	    eval q(( &dl_print(($b), $sizeof{$b}, ($a)), ($b)));
	}' unless defined(&DL_PRINT);
    }
}
1;
