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

Method YAMLLoadIPCategory

src/proxy/IPAllow.cc:397–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397swoc::Errata
398IpAllow::YAMLLoadIPCategory(const YAML::Node &node, IpMap *map, IpAllow::Record const *record)
399{
400 if (!node.IsScalar()) {
401 return swoc::Errata(ERRATA_ERROR, "{} Expected IP address category at {}, found non-literal.", this, node.Mark());
402 }
403 std::string const &category(node.Scalar());
404 if (auto spot = ip_category_map.find(category); spot != ip_category_map.end()) {
405 for (auto const &range : spot->second) {
406 map->fill(range.range_view(), record);
407 }
408 } else {
409 return swoc::Errata(ERRATA_ERROR, "{} {} - '{}' is not category with a defined range.", this, node.Mark(), category);
410 }
411 return {};
412}
413
414swoc::Errata
415IpAllow::YAMLLoadEntry(const YAML::Node &entry)

Callers 1

YAMLLoadEntryMethod · 0.95

Calls 6

ErrataClass · 0.85
range_viewMethod · 0.80
MarkMethod · 0.45
findMethod · 0.45
endMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected