# 1 "../rpc_eth_dummy.c"
 

















# 1 "/usr/include/stdio.h"
 













# 1 "/usr/include/stddef.h"
 











typedef long ptrdiff_t;


typedef unsigned long size_t;

typedef unsigned short wchar_t;



extern int errno;


# 15 "/usr/include/stdio.h"

# 1 "/usr/include/stdarg.h"



 


typedef char *va_list;

 








void va_end (va_list);		 









# 16 "/usr/include/stdio.h"




extern	struct	_iobuf {
	int	_cnt;
	char	*_ptr;		 
	char	*_base;		 
	int	_bufsiz;
	short	_flag;
	char	_file;		 
	char	_smallbuf;	 
} _iob[];

















# 56 "/usr/include/stdio.h"

typedef long fpos_t;










extern int remove(const char *filename);
extern int rename(const char *old, const char *new);
extern struct _iobuf  *tmpfile(void);
extern char *tmpnam(char *s);
extern int fclose(struct _iobuf  *stream);
extern int fflush(struct _iobuf  *stream);
extern void setbuf(struct _iobuf  *stream, char *buf);
extern int setvbuf(struct _iobuf  *stream, char *buf, int mode, size_t size);
extern int fprintf(struct _iobuf  *stream, const char *format, ...);
extern int fscanf(struct _iobuf  *stream, const char *format, ...);
extern int printf(const char *format, ...);
extern int scanf(const char *format, ...);
extern int sprintf(char *s, const char *format, ...);
extern int sscanf(const char *s, const char *format, ...);
extern int vfprintf(struct _iobuf  *stream, const char *format, va_list arg);
extern int vprintf(const char *format, va_list arg);
extern int vsprintf(char *s, const char *format, va_list arg);
extern int fgetc(struct _iobuf  *stream);
extern int fputc(int c, struct _iobuf  *stream);
extern int fputs(const char *s, struct _iobuf  *stream);
extern int getc(struct _iobuf  *stream);
extern int _flsbuf();
extern int _filbuf();
extern int getchar(void);
extern int putc(int c, struct _iobuf  *stream);
extern int putchar(int c);
extern int puts(const char *s);
extern int ungetc(int c, struct _iobuf  *stream);
extern size_t fread(void *ptr, size_t size, size_t nmemb, struct _iobuf  *stream);
extern size_t fwrite(const void *ptr, size_t size, size_t nmemb, struct _iobuf  *stream);
extern int fgetpos(struct _iobuf  *stream, fpos_t *pos);
extern int fseek(struct _iobuf  *stream, long int offset, int whence);
extern int fsetpos(struct _iobuf  *stream, const fpos_t *pos);
extern void rewind(struct _iobuf  *stream);
extern void clearerr(struct _iobuf  *stream);
extern int feof(struct _iobuf  *stream);
extern int ferror(struct _iobuf  *stream);
extern void perror(const char *s);
extern struct _iobuf  *fopen(const char *filename, const char *mode);
extern struct _iobuf  *freopen(const char *filename, const char *mode, struct _iobuf  *stream);
extern long int ftell(struct _iobuf  *stream);
extern char *fgets(char *s, int n, struct _iobuf  *stream);
extern char *gets(char *s);





















 
extern int fileno(struct _iobuf  *stream);


struct _iobuf 	*fdopen(int filedes, const char *mode);



struct _iobuf 	*popen(const char *command, const char *mode);



# 19 "../rpc_eth_dummy.c"





# 1 "../syspec.h"
 


 





















# 1 "../unix_specific.h"
 




# 26 "../syspec.h"

















# 24 "../rpc_eth_dummy.c"

# 1 "../rpcrts.h"
 

















































 


























 

























 



















































 







































 




typedef unsigned char   rpc_boolean;
typedef unsigned char   rpc_byte;
typedef char		rpc_char;
typedef short		rpc_short;
typedef long		rpc_long;
typedef int		rpc_integer;	     
typedef float		rpc_real32;
typedef double		rpc_real48;	     
typedef double		rpc_real64;	     
typedef double		rpc_real128;	     

typedef void		(*rpc_pointer)();    
typedef rpc_long	rpc_status;	     

 




typedef char		rpc_name[        40      +1];


 




typedef struct { rpc_byte     h, l; }   courier_word;
typedef struct { courier_word h, l; }   courier_long;

 

typedef struct rpc_message_struct *rpc_message_pointer;


 








