#ifndef CLIB_NETLIB_PROTOS_H
#define CLIB_NETLIB_PROTOS_H \
       "$Id: netlib_protos.h,v 4.3 1994/10/03 20:54:51 ppessi Exp $"
/*
 *	Prototypes for netlib utility functions
 *
 *	Copyright © 1994 AmiTCP/IP Group,
 *			 Network Solutions Development, Inc.
 *			 All rights reserved.
 */

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
#ifndef EXEC_LIBRARIES_H
struct Library;
#endif
#ifndef SYS_TIME_H
#include <sys/time.h>
#endif
#ifndef SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifndef NETDB_H
struct hostent;
struct netent;
struct servent;
struct protoent;
#endif
#ifndef NETINET_IN_H
#include <netinet/in.h>
#endif
#ifndef DOS_DOS_H
#include <dos/dos.h>
#endif
#ifndef DOS_RDARGS_H
#include <dos/rdargs.h>
#endif
#ifndef SYS_STAT_H
#include <sys/stat.h>
#endif

#ifndef _STDARG_H
#include <stdarg.h>
#endif

#ifndef LINEREAD_H
#include <lineread.h>
#endif

/* autoinit.c */
extern int h_errno;
extern struct Library *SocketBase;
LONG  _STI_200_openSockets(void);
void _STD_200_closeSockets(void);

/* chown.c */
int chown(const char *name, uid_t uid, gid_t gid);

/* dummy.c */
struct hostent	*gethostent(void);
struct netent  *getnetent(void);
struct servent	*getservent(void);
struct protoent *getprotoent(void);

/* fhopen.c */
int fhopen(long file, int mode);

/* getpid.c */
pid_t getpid(void);

/* gettimeofday.c */
int   gettimeofday(struct timeval *tp, struct timezone *tzp);

/* herror.c */
void  herror(const char *banner);

/* init_inet_daemon.c */
int init_inet_daemon(void);

/* init_usergroup.c */
extern struct Library *UserGroupBase;
LONG _STI_200_openUserGroup(void);
void _STD_200_closeUserGroup(void);

/* ioctl.c */
/* int __tcpioctl(int fd, unsigned int request, char *argp); */

/* iomode.c */
int iomode(int fd, int mode);

/* lineread.c */
int   lineRead(struct LineRead * rl);

/* printfault.c */
void  PrintNetFault(LONG code, const char *banner);

/* printuserfault.c */
void  PrintUserFault(LONG code, const char *banner);

/* rcmd.c */
int   rcmd(char **, int, const char *, const char *, const char *, int *);
int   rresvport(int *alport);

/* serveraccept.c */
long serveraccept(char *pname, struct sockaddr_in *ha);

/* set_socket_stdio.c */
int set_socket_stdio(int sock);

/* setegid.c */
int setegid(gid_t gid);

/* seteuid.c */
int seteuid(uid_t uid);

/* stat.c */
int stat(const char *name, struct stat *st);

/* stubs.c */
char * inet_ntoa(struct in_addr addr);
struct in_addr inet_makeaddr(u_long net, u_long host);
unsigned long inet_lnaof(struct in_addr addr);
unsigned long inet_netof(struct in_addr addr);

/* syslog.c */
void  openlog(const char *ident, int logstat, int logfac);
void  closelog(void);
int   setlogmask(int pmask);

/* timerinit.c */
extern long __local_to_GMT;
extern struct Device *TimerBase; /* actually struct Device * */
LONG _STI_200_openTimer(void);
void _STD_200_closeTimer(void);

/* _chkufb.c */
long _STI_1000_install_AmiTCP_callback(void);
long fdCallback(int fd, int action); /* registered parameters */
struct file *__chkfd(int fd);

/* _close.c */
/* int __tcpclose(int fd); */

/* _read.c */
/* int __tcpread(int fd, void *buffer, unsigned int length); */

/* _write.c */
/* int __tcpwrite(int fd, const void *buffer, unsigned int length); */

/*allocsocket.c*/
#ifdef KERNEL
int _allocsocket(int sock, int domain);
struct file *_getsock(int sock);
#endif

#endif /* !CLIB_NETLIB_PROTOS_H */
