Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Nov 1995 19:21:06 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Subject:   RPC oddities
Message-ID:  <199511041821.TAA02527@uriah.heep.sax.de>

next in thread | raw e-mail | index | archive | help
<rpc/rpc.h> includes definitions for several constants that are inside
enum's.  To the contrary, <nfs/rpcv2.h> #define's just the very same
constants.  The result is that the compiler sees something like:

enum auth_stat {
        AUTH_OK=0,
         

        1 =1,                    
        AUTH_REJECTEDCRED=2,             
        3 =3,                    
        AUTH_REJECTEDVERF=4,             
        5 =5,                    
         

        AUTH_INVALIDRESP=6,              
        AUTH_FAILED=7                    
};

or even worse:

enum clnt_stat {
        RPC_SUCCESS=0,                   
         

        RPC_CANTENCODEARGS=1,            
        RPC_CANTDECODERES=2,             
        RPC_CANTSEND=3,                  
        RPC_CANTRECV=4,                  
        RPC_TIMEDOUT=5,                  
         

        RPC_VERSMISMATCH=6,              
        RPC_AUTHERROR=7,                 
        1 =8,            
        RPC_PROGVERSMISMATCH=9,          
        3 =10,           
...
};


What would be the correct way to resolve the conflicts?

The number of prerequisites to succesfully #include <nfs/nfs.h> is
ridiculous.  nfsd.c uses for example:

#include <sys/param.h>
#include <sys/syslog.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/uio.h>
#include <sys/ucred.h>
#include <sys/mount.h>
#include <sys/socket.h>
#include <sys/socketvar.h>

#include <rpc/rpc.h>
#include <rpc/pmap_clnt.h>
#include <rpc/pmap_prot.h>

#ifdef ISO
#include <netiso/iso.h>
#endif
#include <nfs/rpcv2.h>
#include <nfs/nfsproto.h>
#include <nfs/nfs.h>

I have yet to find which of them could be omitted; but it seems that
at least half a dozen of headers will remain in the list. :-(

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511041821.TAA02527>