4 Interface for perl socket functions
8 #ifndef __Inc__IPerlSock___
9 #define __Inc__IPerlSock___
14 virtual u_long Htonl(u_long hostlong) = 0;
15 virtual u_short Htons(u_short hostshort) = 0;
16 virtual u_long Ntohl(u_long netlong) = 0;
17 virtual u_short Ntohs(u_short netshort) = 0;
18 virtual SOCKET Accept(SOCKET s, struct sockaddr* addr, int* addrlen, int &err) = 0;
19 virtual int Bind(SOCKET s, const struct sockaddr* name, int namelen, int &err) = 0;
20 virtual int Connect(SOCKET s, const struct sockaddr* name, int namelen, int &err) = 0;
21 virtual void Endhostent(int &err) = 0;
22 virtual void Endnetent(int &err) = 0;
23 virtual void Endprotoent(int &err) = 0;
24 virtual void Endservent(int &err) = 0;
25 virtual struct hostent* Gethostbyaddr(const char* addr, int len, int type, int &err) = 0;
26 virtual struct hostent* Gethostbyname(const char* name, int &err) = 0;
27 virtual struct hostent* Gethostent(int &err) = 0;
28 virtual int Gethostname(char* name, int namelen, int &err) = 0;
29 virtual struct netent *Getnetbyaddr(long net, int type, int &err) = 0;
30 virtual struct netent *Getnetbyname(const char *, int &err) = 0;
31 virtual struct netent *Getnetent(int &err) = 0;
32 virtual int Getpeername(SOCKET s, struct sockaddr* name, int* namelen, int &err) = 0;
33 virtual struct protoent* Getprotobyname(const char* name, int &err) = 0;
34 virtual struct protoent* Getprotobynumber(int number, int &err) = 0;
35 virtual struct protoent* Getprotoent(int &err) = 0;
36 virtual struct servent* Getservbyname(const char* name, const char* proto, int &err) = 0;
37 virtual struct servent* Getservbyport(int port, const char* proto, int &err) = 0;
38 virtual struct servent* Getservent(int &err) = 0;
39 virtual int Getsockname(SOCKET s, struct sockaddr* name, int* namelen, int &err) = 0;
40 virtual int Getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen, int &err) = 0;
41 virtual unsigned long InetAddr(const char* cp, int &err) = 0;
42 virtual char* InetNtoa(struct in_addr in, int &err) = 0;
43 virtual int Listen(SOCKET s, int backlog, int &err) = 0;
44 virtual int Recv(SOCKET s, char* buf, int len, int flags, int &err) = 0;
45 virtual int Recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen, int &err) = 0;
46 virtual int Select(int nfds, char* readfds, char* writefds, char* exceptfds, const struct timeval* timeout, int &err) = 0;
47 virtual int Send(SOCKET s, const char* buf, int len, int flags, int &err) = 0;
48 virtual int Sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen, int &err) = 0;
49 virtual void Sethostent(int stayopen, int &err) = 0;
50 virtual void Setnetent(int stayopen, int &err) = 0;
51 virtual void Setprotoent(int stayopen, int &err) = 0;
52 virtual void Setservent(int stayopen, int &err) = 0;
53 virtual int Setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen, int &err) = 0;
54 virtual int Shutdown(SOCKET s, int how, int &err) = 0;
55 virtual SOCKET Socket(int af, int type, int protocol, int &err) = 0;
56 virtual int Socketpair(int domain, int type, int protocol, int* fds, int &err) = 0;
58 virtual int Closesocket(SOCKET s, int& err) = 0;
59 virtual int Ioctlsocket(SOCKET s, long cmd, u_long *argp, int& err) = 0;
63 #endif /* __Inc__IPerlSock___ */