util.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
23 #ifndef SOCK_UTIL_H
24 #define SOCK_UTIL_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 
41 int sock_udp_ep_fmt(const sock_udp_ep_t *endpoint, char *addr_str, uint16_t *port);
42 
60 int sock_urlsplit(const char *url, char *hostport, char *urlpath);
61 
74 int sock_udp_str2ep(sock_udp_ep_t *ep_out, const char *str);
75 
80 #define SOCK_HOSTPORT_MAXLEN (64U)
82 #define SOCK_URLPATH_MAXLEN (64U)
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* SOCK_UTIL_H */
91 
int sock_udp_str2ep(sock_udp_ep_t *ep_out, const char *str)
Convert string to UDP endpoint.
int sock_udp_ep_fmt(const sock_udp_ep_t *endpoint, char *addr_str, uint16_t *port)
Format UDP endpoint to string and port.
Common IP-based transport layer end point.
Definition: sock.h:195
int sock_urlsplit(const char *url, char *hostport, char *urlpath)
Split url to host:port and url path.