diff options
Diffstat (limited to 'src/udp.h')
-rw-r--r-- | src/udp.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -37,10 +37,11 @@ #include <sys/socket.h> +typedef struct sockaddr_storage udp_endpoint_t; struct udp_socket_struct { int fd_; - struct sockaddr_storage local_end_; - struct sockaddr_storage remote_end_; + udp_endpoint_t local_end_; + udp_endpoint_t remote_end_; }; typedef struct udp_socket_struct udp_socket_t; @@ -48,12 +49,11 @@ void udp_init(udp_socket_t** sock, const char* local_addr, const char* port); void udp_set_remote(udp_socket_t* sock, const char* remote_addr, const char* port); void udp_close(udp_socket_t** sock); -char* udp_endpoint_to_string(struct sockaddr_storage ss); +char* udp_endpoint_to_string(udp_endpoint_t e); char* udp_get_local_end_string(udp_socket_t* sock); char* udp_get_remote_end_string(udp_socket_t* sock); -int udp_read(udp_socket_t* sock, u_int8_t* buf, u_int32_t len, struct sockaddr_storage* remote_end); +int udp_read(udp_socket_t* sock, u_int8_t* buf, u_int32_t len, udp_endpoint_t* remote_end); int udp_write(udp_socket_t* sock, u_int8_t* buf, u_int32_t len); - #endif |