MCPcopy Create free account
hub / github.com/acl-dev/acl / valid_hostaddr

Function valid_hostaddr

lib_fiber/c/src/dns/valid_hostname.c:88–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86/* valid_hostaddr - verify numerical address syntax */
87
88int valid_hostaddr(const char *addr, int gripe)
89{
90 const char *myname = "valid_hostaddr";
91
92 /*
93 * Trivial cases first.
94 */
95 if (*addr == 0) {
96 if (gripe)
97 msg_warn("%s: empty address", myname);
98 return 0;
99 }
100
101 /*
102 * Protocol-dependent processing next.
103 */
104 if (strchr(addr, ':') != 0)
105 return valid_ipv6_hostaddr(addr, gripe);
106 else
107 return valid_ipv4_hostaddr(addr, gripe);
108}
109
110/* valid_ipv4_hostaddr - test dotted quad string for correctness */
111

Callers

nothing calls this directly

Calls 3

msg_warnFunction · 0.85
valid_ipv6_hostaddrFunction · 0.85
valid_ipv4_hostaddrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…