typedef struct socket_struct *    socket_type;    





# 1 "../rpc_ts.h"
 












 









 

# 34 "../rpc_ts.h"


 



# 1 "/usr/include/sys/types.h"
 





 










































 









 



 


 


 


typedef	unsigned char	u_char;
typedef	unsigned short	u_short;
typedef	unsigned int	u_int;
typedef	unsigned long	u_long;
typedef	unsigned short	ushort;		 














typedef struct  _physadr { short r[1]; } *physadr;
typedef struct  label_t {
        int     val[13];
} label_t;




typedef	struct	_quad { long val[2]; } quad;

typedef	long	daddr_t;
typedef	char *	caddr_t;
typedef	u_long	ino_t;










typedef	long	time_t;

typedef	short	dev_t;



typedef	long	off_t;

typedef	u_short	uid_t;
typedef	u_short	gid_t;


 









typedef long	fd_mask;





typedef	struct fd_set {
	fd_mask	fds_bits[(((256 )+(( (sizeof(fd_mask) * 8		)	)-1))/( (sizeof(fd_mask) * 8		)	)) ];
} fd_set;









# 40 "../rpc_ts.h"

# 1 "/usr/include/sys/socket.h"
 





 
 







 






 








 












 











 


struct	linger {
	int	l_onoff;		 
	int	l_linger;		 
};

 




 






















 



struct sockaddr {
	u_short	sa_family;		 
	char	sa_data[14];		 
};

 



struct sockproto {
	u_short	sp_family;		 
	u_short	sp_protocol;		 
};

 






















 




 


struct msghdr {
	caddr_t	msg_name;		 
	int	msg_namelen;		 
	struct	iovec *msg_iov;		 
	int	msg_iovlen;		 
	caddr_t	msg_accrights;		 
	int	msg_accrightslen;
};








extern int accept(int, struct sockaddr *, int *);
extern int bind(int, struct sockaddr *, int);
extern int connect(int, struct sockaddr *, int);
extern int getpeername(int, struct sockaddr *, int *);
extern int getsockname(int, struct sockaddr *, int *);
extern int getsockopt(int, int, int, void *optval, int *);
extern int setsockopt(int, int, int, void *optval, int);
extern int listen(int, int);
extern int recv(int, void *, int, int);
extern int recvfrom(int, void *, int, int, struct sockaddr *, int *);
extern int recvmsg(int, struct msghdr *, int);
extern int send(int, void *, int, int);
extern int sendto(int, void *, int, int, struct sockaddr *, int);
extern int sendmsg(int, struct msghdr *, int);
extern int socket(int, int, int);
extern int socketpair(int, int, int, int *);


# 41 "../rpc_ts.h"

# 1 "/usr/include/netinet/in.h"
 





 











 
 



 

 




 















 








 






 


struct in_addr {

	union {
		struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
		struct { u_short s_w1,s_w2; } S_un_w;
		u_long S_addr;
	} S_un;









};

 



































 


struct sockaddr_in {
	short	sin_family;
	u_short	sin_port;
	struct	in_addr sin_addr;
	char	sin_zero[8];
};

 




 




# 171 "/usr/include/netinet/in.h"


# 42 "../rpc_ts.h"

# 1 "/usr/include/arpa/inet.h"
 







 



unsigned long inet_addr();
char	*inet_ntoa();
struct	in_addr inet_makeaddr();
unsigned long inet_network();
# 43 "../rpc_ts.h"

# 1 "/usr/include/netdb.h"
 
 







 






struct	hostent {
	char	*h_name;	 
	char	**h_aliases;	 
	int	h_addrtype;	 
	int	h_length;	 
	char	**h_addr_list;	 

};

 



struct	netent {
	char		*n_name;	 
	char		**n_aliases;	 
	int		n_addrtype;	 
	unsigned long	n_net;		 
};

struct	servent {
	char	*s_name;	 
	char	**s_aliases;	 
	int	s_port;		 
	char	*s_proto;	 
};

struct	protoent {
	char	*p_name;	 
	char	**p_aliases;	 
	int	p_proto;	 
};

struct rpcent {
        char    *r_name;         
        char    **r_aliases;     
        int     r_number;        
};

