-
Notifications
You must be signed in to change notification settings - Fork 1
API network
JoungKyun Kim edited this page Jul 13, 2016
·
3 revisions
network - retuns network address for ip address and network mask
#include <ipcalc.h>
unsigned long network (ulong ip, ulong mask)
network api retuns network address that is caculated by given ip address and network mask.
return 32 bit positive integer on success, and returns 0 on fails.
#include <ipcalc.h>
int main (void) {
char * ip = "192.168.10.131";
char * mask = "255.255.255.192";
ulong r;
r = network (ip2long (ip), ip2long (mask));
printf ("NETWORK ADDRESS: %s\n", long2ip (r));
return 0;
}
JoungKyun.Kim <http://oops.org>
Report to https://github.com/Joungkyun/libipcalc/issues
Copyright (c) 2016 JoungKyun.Kim <http://oops.org>
This api is follows LGPL 2.1