X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibpsocket.so_src%2Finclude_exp%2Fsys%2Fsocket.h;h=9c3e3bda39657495c285a4e6d093d2db400ce476;hb=f8cde3fab5eb27ebacf9d76a7ac478a68a36a38b;hp=bba73978626c496f3638dbcb46fa9b9e8ac63226;hpb=13d63ccc620150f11691378273277b3412137109;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h b/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h index bba73978..9c3e3bda 100644 --- a/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h +++ b/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h @@ -14,22 +14,27 @@ #endif #include // uint32_t +#ifdef __cplusplus +extern "C" { +#endif + typedef uint32_t socklen_t; -typedef enum +enum { AF_UNSPEC = 0, AF_PACKET = 1, AF_LOCAL = 2, AF_INET = 4, AF_INET6 = 6, -} sa_family_t; +}; #define AF_UNIX AF_LOCAL +typedef uint8_t sa_family_t; // I would use an enum, but cast issues struct sockaddr { sa_family_t sa_family; - char sa_data[16]; + char sa_data[16+2]; }; struct msghdr @@ -96,7 +101,8 @@ enum { SO_REUSEADDR, SO_LINGER, - SO_ERROR + SO_ERROR, + SO_KEEPALIVE, }; // shutdown how @@ -107,6 +113,13 @@ enum SHUT_RDWR }; +// flags for send* +//#define MSG_CONFIRM 0x01 +#define MSG_DONTROUTE 0x02 +#define MSG_OOB 0x40 +// flags for recv +#define MSG_PEEK 0x100 + /** * \brief Create a new socket descriptor * \param domain Address family @@ -133,6 +146,8 @@ extern int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); */ extern int listen(int sockfd, int backlog); +#define SOMAXCONN 128 // Maximum size of backlog (actually far higher) + /** * \brief Accept an incoming connection */ @@ -156,5 +171,9 @@ extern void herror(const char *s); extern const char *hstrerror(int err); extern struct hostent *gethostent(void); +#ifdef __cplusplus +} +#endif + #endif