module core.c.posix.sys.socket
C Bindings | Posix Bindings

Code Map

module core.c.posix.sys.socket;


enum _SS_SIZE;
enum _SS_PADSIZE;
enum SCM_RIGHTS;
enum SOCK_DGRAM;
enum SOCK_SEQPACKET;
enum SOCK_STREAM;
enum SOL_SOCKET;
enum SO_ACCEPTCONN;
enum SO_BROADCAST;
enum SO_DEBUG;
enum SO_DONTROUTE;
enum SO_ERROR;
enum SO_KEEPALIVE;
enum SO_LINGER;
enum SO_OOBINLINE;
enum SO_RCVBUF;
enum SO_RCVLOWAT;
enum SO_RCVTIMEO;
enum SO_REUSEADDR;
enum SO_SNDBUF;
enum SO_SNDLOWAT;
enum SO_SNDTIMEO;
enum SO_TYPE;
enum SOMAXCONN;
enum MSG_CTRUNC;
enum MSG_DONTROUTE;
enum MSG_EOR;
enum MSG_OOB;
enum MSG_PEEK;
enum MSG_TRUNC;
enum MSG_WAITALL;
enum MSG_NOSIGNAL;
enum AF_APPLETALK;
enum AF_INET;
enum AF_IPX;
enum AF_UNIX;
enum AF_UNSPEC;
enum PF_APPLETALK;
enum PF_IPX;
enum SOCK_RDM;
enum SHUT_RD;
enum SHUT_WR;
enum SHUT_RDWR;
enum AF_INET6;
enum SOCK_RAW;

alias socklen_t = u32;
alias sa_family_t = u16;

struct sockaddr
{
public:
	sa_family: sa_family_t;
	sa_data: i8[14];
}

struct sockaddr_storage
{
public:
	ss_family: sa_family_t;
	__ss_align: c_ulong;
	__ss_padding: i8[112];
}

struct msghdr
{
public:
	msg_name: void*;
	msg_namelen: socklen_t;
	msg_iov: iovec*;
	msg_iovlen: size_t;
	msg_control: void*;
	msg_controllen: size_t;
	msg_flags: i32;
}

struct cmsghdr
{
public:
	cmsg_len: size_t;
	cmsg_level: i32;
	cmsg_type: i32;
}

struct linger
{
public:
	l_onoff: i32;
	l_linger: i32;
}

fn accept(i32, sockaddr*, socklen_t*) i32;
fn bind(i32, const(const(sockaddr)*), socklen_t) i32;
fn connect(i32, const(const(sockaddr)*), socklen_t) i32;
fn getpeername(i32, sockaddr*, socklen_t*) i32;
fn getsockname(i32, sockaddr*, socklen_t*) i32;
fn getsockopt(i32, i32, i32, void*, socklen_t*) i32;
fn listen(i32, i32) i32;
fn recv(i32, void*, size_t, i32) ssize_t;
fn recvfrom(i32, void*, size_t, i32, sockaddr*, socklen_t*) ssize_t;
fn recvmsg(i32, msghdr*, i32) ssize_t;
fn send(i32, const(const(void)*), size_t, i32) ssize_t;
fn sendmsg(i32, const(const(msghdr)*), i32) ssize_t;
fn sendto(i32, const(const(void)*), size_t, i32, const(const(sockaddr)*), socklen_t) ssize_t;
fn setsockopt(i32, i32, i32, const(const(void)*), socklen_t) i32;
fn shutdown(i32, i32) i32;
fn socket(i32, i32, i32) i32;
fn sockatmark(i32) i32;
fn socketpair(i32, i32, i32, i32[2]) i32;