#include "c.h"
#include <netinet/in.h>
#include <ctype.h>
#include "port/pg_bswap.h"
Go to the source code of this file.
◆ inet_aton()
Definition at line 56 of file inet_aton.c.
57{
59 int base,
60 n;
64
65 for (;;)
66 {
67
68
69
70
72 base = 10;
74 {
75 if (*++
cp ==
'x' || *
cp ==
'X')
77 else
78 base = 8;
79 }
80 while ((
c = *
cp) !=
'\0')
81 {
83 {
86 continue;
87 }
88 if (base == 16 &&
isxdigit((
unsigned char)
c))
89 {
91 (
c + 10 - (
islower((
unsigned char)
c) ?
'a' :
'A'));
93 continue;
94 }
95 break;
96 }
98 {
99
100
101
102
104 return 0;
106 }
107 else
108 break;
109 }
110
111
112
113
116 return 0;
117
118
119
120
122 switch (n)
123 {
124
125 case 1:
126 break;
127
128 case 2:
130 return 0;
132 break;
133
134 case 3:
136 return 0;
138 break;
139
140 case 4:
142 return 0;
144 break;
145 }
146 if (addr)
148 return 1;
149}
References fb(), pg_hton32, and val.
Referenced by is_ip_address(), and pq_verify_peer_name_matches_certificate_ip().