* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
* supported.
*/
-int addr_to_str(struct sockaddr_storage *addr, char *str, int size);
+int addr_to_str(const struct sockaddr_storage *addr, char *str, int size);
/* Tries to convert a sockaddr_storage port to text form. Upon success, the
* address family is returned so that it's easy for the caller to adapt to the
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
* supported.
*/
-int port_to_str(struct sockaddr_storage *addr, char *str, int size);
+int port_to_str(const struct sockaddr_storage *addr, char *str, int size);
/* check if the given address is local to the system or not. It will return
* -1 when it's not possible to know, 0 when the address is not local, 1 when
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
* supported.
*/
-int addr_to_str(struct sockaddr_storage *addr, char *str, int size)
+int addr_to_str(const struct sockaddr_storage *addr, char *str, int size)
{
- void *ptr;
+ const void *ptr;
if (size < 5)
return 0;
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
* supported.
*/
-int port_to_str(struct sockaddr_storage *addr, char *str, int size)
+int port_to_str(const struct sockaddr_storage *addr, char *str, int size)
{
uint16_t port;