diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-16 19:46:38 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-16 19:46:38 +0000 |
commit | 2986a63f7e513cf37f46db9f211b77071260031f (patch) | |
tree | 9a6e62602396938ea5a612420f53ebf267e8d941 /NetWare/nw5sck.h | |
parent | 87b11a197a59fac210fc9265bde0ef1ffe36de89 (diff) | |
download | perl-2986a63f7e513cf37f46db9f211b77071260031f.tar.gz |
NetWare port from Guruprasad S <SGURUPRASAD@novell.com>.
p4raw-id: //depot/perl@10643
Diffstat (limited to 'NetWare/nw5sck.h')
-rw-r--r-- | NetWare/nw5sck.h | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/NetWare/nw5sck.h b/NetWare/nw5sck.h new file mode 100644 index 0000000000..1b0bc51bb5 --- /dev/null +++ b/NetWare/nw5sck.h @@ -0,0 +1,129 @@ + +/* + * Copyright © 2001 Novell, Inc. All Rights Reserved. + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + * + */ + +/* + * FILENAME : nw5sck.h + * DESCRIPTION : Socket related functions. + * Author : SGP + * Date : January 2001. + * + */ + + + +#ifndef _INC_NW_SOCKET +#define _INC_NW_SOCKET + + +#include <sys/socket.h> +#ifdef __cplusplus +extern "C" { +#endif + +typedef u_int SOCKET; + +struct nwsockent local_context; + +# undef gethostbyname +# undef gethostbyaddr + +# undef endhostent +# undef endnetent +# undef endprotoent +# undef endservent +# undef gethostent +# undef getprotoent +# undef getnetbyaddr +# undef getnetbyname +# undef gethostbyaddr +# undef getprotobyname +# undef getprotobyname +# undef getservbyname +# undef getservbyport +# undef getservent +# undef sethostent +# undef setnetent +# undef setprotoent +# undef setservent + +# define gethostbyname(name) NetDBgethostbyname(&local_context,name) +# define gethostbyaddr(a,l,t) NetDBgethostbyaddr(&local_context,a,l,t) + +# define endhostent() NetDBendhostent(&local_context) +# define endnetent() NWendnetent(&local_context) +# define endprotoent() NWendprotoent(&local_context) +# define endservent() NWendservent(&local_context) +# define gethostent() NetDBgethostent(&local_context,NULL) +# define getprotoent() NWgetprotoent(&local_context) +# define gethostbyaddr(a,l,t) NetDBgethostbyaddr(&local_context,a,l,t) +# define getnetbyaddr(net,typ) NWgetnetbyaddr(&local_context,net,typ) +# define getnetbyname(name) NWgetnetbyname(&local_context,name) +# define getprotobyname(name) NWgetprotobyname(&local_context,name) +# define getprotobyname(name) NWgetprotobyname(&local_context,name) +# define getservbyname(n,p) NWgetservbyname(&local_context,n,p) +# define getservbyport(n,p) NWgetservbyport(&local_context,n,p) +# define getservent() NWgetservent(&local_context) +# define sethostent() NWsethostent(&local_context, stayopen) +# define setnetent() NWsetnetent(&local_context, stayopen) +# define setprotoent() NWsetprotoent(&local_context, stayopen) +# define setservent() NWsetservent(&local_context, stayopen) + +u_long nw_htonl(u_long hostlong); +u_short nw_htons(u_short hostshort); +u_long nw_ntohl(u_long netlong); +u_short nw_ntohs(u_short netshort); + +SOCKET nw_accept(SOCKET s, struct sockaddr *addr, int *addrlen); +int nw_bind(SOCKET s, const struct sockaddr *addr, int addrlen); +int nw_connect(SOCKET s, const struct sockaddr *addr, int addrlen); + +struct hostent * nw_gethostbyname(const char * name); +struct hostent * nw_gethostbyaddr(const char *addr, int len, int type); +int nw_gethostname(char *name, int len); +struct netent * nw_getnetbyaddr(long net, int type); +struct netent *nw_getnetbyname(char *name); +int nw_getpeername(SOCKET s, struct sockaddr *addr, int *addrlen); +struct protoent * nw_getprotobyname(const char *name); +struct protoent * nw_getprotobynumber(int num); +struct servent * nw_getservbyname(const char *name, const char *proto); +struct servent * nw_getservbyport(int port, const char *proto); +struct servent * nw_getservent(void); +void nw_sethostent(int stayopen); +void nw_setnetent(int stayopen); +void nw_setprotoent(int stayopen); +void nw_setservent(int stayopen); + +int nw_getsockname(SOCKET s, struct sockaddr *addr, int *addrlen); +int nw_getsockopt(SOCKET s, int level, int optname, char *optval, int *optlen); + +unsigned long nw_inet_addr(const char *cp); + +void nw_endhostent(); +void nw_endnetent(); +void nw_endprotoent(); +void nw_endservent(); +struct hostent *nw_gethostent(); +struct netent *nw_getnetent(); +struct protoent * nw_getprotoent(); + +SOCKET nw_socket(int af, int type, int protocol); +int nw_listen(SOCKET s, int backlog); +int nw_send(SOCKET s, const char *buf, int len, int flags); +int nw_recv(SOCKET s, char *buf, int len, int flags); +int nw_sendto(SOCKET s, const char *buf, int len, int flags,const struct sockaddr *to, int tolen); +int nw_recvfrom(SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen); +int nw_select(int nfds, fd_set* rd, fd_set* wr, fd_set* ex, const struct timeval* timeout); +int nw_shutdown(SOCKET s, int how); +#ifdef __cplusplus +} +#endif + + +#endif // _INC_NW_SOCKET + |