MCPcopy Create free account
hub / github.com/apache/trafficserver / ExtractIpRange

Function ExtractIpRange

src/tscore/MatcherUtils.cc:165–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165const char *
166ExtractIpRange(char *match_str, in_addr_t *min, in_addr_t *max)
167{
168 IpEndpoint ip_min, ip_max;
169 const char *zret = ExtractIpRange(match_str, &ip_min.sa, &ip_max.sa);
170 if (nullptr == zret) { // success
171 if (ats_is_ip4(&ip_min) && ats_is_ip4(&ip_max)) {
172 if (min) {
173 *min = ntohl(ats_ip4_addr_cast(&ip_min));
174 }
175 if (max) {
176 *max = ntohl(ats_ip4_addr_cast(&ip_max));
177 }
178 } else {
179 zret = "The addresses were not IPv4 addresses.";
180 }
181 }
182 return zret;
183}
184
185// char* ExtractIpRange(char* match_str, sockaddr* addr1,
186// sockaddr* addr2)

Callers 1

makeMethod · 0.50

Calls 6

ats_is_ip4Function · 0.85
ats_ip4_setFunction · 0.85
ats_ip_addr_cmpFunction · 0.85
ats_ip_copyFunction · 0.85
ats_ip_ptonFunction · 0.70
InitializeMethod · 0.45

Tested by

no test coverage detected