struct hostent	*gethostbyname(), *gethostbyaddr(), *gethostent();
struct netent	*getnetbyname(), *getnetbyaddr(), *getnetent();
struct servent	*getservbyname(), *getservbyport(), *getservent();
struct protoent	*getprotobyname(), *getprotobynumber(), *getprotoent();
struct rpcent   *getrpcbyname(), *getrpcbynumber(), *getrpcent();

 



extern  int h_errno;	





# 44 "../rpc_ts.h"

# 1 "/usr/include/errno.h"
 







# 1 "/usr/include/sys/errno.h"
 





 
 







 




 




































 



 




 

	 













	 













	 



 




 




 
 


 

 
 


 

 




 






# 1 "/usr/include/stddef.h"
 

# 24 "/usr/include/stddef.h"

# 135 "/usr/include/sys/errno.h"


extern void perror(const char *);
extern char *sys_errlist[];
extern int sys_nerr;


# 9 "/usr/include/errno.h"






# 1 "/usr/include/stddef.h"
 

# 24 "/usr/include/stddef.h"

# 15 "/usr/include/errno.h"



# 45 "../rpc_ts.h"

# 1 "/usr/include/sys/time.h"
 





 











 









 



struct timeval {
	long	tv_sec;		 
	long	tv_usec;	 
};

struct timezone {
	int	tz_minuteswest;	 
	int	tz_dsttime;	 
};








 










 







struct	itimerval {
	struct	timeval it_interval;	 
	struct	timeval it_value;	 
};


# 1 "/usr/include/time.h"
 







 





# 1 "/usr/include/stddef.h"
 

# 24 "/usr/include/stddef.h"

# 15 "/usr/include/time.h"



typedef unsigned long int clock_t;







 


struct tm {
	int	tm_sec;
	int	tm_min;
	int	tm_hour;
	int	tm_mday;
	int	tm_mon;
	int	tm_year;
	int	tm_wday;
	int	tm_yday;
	int	tm_isdst;
	long	tm_gmtoff;
	char	*tm_zone;
};





 
clock_t clock(void);
double difftime(time_t time1, time_t time0);
time_t mktime(struct tm *timeptr);
size_t strftime(char *s, size_t maxsize,
	const char *format, const struct tm *timeptr);

 
time_t time(time_t *timer);
char *asctime(const struct tm *timeptr);
char *ctime(const time_t *timer);
struct tm *gmtime(const time_t *timer);
struct tm *localtime(const time_t *timer);



# 75 "/usr/include/sys/time.h"


# 92 "/usr/include/sys/time.h"



extern int adjtime(struct timeval *, struct timeval *);
extern int getitimer(int, struct itimerval *);
extern int setitimer(int, struct itimerval *, struct itimerval *);
extern int gettimeofday(struct timeval *, struct timezone *);
extern int settimeofday(struct timeval *, struct timezone *);
extern int utimes(const char *, struct timeval *);


# 46 "../rpc_ts.h"



 













 









                                                                            
                             





typedef union {












	        struct { rpc_byte dummy[12];	 
			 unsigned long length;	 
		} ip;

        } protocol_header;


 
 
# 143 "../rpc_ts.h"




 


















typedef enum {single, transient, slave, master, passive} socket_role;

typedef struct socket_struct {
    socket_type             soc_next;              
    rpc_pointer		    soc_astadr;		   
    rpc_message_pointer     soc_astprm;            

    rpc_message_pointer     soc_last_call_sent;    
    rpc_message_pointer     soc_last_reply_sent;   
    short int		    soc_next_call_tid;     
    unsigned long	    soc_efn;               




    struct rpc_protocol_struct * soc_protocol;	    



 

    union {					     






# 206 "../rpc_ts.h"


# 243 "../rpc_ts.h"


      struct {				     
	    socket_role	    soc_role;
	    socket_type	    soc_master;	   
	    socket_type	    soc_slaves;    
	    rpc_message_pointer soc_message;   
	    rpc_boolean	    soc_connected;
	    struct sockaddr_in  soc_address;   
	    int		    soc_addrlen;
	    int		    soc_s;	   
      } soc_tcp; 

    } mdp;	 

}       socket_descriptor;

 










struct rpc_protocol_struct {
    struct rpc_protocol_struct *next;    
    char *	    name;	     
    int		    reliable;	     

 



    rpc_status (*open)(		     
        socket_type	psocket,     
        char *          service);    

    rpc_status (*close)(	     
	socket_type socket);	     

    rpc_status (*write)(	     
	rpc_message_pointer * ppmes);     

