#define SOCK_STREAM 1
#define SOCK_DGRAM 2
#define SOCK_RAW 3

#define AF_UNSPEC 0
#define AF_UNIX 1
#define AF_INET 2

struct sockaddr {
	unsigned short sa_family;
	char sa_data[14];
};

struct in_addr {
	_CONST char *s_addr;
};

struct sockaddr_in {
	unsigned short sin_port;
	struct in_addr sin_addr;
	char sin_zero[10];
};

struct sockaddr_un {
	unsigned short sun_family;
	char sun_path[108];
};

_PROTOTYPE(extern int socket, (unsigned int domain, unsigned int type, unsigned int protocol));
_PROTOTYPE(extern int connect, (unsigned int sockfd, _CONST struct sockaddr *addr, unsigned int addrlen));
_PROTOTYPE(extern int accept, (unsigned int sockfd, struct sockaddr *addr, unsigned int *addrlen));
_PROTOTYPE(extern int listen, (unsigned int sockfd, unsigned int backlog));
_PROTOTYPE(extern int bind, (unsigned int sockfd, _CONST struct sockaddr *addr, unsigned int addrlen));

#endif
