25 lines
531 B
C
25 lines
531 B
C
#ifndef NETUTILS_H
|
|
#define NETUTILS_H
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include "buffer.h"
|
|
|
|
#define SOCKADDR_TO_HUMAN_MIN (INET6_ADDRSTRLEN + 5 + 1)
|
|
/**
|
|
* Describe de forma humana un sockaddr:
|
|
*
|
|
* @param buff el buffer de escritura
|
|
* @param buffsize el tamaño del buffer de escritura
|
|
*
|
|
* @param af address family
|
|
* @param addr la dirección en si
|
|
* @param nport puerto en network byte order
|
|
*
|
|
*/
|
|
const char *
|
|
sockaddr_to_human(char *buff, const size_t buffsize,
|
|
const struct sockaddr *addr);
|
|
|
|
#endif
|