-
Notifications
You must be signed in to change notification settings - Fork 1
API ip2long
JoungKyun Kim edited this page Jul 13, 2016
·
3 revisions
ip2long - convert IPv4 ip address to 32bit positive integer
#include <ipcalc.h>
unsigned long ip2long (char * ipaddress)
ip2long API converts a string containing an (IPv4) Internet Protocol dotted address into a proper address
if success, returns 32bit positive integer, and returns 0 on fails.
#include <ipcalc.h>
int main (void) {
char * addr = "192.168.0.1";
ulong r;
r = ip2long (addr);
printf ("LONG IP: %lu\n", 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