#include "c.h"
#include <netinet/in.h>
#include <ctype.h>
#include "port/pg_bswap.h"
Go to the source code of this file.
|
int | inet_aton (const char *cp, struct in_addr *addr) |
|
◆ inet_aton()
int inet_aton |
( |
const char * |
cp, |
|
|
struct in_addr * |
addr |
|
) |
| |
Definition at line 56 of file inet_aton.c.
75 if (*++cp ==
'x' || *cp ==
'X')
80 while ((
c = *cp) !=
'\0')
82 if (isdigit((
unsigned char)
c))
88 if (base == 16 && isxdigit((
unsigned char)
c))
91 (
c + 10 - (islower((
unsigned char)
c) ?
'a' :
'A'));
103 if (pp >= parts + 3 ||
val > 0xff)
115 if (!isspace((
unsigned char) *cp++))
131 val |= parts[0] << 24;
137 val |= (parts[0] << 24) | (parts[1] << 16);
143 val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
References pg_hton32, and val.
Referenced by is_ip_address(), and pq_verify_peer_name_matches_certificate_ip().