@@ -229,6 +229,22 @@ static int send_to_addr(int type, const void *data, size_t datalen, int flags,
return fd;
}
+int send_to_addr_str(int family, int type, const char *addr_str, __u16 port,
+ const void *data, size_t datalen, int flags,
+ const struct network_helper_opts *opts)
+{
+ struct sockaddr_storage addr;
+ socklen_t addrlen;
+
+ if (!opts)
+ opts = &default_opts;
+
+ if (make_sockaddr(family, addr_str, port, &addr, &addrlen))
+ return -1;
+
+ return send_to_addr(type, data, datalen, flags, &addr, addrlen, opts);
+}
+
int send_to_fd_opts(int server_fd, const void *data, size_t datalen, int flags,
const struct network_helper_opts *opts)
{
@@ -76,6 +76,9 @@ int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts);
int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
int send_to_fd_opts(int server_fd, const void *data, size_t datalen, int flags,
const struct network_helper_opts *opts);
+int send_to_addr_str(int family, int type, const char *addr_str, __u16 port,
+ const void *data, size_t datalen, int flags,
+ const struct network_helper_opts *opts);
int fastopen_connect(int server_fd, const char *data, unsigned int data_len,
int timeout_ms);
int make_sockaddr(int family, const char *addr_str, __u16 port,