www.pudn.com > tftp.rar > TFTPDEFS.H


/* 
**     This product contains: 
**              "Restricted Materials of IBM" 
**              (c) Copyright IBM Corp. 1987 
**              All Rights Reserved 
**              Licensed Materials-Property of IBM 
** 
**     See Copyright Instructions, G120-2083 
** 
*/ 
 
#ifndef LINT_ARGS 
#define LINT_ARGS 
#endif 
 
#ifndef TFTPDEFS_H 
#define TFTPDEFS_H 
 
#include  
#include  
 
#define	COMMANDLEN		128 
#define HOSTNAMELEN		126 
#define FILENAMELEN 	128 
 
#define A_READ			0x04 
#define A_WRITE			0x02 
#define E_NAMETMO		0x01 
#define E_NAMEUNKNOWN	0x00 
#define S_SPOOL			0x01 
#define S_NOSPOOL		0x00 
#define	F_VERBOSE		0x01 
#define F_TRACE			0x02 
#define F_CLOBBER		0x04 
#define F_EOFMARK		0x08 
#define M_UNDEFINED 	0x00 
#define M_BINARY		OCTET				/* For compatibility */ 
#define M_ASCII			ASCII 
#define D_UNDEFINED 	0x00 
#define D_GET			GET 
#define D_PUT			PUT 
 
enum commands { 
	undefined,		/* undefined state for initializations */ 
	unsupported,	/* unsupported function */ 
	c_serve,		/* server state */ 
	c_spool,		/* spooler state */ 
	c_connect,		/* connect to remote host */ 
	c_mode,			/* change the transfer mode */ 
	c_get,			/* get a file */ 
	c_put,			/* put a file */ 
	c_quit,			/* lets get the ... outta here */ 
	c_verbose,		/* change the talkativeness */ 
	c_trace,		/* give more debug information */ 
	c_clobber,		/* overwrite a file without prompting */ 
	c_eofmark,		/* write ^Z at end of local file */ 
	c_status,		/* lets see the status */ 
	c_binary,		/* change to binary mode */ 
	c_ascii,		/* change to ascii mode */ 
	c_rexmt,		/* retransmit per packet timeout */ 
	c_timeout,		/* total timeout */ 
	c_help,			/* .. */ 
	c_shell,		/* spawn a new shell or execute a command */ 
	c_error			/* .. */ 
}; 
 
struct tftpcon { 
	char hostname[HOSTNAMELEN]; 
	in_name host; 
	unsigned flags; 
	int mode; 
}; 
 
extern struct tftpcon conn; 
 
#define SkipWhite(x) while (isspace(*x) && *x != '\0') x++; 
 
#ifdef LINT_ARGS 
enum commands getcmd( char * ); 
void initialize (char *[]); 
void tfdone (int); 
int tfprint (in_name, char *, int); 
void server (int); 
void connect (char *); 
void chmode (char *); 
void transfer (int, char *); 
void showstats (void); 
void help (void); 
void use (void); 
void usage (void); 
char *getlocal (char *,int); 
char *getforeign (char *); 
#endif  
 
#endif