require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NFS_NFS_H_)) {
    eval 'sub _NFS_NFS_H_ () {1;}' unless defined(&_NFS_NFS_H_);
    eval 'sub NFS_MAXIOVEC () {34;}' unless defined(&NFS_MAXIOVEC);
    eval 'sub NFS_TICKINTVL () {5;}' unless defined(&NFS_TICKINTVL);
    eval 'sub NFS_HZ () {( &hz /  &nfs_ticks);}' unless defined(&NFS_HZ);
    eval 'sub NFS_TIMEO () {(1*  &NFS_HZ);}' unless defined(&NFS_TIMEO);
    eval 'sub NFS_MINTIMEO () {(1*  &NFS_HZ);}' unless defined(&NFS_MINTIMEO);
    eval 'sub NFS_MAXTIMEO () {(60*  &NFS_HZ);}' unless defined(&NFS_MAXTIMEO);
    eval 'sub NFS_MINIDEMTIMEO () {(5*  &NFS_HZ);}' unless defined(&NFS_MINIDEMTIMEO);
    eval 'sub NFS_TIMEOUTMUL () {2;}' unless defined(&NFS_TIMEOUTMUL);
    eval 'sub NFS_MAXREXMIT () {100;}' unless defined(&NFS_MAXREXMIT);
    eval 'sub NFS_MAXWINDOW () {1024;}' unless defined(&NFS_MAXWINDOW);
    eval 'sub NFS_RETRANS () {10;}' unless defined(&NFS_RETRANS);
    eval 'sub NFS_MAXGRPS () {16;}' unless defined(&NFS_MAXGRPS);
    unless(defined(&NFS_MINATTRTIMO)) {
	eval 'sub NFS_MINATTRTIMO () {5;}' unless defined(&NFS_MINATTRTIMO);
    }
    unless(defined(&NFS_MAXATTRTIMO)) {
	eval 'sub NFS_MAXATTRTIMO () {60;}' unless defined(&NFS_MAXATTRTIMO);
    }
    eval 'sub NFS_WSIZE () {8192;}' unless defined(&NFS_WSIZE);
    eval 'sub NFS_RSIZE () {8192;}' unless defined(&NFS_RSIZE);
    eval 'sub NFS_READDIRSIZE () {8192;}' unless defined(&NFS_READDIRSIZE);
    eval 'sub NFS_DEFRAHEAD () {1;}' unless defined(&NFS_DEFRAHEAD);
    eval 'sub NFS_MAXRAHEAD () {4;}' unless defined(&NFS_MAXRAHEAD);
    eval 'sub NFS_MAXUIDHASH () {64;}' unless defined(&NFS_MAXUIDHASH);
    eval 'sub NFS_MAXASYNCDAEMON () {20;}' unless defined(&NFS_MAXASYNCDAEMON);
    eval 'sub NFS_MAXGATHERDELAY () {100;}' unless defined(&NFS_MAXGATHERDELAY);
    unless(defined(&NFS_GATHERDELAY)) {
	eval 'sub NFS_GATHERDELAY () {10;}' unless defined(&NFS_GATHERDELAY);
    }
    eval 'sub NFS_DIRBLKSIZ () {1024;}' unless defined(&NFS_DIRBLKSIZ);
    eval 'sub NFS_READDIRBLKSIZ () {512;}' unless defined(&NFS_READDIRBLKSIZ);
    eval 'sub NMOD {
        my($a) = @_;
	    eval q((($a) %  &nfs_asyncdaemons));
    }' unless defined(&NMOD);
    eval 'sub NFS_CMPFH {
        my($n, $f, $s) = @_;
	    eval q((-> &n_fhsize ==  && ! &bcmp(-> &n_fhp, ($f), ($s))));
    }' unless defined(&NFS_CMPFH);
    eval 'sub NFS_ISV3 {
        my($v) = @_;
	    eval q(( &VFSTONFS(($v)-> &v_mount)-> &nm_flag &  &NFSMNT_NFSV3));
    }' unless defined(&NFS_ISV3);
    eval 'sub NFS_SRVMAXDATA {
        my($n) = @_;
	    eval q(((($n)-> &nd_flag &  &ND_NFSV3) ? ((($n)-> &nd_nam2) ?  &NFS_MAXDGRAMDATA :  &NFS_MAXDATA) :  &NFS_V2MAXDATA));
    }' unless defined(&NFS_SRVMAXDATA);
    unless(defined(&M_NFSRVDESC)) {
	eval 'sub M_NFSRVDESC () { &M_TEMP;}' unless defined(&M_NFSRVDESC);
    }
    unless(defined(&M_NFSDIROFF)) {
	eval 'sub M_NFSDIROFF () { &M_TEMP;}' unless defined(&M_NFSDIROFF);
    }
    unless(defined(&M_NFSBIGFH)) {
	eval 'sub M_NFSBIGFH () { &M_TEMP;}' unless defined(&M_NFSBIGFH);
    }
    unless(defined(&VA_EXCLUSIVE)) {
	eval 'sub VA_EXCLUSIVE () {0;}' unless defined(&VA_EXCLUSIVE);
    }
    eval 'sub B_INVAFTERWRITE () { &B_INVAL;}' unless defined(&B_INVAFTERWRITE);
    unless(defined(&IO_METASYNC)) {
	eval 'sub IO_METASYNC () {0;}' unless defined(&IO_METASYNC);
    }
    if(0) {
	eval 'sub NFS_ATTRTIMEO {
	    my($np) = @_;
    	    eval q((((($np)-> &n_flag &  &NMODIFIED) || ( &time_second - ($np)-> &n_mtime) / 10<  &NFS_MINATTRTIMO) ?  &NFS_MINATTRTIMO : (( &time_second - ($np)-> &n_mtime) / 10>  &NFS_MAXATTRTIMO ?  &NFS_MAXATTRTIMO : ( &time_second - ($np)-> &n_mtime) / 10)));
	}' unless defined(&NFS_ATTRTIMEO);
    }
    eval 'sub NFSSVC_BIOD () {0x2;}' unless defined(&NFSSVC_BIOD);
    eval 'sub NFSSVC_NFSD () {0x4;}' unless defined(&NFSSVC_NFSD);
    eval 'sub NFSSVC_ADDSOCK () {0x8;}' unless defined(&NFSSVC_ADDSOCK);
    eval 'sub NFSSVC_AUTHIN () {0x10;}' unless defined(&NFSSVC_AUTHIN);
    eval 'sub NFSSVC_GOTAUTH () {0x40;}' unless defined(&NFSSVC_GOTAUTH);
    eval 'sub NFSSVC_AUTHINFAIL () {0x80;}' unless defined(&NFSSVC_AUTHINFAIL);
    eval 'sub NFSSVC_MNTD () {0x100;}' unless defined(&NFSSVC_MNTD);
    eval 'sub NFS_NFSSTATS () {1;}' unless defined(&NFS_NFSSTATS);
    eval 'sub NFS_NIOTHREADS () {2;}' unless defined(&NFS_NIOTHREADS);
    eval 'sub NFS_MAXID () {3;}' unless defined(&NFS_MAXID);
    eval 'sub FS_NFS_NAMES () {{ { 0, 0}, { "nfsstats",  &CTLTYPE_STRUCT }, { "iothreads",  &CTLTYPE_INT } };}' unless defined(&FS_NFS_NAMES);
    if(defined(&_KERNEL)) {
	eval 'sub NFSINT_SIGMASK () {( &sigmask( &SIGINT)| &sigmask( &SIGTERM)| &sigmask( &SIGKILL)|  &sigmask( &SIGHUP)| &sigmask( &SIGQUIT));}' unless defined(&NFSINT_SIGMASK);
	eval 'sub NFSIGNORE_SOERROR {
	    my($s, $e) = @_;
    	    eval q((($e) !=  &EINTR  && ($e) !=  &ERESTART  && ($e) !=  &EWOULDBLOCK  && (($s) &  &PR_CONNREQUIRED) == 0));
	}' unless defined(&NFSIGNORE_SOERROR);
	eval 'sub R_TIMING () {0x1;}' unless defined(&R_TIMING);
	eval 'sub R_SENT () {0x2;}' unless defined(&R_SENT);
	eval 'sub R_SOFTTERM () {0x4;}' unless defined(&R_SOFTTERM);
	eval 'sub R_INTR () {0x8;}' unless defined(&R_INTR);
	eval 'sub R_SOCKERR () {0x10;}' unless defined(&R_SOCKERR);
	eval 'sub R_TPRINTFMSG () {0x20;}' unless defined(&R_TPRINTFMSG);
	eval 'sub R_MUSTRESEND () {0x40;}' unless defined(&R_MUSTRESEND);
	eval 'sub R_GETONEREP () {0x80;}' unless defined(&R_GETONEREP);
	unless(defined(&NFS_UIDHASHSIZ)) {
	    eval 'sub NFS_UIDHASHSIZ () {29;}' unless defined(&NFS_UIDHASHSIZ);
	}
	eval 'sub NUIDHASH {
	    my($sock, $uid) = @_;
    	    eval q((($sock)-> $ns_uidhashtbl[($uid) %  &NFS_UIDHASHSIZ]));
	}' unless defined(&NUIDHASH);
	unless(defined(&NFS_WDELAYHASHSIZ)) {
	    eval 'sub NFS_WDELAYHASHSIZ () {16;}' unless defined(&NFS_WDELAYHASHSIZ);
	}
	eval 'sub NWDELAYHASH {
	    my($sock, $f) = @_;
    	    eval q((($sock)-> $ns_wdelayhashtbl[(*(( &u_int32_t *)($f))) %  &NFS_WDELAYHASHSIZ]));
	}' unless defined(&NWDELAYHASH);
	unless(defined(&NFS_MUIDHASHSIZ)) {
	    eval 'sub NFS_MUIDHASHSIZ () {67;}' unless defined(&NFS_MUIDHASHSIZ);
	}
	eval 'sub NMUIDHASH {
	    my($nmp, $uid) = @_;
    	    eval q((($nmp)-> $nm_uidhashtbl[($uid) %  &NFS_MUIDHASHSIZ]));
	}' unless defined(&NMUIDHASH);
	eval 'sub NFSNOHASH {
	    my($fhsum) = @_;
    	    eval q(( $nfsnodehashtbl[($fhsum) &  &nfsnodehash]));
	}' unless defined(&NFSNOHASH);
	eval 'sub nu_inetaddr () { ($nu_haddr->{had_inetaddr});}' unless defined(&nu_inetaddr);
	eval 'sub nu_nam () { ($nu_haddr->{had_nam});}' unless defined(&nu_nam);
	eval 'sub NU_INETADDR () {0x1;}' unless defined(&NU_INETADDR);
	eval 'sub NU_NAM () {0x2;}' unless defined(&NU_NAM);
	eval 'sub NU_NETFAM {
	    my($u) = @_;
    	    eval q(((($u)-> &nu_flag &  &NU_INETADDR) ?  &AF_INET :  &AF_ISO));
	}' unless defined(&NU_NETFAM);
	eval 'sub SLP_VALID () {0x1;}' unless defined(&SLP_VALID);
	eval 'sub SLP_DOREC () {0x2;}' unless defined(&SLP_DOREC);
	eval 'sub SLP_NEEDQ () {0x4;}' unless defined(&SLP_NEEDQ);
	eval 'sub SLP_DISCONN () {0x8;}' unless defined(&SLP_DISCONN);
	eval 'sub SLP_GETSTREAM () {0x10;}' unless defined(&SLP_GETSTREAM);
	eval 'sub SLP_LASTFRAG () {0x20;}' unless defined(&SLP_LASTFRAG);
	eval 'sub SLP_ALLFLAGS () {0xff;}' unless defined(&SLP_ALLFLAGS);
	eval 'sub SLP_INIT () {0x1;}' unless defined(&SLP_INIT);
	eval 'sub SLP_WANTINIT () {0x2;}' unless defined(&SLP_WANTINIT);
	eval 'sub NFSD_WAITING () {0x1;}' unless defined(&NFSD_WAITING);
	eval 'sub NFSD_REQINPROG () {0x2;}' unless defined(&NFSD_REQINPROG);
	eval 'sub NFSD_NEEDAUTH () {0x4;}' unless defined(&NFSD_NEEDAUTH);
	eval 'sub NFSD_AUTHFAIL () {0x8;}' unless defined(&NFSD_AUTHFAIL);
	eval 'sub ND_NFSV3 () {0x8;}' unless defined(&ND_NFSV3);
	eval 'sub ND_KERBNICK () {0x20;}' unless defined(&ND_KERBNICK);
	eval 'sub ND_KERBFULL () {0x40;}' unless defined(&ND_KERBFULL);
	eval 'sub ND_KERBAUTH () {( &ND_KERBNICK |  &ND_KERBFULL);}' unless defined(&ND_KERBAUTH);
	eval 'sub NFSD_CHECKSLP () {0x1;}' unless defined(&NFSD_CHECKSLP);
	eval 'sub NFSW_CONTIG {
	    my($o, $n) = @_;
    	    eval q((($o)-> &nd_eoff >= ($n)-> &nd_off  && ! &bcmp(($o)-> &nd_fh, ($n)-> &nd_fh,  &NFSX_V3FH)));
	}' unless defined(&NFSW_CONTIG);
	eval 'sub NFSW_SAMECRED {
	    my($o, $n) = @_;
    	    eval q(((($o)-> &nd_flag &  &ND_KERBAUTH) == (($n)-> &nd_flag &  &ND_KERBAUTH)  && ! &bcmp(($o)-> &nd_cr, ($n)-> &nd_cr, $sizeof{\'struct ucred\'})));
	}' unless defined(&NFSW_SAMECRED);
    }
}
1;
