#undef _far
#define _far 

void	cli(void);
#pragma aux	cli = \
	0xfa		/* cli */ \
	parm	nomemory modify	nomemory;

void	sti(void);
#pragma aux	sti = \
	0xfb		/* sti */ \
	parm	nomemory modify	nomemory;

#define	STI	sti()
#define CLI	cli()

/*
 *	net.c
 */
void Ssetgate(u_long);
void Ssetname(u_long);
u_long Sgetname(void);
u_char * Sgetdomain(void);
u_long Sgetbroadcast(void);
void Sgetether(u_char *);
int Snetinit(void);
void Snetshut(void);
int Socket(u_char, struct sockaddr *, unsigned, struct port *);
int SoBind(int, struct sockaddr *);
int SoListen(int);
int SoAccept(int, struct sockaddr *);
int Sconnect(int, struct sockaddr *);
int SoReceive(int, struct sockaddr *, u_char *, unsigned);
int SoSend(int, struct sockaddr *, u_char *, unsigned);
int SoRead(int, u_char *, unsigned);
int SoWrite(int, u_char *, unsigned);
int SoClose(int);
void SoFree(int);

/*
 *	arp.c
 */
void sendarp(u_char *, u_long, u_long);
u_char * cachelook(u_long);
void arpinterpret(void);

/*
 *	bootp.c
 */
void parse_bootp(struct bootp _far *);
int bootp_process(void);

/*   
 *	dlayer.c
 */
u_char * netdlayer(u_long);
void arpinit(void);

/*
 *	event.c
 */
void neteventinit(void);
void neteventshut(void);

/*
 *	icmp.c
 */
void icmpinterpret(union rawether _far *, unsigned);
void neticmpsend(u_long, u_char, u_char, u_char _far *, unsigned);
void neticmpturn(union rawether _far *, unsigned);

/*
 *	ip.c
 */
void ipinterpret(union rawether _far *, unsigned);

/*
 *	packet.c
 */

/*
 *	pkglue.asm
 */
void arp_receiver(void);
void pkt_receiver(void);
void patch_vec(u_char *);
int driver_info(struct packet_info *);
int access_type(int, int, int, u_char *, u_long, void (*)());
int release_type(int);
int send_pkt(int);
int get_address(int, u_char *, int);
int set_rcv_mode(int, int);

/*
 *	protinit.c
 */
void mbinit(void);
void protinit(void);

/*
 *	rarp.c
 */
int netgetrarp(void);

/*
 *	route.c
 */
u_long find_route(u_long);
void setgate(u_long, u_long);

/*
 *	tcp.c
 */
void tcpinterpret(union rawether _far *, unsigned);
void tcpdo(struct tcpport *, TCPLAYER _far *, unsigned);
void tcpreset(union rawether _far *, unsigned);
void tcpsend(struct tcpport *, unsigned);
void ackcheck(struct tcpport *, TCPLAYER _far *);
void estab1986(struct tcpport *, TCPLAYER _far *, int);

/*
*      tools.c
*/
void tcptick(void);
/* void nettick(void); */

/*
 *	udp.c
 */
void udpinterpret(union rawether _far *, unsigned);

/*
 *	support.asm
 */
u_long n_clicks(void);
u_short ipcheck(struct iph _far *, u_long);
u_short iphcheck(struct iph *);
u_short tcpcheck(struct pseudotcp *, struct tcph _far *, u_long);

/*
 *	sleep.asm
 */
void netsleep(void);

/*
 *	pglue.asm
 */
int pglue_open(u_short, u_short, u_long);
void pglue_close(void);

/*
 *	packet.c
 */
int pkxmit(u_char *ptr, u_long len);
