home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
internet
/
netlite
/
NET
/
h
/
NETUSER
< prev
next >
Wrap
Text File
|
1993-04-03
|
2KB
|
52 lines
/* Global structures and constants needed by an Internet user process */
extern char hosts[]; /* Host table */
#define NCONN 20 /* Maximum number of open network connections */
extern int32 ip_addr; /* Our IP address */
extern int net_error; /* Error return code */
#define NONE 0 /* No error */
#define CON_EXISTS 1 /* Connection already exists */
#define NO_CONN 2 /* Connection does not exist */
#define CON_CLOS 3 /* Connection closing */
#define NO_SPACE 4 /* No memory for TCB creation */
#define WOULDBLK 5 /* Would block */
#define NOPROTO 6 /* Protocol or mode not supported */
#define INVALID 7 /* Invalid arguments */
/* Codes for the tcp_open call */
#define TCP_PASSIVE 0
#define TCP_ACTIVE 1
#define TCP_SERVER 2 /* Passive, clone on opening */
/* Socket structure */
struct socket {
int32 address; /* IP address */
int16 port; /* port number */
};
/* Connection structure (two sockets) */
struct connection {
struct socket local;
struct socket remote;
};
#define NULLSOCK (struct socket *)0
extern char hosts[];
/* TCP port numbers */
#define FTPD_PORT 20 /* FTP Data port */
#define FTP_PORT 21 /* FTP Control port */
#define TELNET_PORT 23 /* Telnet port */
#define SMTP_PORT 25 /* Mail port */
#define NNTP_PORT 119 /* Network News Port */
#define FINGER_PORT 79 /* TCP port for `who' (finger) service */
#define DOMAIN_PORT 53 /* Domain name server port */
int32 aton(char *);
char *inet_ntoa(int32);
int32 resolve(char *);
char *psocket(struct socket *);
long htol(char *);