host: add a netmask constructor taking the number of network bits

This commit is contained in:
Martin Willi
2013-05-06 16:10:11 +02:00
parent 4dc83e9fac
commit 2d8a01d1c6
2 changed files with 57 additions and 0 deletions
+8
View File
@@ -191,6 +191,14 @@ host_t *host_create_from_sockaddr(sockaddr_t *sockaddr);
*/
host_t *host_create_from_subnet(char *string, int *bits);
/**
* Create a netmask host having the first netbits bits set.
*
* @param netbits number of leading bits set in the host
* @return netmask host
*/
host_t *host_create_netmask(int family, int netbits);
/**
* Create a host without an address, a "any" host.
*