| 388 | } |
| 389 | |
| 390 | void |
| 391 | SNI_IpAllow::load(swoc::TextView content, swoc::TextView server_name) |
| 392 | { |
| 393 | static constexpr swoc::TextView delim{",\n"}; |
| 394 | |
| 395 | while (!content.ltrim(delim).empty()) { |
| 396 | swoc::TextView token{content.take_prefix_at(delim)}; |
| 397 | if (swoc::IPRange r; r.load(token)) { |
| 398 | Dbg(dbg_ctl_ssl_sni, "%.*s added to the ip_allow token %.*s", static_cast<int>(token.size()), token.data(), |
| 399 | int(server_name.size()), server_name.data()); |
| 400 | ip_addrs.fill(r); |
| 401 | } else { |
| 402 | Dbg(dbg_ctl_ssl_sni, "%.*s is not a valid format", static_cast<int>(token.size()), token.data()); |
| 403 | break; |
| 404 | } |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | int |
| 409 | SNI_IpAllow::SNIAction(SSL &ssl, ActionItem::Context const & /* ctx ATS_UNUSED */) const |
no test coverage detected