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

Function parseIpMap

plugins/stats_over_http/stats_over_http.cc:929–947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

927 return false;
928}
929static void
930parseIpMap(config_t *config, swoc::TextView txt)
931{
932 // sent null ipstring, fill with default open IPs
933 if (txt.empty()) {
934 config->addrs.fill(DEFAULT_IP6);
935 config->addrs.fill(DEFAULT_IP);
936 Dbg(dbg_ctl, "Empty allow settings, setting all IPs in allow list");
937 return;
938 }
939
940 while (txt) {
941 auto token{txt.take_prefix_at(',')};
942 if (swoc::IPRange r; r.load(token)) {
943 config->addrs.fill(r);
944 Dbg(dbg_ctl, "Added %.*s to allow ip list", int(token.length()), token.data());
945 }
946 }
947}
948
949static config_t *
950new_config(std::fstream &fh)

Callers 1

new_configFunction · 0.85

Calls 6

take_prefix_atMethod · 0.80
emptyMethod · 0.45
fillMethod · 0.45
loadMethod · 0.45
lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected