|
|
@ -29,22 +29,22 @@ int socket_sctp6b(void);
|
|
|
|
#define socket_tcp() socket_tcp4()
|
|
|
|
#define socket_tcp() socket_tcp4()
|
|
|
|
#define socket_udp() socket_udp4()
|
|
|
|
#define socket_udp() socket_udp4()
|
|
|
|
|
|
|
|
|
|
|
|
int socket_connect4(int s,const char* ip,uint16 port);
|
|
|
|
int socket_connect4(int s,const char ip[4],uint16 port);
|
|
|
|
int socket_connect6(int s,const char* ip,uint16 port,uint32 scope_id);
|
|
|
|
int socket_connect6(int s,const char ip[16],uint16 port,uint32 scope_id);
|
|
|
|
int socket_connected(int s);
|
|
|
|
int socket_connected(int s);
|
|
|
|
int socket_bind4(int s,const char* ip,uint16 port);
|
|
|
|
int socket_bind4(int s,const char ip[4],uint16 port);
|
|
|
|
int socket_bind4_reuse(int s,const char* ip,uint16 port);
|
|
|
|
int socket_bind4_reuse(int s,const char ip[4],uint16 port);
|
|
|
|
int socket_bind6(int s,const char* ip,uint16 port,uint32 scope_id);
|
|
|
|
int socket_bind6(int s,const char ip[16],uint16 port,uint32 scope_id);
|
|
|
|
int socket_bind6_reuse(int s,const char* ip,uint16 port,uint32 scope_id);
|
|
|
|
int socket_bind6_reuse(int s,const char ip[16],uint16 port,uint32 scope_id);
|
|
|
|
int socket_listen(int s,unsigned int backlog);
|
|
|
|
int socket_listen(int s,unsigned int backlog);
|
|
|
|
int socket_accept4(int s,char* ip,uint16* port);
|
|
|
|
int socket_accept4(int s,char ip[4],uint16* port);
|
|
|
|
int socket_accept6(int s,char* ip,uint16* port,uint32* scope_id);
|
|
|
|
int socket_accept6(int s,char ip[16],uint16* port,uint32* scope_id);
|
|
|
|
int socket_accept4_makenonblocking(int s,char* ip,uint16* port);
|
|
|
|
int socket_accept4_makenonblocking(int s,char ip[4],uint16* port);
|
|
|
|
int socket_accept6_makenonblocking(int s,char* ip,uint16* port,uint32* scope_id);
|
|
|
|
int socket_accept6_makenonblocking(int s,char ip[16],uint16* port,uint32* scope_id);
|
|
|
|
int socket_accept4_setcloseonexec(int s,char* ip,uint16* port);
|
|
|
|
int socket_accept4_setcloseonexec(int s,char ip[4],uint16* port);
|
|
|
|
int socket_accept6_setcloseonexec(int s,char* ip,uint16* port,uint32* scope_id);
|
|
|
|
int socket_accept6_setcloseonexec(int s,char ip[16],uint16* port,uint32* scope_id);
|
|
|
|
int socket_accept4_makenonblocking_setcloseonexec(int s,char* ip,uint16* port);
|
|
|
|
int socket_accept4_makenonblocking_setcloseonexec(int s,char ip[4],uint16* port);
|
|
|
|
int socket_accept6_makenonblocking_setcloseonexec(int s,char* ip,uint16* port,uint32* scope_id);
|
|
|
|
int socket_accept6_makenonblocking_setcloseonexec(int s,char ip[16],uint16* port,uint32* scope_id);
|
|
|
|
|
|
|
|
|
|
|
|
/* These are internal wrappers around accept4, not meant for external use.
|
|
|
|
/* These are internal wrappers around accept4, not meant for external use.
|
|
|
|
* flags can be SOCKET_NONBLOCK or SOCKET_CLOEXEC or both */
|
|
|
|
* flags can be SOCKET_NONBLOCK or SOCKET_CLOEXEC or both */
|
|
|
@ -52,36 +52,36 @@ enum {
|
|
|
|
SOCKET_NONBLOCK=1,
|
|
|
|
SOCKET_NONBLOCK=1,
|
|
|
|
SOCKET_CLOEXEC=2,
|
|
|
|
SOCKET_CLOEXEC=2,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
int socket_accept4_flags(int s,char* ip,uint16* port, int flags);
|
|
|
|
int socket_accept4_flags(int s,char ip[4],uint16* port, int flags);
|
|
|
|
int socket_accept6_flags(int s,char* ip,uint16* port,uint32* scope_id, int flags);
|
|
|
|
int socket_accept6_flags(int s,char ip[16],uint16* port,uint32* scope_id, int flags);
|
|
|
|
|
|
|
|
|
|
|
|
att_writen(2,3) att_nonnull(2)
|
|
|
|
att_writen(2,3) att_nonnull(2)
|
|
|
|
ssize_t socket_recv4(int s,char* buf,size_t len,char* ip,uint16* port);
|
|
|
|
ssize_t socket_recv4(int s,char* buf,size_t len,char ip[4],uint16* port);
|
|
|
|
att_writen(2,3) att_nonnull(2)
|
|
|
|
att_writen(2,3) att_nonnull(2)
|
|
|
|
ssize_t socket_recv6(int s,char* buf,size_t len,char* ip,uint16* port,uint32* scope_id);
|
|
|
|
ssize_t socket_recv6(int s,char* buf,size_t len,char ip[16],uint16* port,uint32* scope_id);
|
|
|
|
|
|
|
|
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
ssize_t socket_send4(int s,const char* buf,size_t len,const char* ip,uint16 port);
|
|
|
|
ssize_t socket_send4(int s,const char* buf,size_t len,const char ip[4],uint16 port);
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
ssize_t socket_send4_flag(int s,const char* buf,size_t len,const char* ip,uint16 port,int flags);
|
|
|
|
ssize_t socket_send4_flag(int s,const char* buf,size_t len,const char ip[4],uint16 port,int flags);
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
ssize_t socket_send6(int s,const char* buf,size_t len,const char* ip,uint16 port,uint32 scope_id);
|
|
|
|
ssize_t socket_send6(int s,const char* buf,size_t len,const char ip[16],uint16 port,uint32 scope_id);
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
att_readn(2,3) att_nonnull(2)
|
|
|
|
ssize_t socket_send6_flag(int s,const char* buf,size_t len,const char* ip,uint16 port,uint32 scope_id,int flags);
|
|
|
|
ssize_t socket_send6_flag(int s,const char* buf,size_t len,const char ip[16],uint16 port,uint32 scope_id,int flags);
|
|
|
|
|
|
|
|
|
|
|
|
int socket_local4(int s,char* ip,uint16* port);
|
|
|
|
int socket_local4(int s,char ip[4],uint16* port);
|
|
|
|
int socket_local6(int s,char* ip,uint16* port,uint32* scope_id);
|
|
|
|
int socket_local6(int s,char ip[16],uint16* port,uint32* scope_id);
|
|
|
|
int socket_remote4(int s,char* ip,uint16* port);
|
|
|
|
int socket_remote4(int s,char ip[4],uint16* port);
|
|
|
|
int socket_remote6(int s,char* ip,uint16* port,uint32* scope_id);
|
|
|
|
int socket_remote6(int s,char ip[16],uint16* port,uint32* scope_id);
|
|
|
|
|
|
|
|
|
|
|
|
/* enable sending udp packets to the broadcast address */
|
|
|
|
/* enable sending udp packets to the broadcast address */
|
|
|
|
int socket_broadcast(int s);
|
|
|
|
int socket_broadcast(int s);
|
|
|
|
/* join a multicast group on the given interface */
|
|
|
|
/* join a multicast group on the given interface */
|
|
|
|
int socket_mcjoin4(int s,const char* groupip,const char* _interface);
|
|
|
|
int socket_mcjoin4(int s,const char groupip[4],const char _interface[4]);
|
|
|
|
int socket_mcjoin6(int s,const char* groupip,int _interface);
|
|
|
|
int socket_mcjoin6(int s,const char groupip[16],int _interface);
|
|
|
|
/* leave a multicast group on the given interface */
|
|
|
|
/* leave a multicast group on the given interface */
|
|
|
|
int socket_mcleave4(int s,const char* groupip);
|
|
|
|
int socket_mcleave4(int s,const char groupip[4]);
|
|
|
|
int socket_mcleave6(int s,const char* groupip);
|
|
|
|
int socket_mcleave6(int s,const char groupip[16]);
|
|
|
|
/* set multicast TTL/hop count for outgoing packets */
|
|
|
|
/* set multicast TTL/hop count for outgoing packets */
|
|
|
|
int socket_mcttl4(int s,char hops);
|
|
|
|
int socket_mcttl4(int s,char hops);
|
|
|
|
int socket_mchopcount6(int s,char hops);
|
|
|
|
int socket_mchopcount6(int s,char hops);
|
|
|
@ -121,8 +121,10 @@ int socket_quickack(int s,int value);
|
|
|
|
|
|
|
|
|
|
|
|
/* For client-side TCP fast open, connect and sending the first data is
|
|
|
|
/* For client-side TCP fast open, connect and sending the first data is
|
|
|
|
* just one step, so we need an API to do it in one step */
|
|
|
|
* just one step, so we need an API to do it in one step */
|
|
|
|
ssize_t socket_fastopen_connect4(int s,const char* ip,uint16 port,const char* buf,size_t len);
|
|
|
|
att_readn(4,5) att_nonnull(4)
|
|
|
|
ssize_t socket_fastopen_connect6(int s,const char* ip,uint16 port,uint32 scope_id,const char* buf,size_t len);
|
|
|
|
ssize_t socket_fastopen_connect4(int s,const char ip[4],uint16 port,const char* buf,size_t len);
|
|
|
|
|
|
|
|
att_readn(5,6) att_nonnull(5)
|
|
|
|
|
|
|
|
ssize_t socket_fastopen_connect6(int s,const char ip[16],uint16 port,uint32 scope_id,const char* buf,size_t len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __MINGW32__
|
|
|
|
#ifdef __MINGW32__
|
|
|
|