18 struct sockaddr_in sa;
22 sa.sin_family = AF_INET;
26 return sendto(s,buf,len,0,(
struct sockaddr *)&sa,
sizeof(sa));
31 struct sockaddr_in6 sa;
35 sa.sin6_family = AF_INET6;
36 sa.sin6_scope_id = scope_id;
40 return sendto(s,buf,len,0,(
struct sockaddr *)&sa,
sizeof(sa));
53 struct sockaddr_in sa;
57 sa.sin_family = AF_INET;
59 byte_copy((
char *)&sa.sin_addr,4,V4broadcast);
61 return sendto(s,buf,len,0,(
struct sockaddr *)&sa,
sizeof(sa));
int socket_send6(int s, const char *buf, unsigned int len, const char ip[16], uint16 port, uint32 scope_id)
int socket_send4(int s, const char *buf, unsigned int len, const char ip[4], uint16 port)
int socket_broadcast4(int s, const char *buf, unsigned int len, uint16 port)
int socket_send(int s, const char *buf, unsigned int len, const char ip[16], uint16 port, uint32 scope_id)
void uint16_pack_big(char[16], uint16)
#define ip6_isv4mapped(ip)
void byte_copy(void *, unsigned int, const void *)
void byte_zero(void *, unsigned int)