mirror of
https://github.com/diegocr/libnix.git
synced 2026-09-13 12:10:40 +00:00
18 lines
285 B
C
18 lines
285 B
C
|
|
#include "socketnix.h"
|
|
|
|
#undef inet_addr
|
|
|
|
/*
|
|
* Ascii internet address interpretation routine.
|
|
* The value returned is in network order.
|
|
*/
|
|
u_long inet_addr(const unsigned char *cp)
|
|
{
|
|
struct in_addr val;
|
|
|
|
if (inet_aton(cp, &val))
|
|
return (val.s_addr);
|
|
return (u_long)-1;
|
|
}
|