Anope IRC Services  Version 2.0
Macros | Functions
socket.cpp File Reference
#include "services.h"
Include dependency graph for socket.cpp:

Go to the source code of this file.

Macros

#define WIN32_NO_OVERRIDE
 

Functions

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

Macro Definition Documentation

#define WIN32_NO_OVERRIDE

Definition at line 8 of file socket.cpp.

Function Documentation

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().

static bool is_socket ( int  fd)
inlinestatic

Definition at line 11 of file socket.cpp.

Referenced by read(), windows_close(), and write().

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

Definition at line 18 of file socket.cpp.

References is_socket().

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

Definition at line 42 of file socket.cpp.

References accept.

int windows_close ( int  fd)

Definition at line 34 of file socket.cpp.

References is_socket().

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.

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.

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

Definition at line 26 of file socket.cpp.

References is_socket().