    rpc_status (*read)(		      
	rpc_message_pointer * ppmes,  
        int		    timeout); 
    
    rpc_status (*aread)(	     
	rpc_message_pointer pmessage,   
	rpc_pointer	action,	     
	rpc_integer	user_1);     

    rpc_status (*my_address)(     
        socket_type     socket,	     
        char *          addrstr,     
	rpc_integer	addrlen);    

    rpc_status (*peer_address)(   
        socket_type     socket,	     
        char *          addrstr,     
	rpc_integer	addrlen);    

# 317 "../rpc_ts.h"


};  

typedef struct rpc_protocol_struct rpc_protocol;
 


 











 extern rpc_status
rpc_use(rpc_protocol * protocol);




# 251 "../rpcrts.h"





 











typedef rpc_short   message_type;	     

typedef struct rpc_message_struct {

     

    rpc_message_pointer m_next;	     
    rpc_status	    m_status;	     
    socket_type	    m_socket;	     
    rpc_long	    m_index;	     

     

    protocol_header	    header;

     

    union {
	rpc_byte	    rpc_b[	1500    ];	 
	rpc_char	    rpc_ch[	1500    ];	 
	message_type    which;

 





	struct {
	    message_type	call_which;
	    courier_word	call_transaction_id;
	    courier_long	program_number;
	    courier_word	version_number;
	    courier_word	procedure_number;
	 } cal;

	struct {
	    message_type	reject_which;
	    courier_word	reject_transaction_id;
	    courier_word	why;
	    courier_long	reject_status;
	} rej;

	struct {
	    message_type	return_which;
	    courier_word	return_transaction_id;
	} ret;
			     
	struct {
	    message_type	abort_which;
	    courier_word	abort_transaction_id;
	    courier_word	abort_code;
	} abt;
    } body;
} rpc_message;

 













typedef rpc_long    program_index;
typedef rpc_long    rpc_handle;

 





 
























# 381 "../rpcrts.h"




















# 416 "../rpcrts.h"





 







 






# 455 "../rpcrts.h"
















# 25 "../rpc_eth_dummy.c"

# 1 "../rpc_code.h"
 









 































typedef char	BOOLEAN;		 





 



extern BOOLEAN  rpc_trace;	 
extern struct _iobuf 	    *tfp;	 






# 26 "../rpc_eth_dummy.c"


 


    int		    eth_usage;	     


 







   
			 rpc_status rpc_eth_init()
{
    eth_usage = 0;
    if (rpc_trace) fprintf	(tfp, "rpc_eth_init() called.\n");
    return    1               ;
}

 







   
			 rpc_status rpc_eth_open(psocket)
	socket_type	psocket;
{
        register socket_type    soc = psocket;
        int eth_status;

	if (rpc_trace) fprintf	(tfp, "rpc_th_open(%lx)\n", (long int)psocket);
	dump_socket(psocket);
	return    1               ;
}
 
 










   
			 rpc_eth_close(soc)
    socket_type	soc;
{
    eth_usage = eth_usage - 1;
    if (rpc_trace) fprintf	(tfp, "rpc_eth_close(%lx)\n", (long int)soc);
    return    1               ;
}

 
















			 rpc_status rpc_eth_send(mes)
        rpc_message_pointer mes;
{
    int			    bufsize = (int)mes->m_index;
    register socket_type    soc = mes->m_socket;

    if (rpc_trace) fprintf	(tfp, "rpc_eth_send(%lx)\n", (long int)mes);
    dump_message(mes);
    return    1               ;
}
 
 
 
























			 rpc_status rpc_eth_receive(ppmessage, timeout)
        rpc_message_pointer     *ppmessage;
        int			timeout;
{

    register rpc_message *mes = *ppmessage;
    register socket_type soc =  mes->m_socket;
    if (rpc_trace) fprintf	(tfp, "rpc_eth_receive(%lx->%lx, %x)\n",
	(long int)ppmessage, (long int)*ppmessage, timeout);
    dump_message(mes);



    (*ppmessage)->body.rpc_b[1] = 2;	 
    return (   1               );	 

}

 












rpc_status rpc_eth_my_address(		     
    rpc_ethernet_address	host)	     




{
    rpc_byte i;
    for (i=0; i<6; i++)
	host[i] = (i*34)+18;		     

    return    1               ;
}

# 210 "../rpc_eth_dummy.c"

