#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 58 of file inet_aton.c.
59{
61 int base,
62 n;
66
67 for (;;)
68 {
69
70
71
72
74 base = 10;
76 {
77 if (*++
cp ==
'x' || *
cp ==
'X')
79 else
80 base = 8;
81 }
82 while ((
c = *
cp) !=
'\0')
83 {
85 {
88 continue;
89 }
90 if (base == 16 &&
isxdigit((
unsigned char)
c))
91 {
93 (
c + 10 - (
islower((
unsigned char)
c) ?
'a' :
'A'));
95 continue;
96 }
97 break;
98 }
100 {
101
102
103
104
106 return 0;
108 }
109 else
110 break;
111 }
112
113
114
115
118 return 0;
119
120
121
122
124 switch (n)
125 {
126
127 case 1:
128 break;
129
130 case 2:
132 return 0;
134 break;
135
136 case 3:
138 return 0;
140 break;
141
142 case 4:
144 return 0;
146 break;
147 }
148 if (addr)
150 return 1;
151}
References fb(), pg_hton32, and val.
Referenced by is_ip_address(), and pq_verify_peer_name_matches_certificate_ip().