Anope IRC Services  Version 2.0
Macros | Functions
socket.h File Reference
#include <io.h>
Include dependency graph for socket.h:

Go to the source code of this file.

Macros

#define read   read_not_used
 
#define write   write_not_used
 
#define F_GETFL   0
 
#define F_SETFL   1
 
#define O_NONBLOCK   1
 
#define accept   windows_accept
 
#define inet_pton   windows_inet_pton
 
#define inet_ntop   windows_inet_ntop
 

Functions

CoreExport int read (int fd, char *buf, size_t count)
 
CoreExport int write (int fd, const char *buf, size_t count)
 
CoreExport int windows_close (int fd)
 
CoreExport int windows_accept (int fd, struct sockaddr *addr, int *addrlen)
 
CoreExport int windows_inet_pton (int af, const char *src, void *dst)
 
CoreExport const char * windows_inet_ntop (int af, const void *src, char *dst, size_t size)
 
CoreExport int fcntl (int fd, int cmd, int arg)
 

Macro Definition Documentation

#define accept   windows_accept

Definition at line 28 of file socket.h.

Referenced by SSLSocketIO::Accept(), SocketIO::Accept(), pipe(), and windows_accept().

#define F_GETFL   0

Definition at line 14 of file socket.h.

Referenced by fcntl(), Pipe::Pipe(), Socket::SetBlocking(), and Pipe::SetWriteBlocking().

#define F_SETFL   1

Definition at line 15 of file socket.h.

Referenced by fcntl(), Pipe::Pipe(), Socket::SetBlocking(), and Pipe::SetWriteBlocking().

#define inet_ntop   windows_inet_ntop

Definition at line 30 of file socket.h.

Referenced by sockaddrs::addr(), and sockaddrs::ntop().

#define inet_pton   windows_inet_pton

Definition at line 29 of file socket.h.

Referenced by sockaddrs::pton().

#define O_NONBLOCK   1

Definition at line 17 of file socket.h.

Referenced by fcntl(), Pipe::Pipe(), Socket::SetBlocking(), and Pipe::SetWriteBlocking().

#define read   read_not_used
#define write   write_not_used

Definition at line 9 of file socket.h.

Referenced by Pipe::Write().

Function Documentation

CoreExport int fcntl ( int  fd,
int  cmd,
int  arg 
)

Definition at line 131 of file socket.cpp.

References F_GETFL, F_SETFL, and O_NONBLOCK.

Referenced by Pipe::Pipe(), Socket::SetBlocking(), and Pipe::SetWriteBlocking().

CoreExport int read ( int  fd,
char *  buf,
size_t  count 
)

Definition at line 18 of file socket.cpp.

References is_socket().

CoreExport int windows_accept ( int  fd,
struct sockaddr *  addr,
int *  addrlen 
)

Definition at line 42 of file socket.cpp.

References accept.

CoreExport int windows_close ( int  fd)

Definition at line 34 of file socket.cpp.

References is_socket().

CoreExport const char* windows_inet_ntop ( int  af,
const void *  src,
char *  dst,
size_t  size 
)

This is inet_ntop, but it works on Windows

Parameters
afThe protocol type, AF_INET or AF_INET6
srcNetwork address structure
dstAfter converting put it here
sizesizeof the dest
Returns
dst

Definition at line 99 of file socket.cpp.

CoreExport int windows_inet_pton ( int  af,
const char *  src,
void *  dst 
)

This is inet_pton, but it works on Windows

Parameters
afThe protocol type, AF_INET or AF_INET6
srcThe address
dstStruct to put results in
Returns
1 on sucess, -1 on error

Definition at line 56 of file socket.cpp.

CoreExport int write ( int  fd,
const char *  buf,
size_t  count 
)

Definition at line 26 of file socket.cpp.

References is_socket().