chromium/net/base/scheme_host_port_matcher_rule.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_BASE_SCHEME_HOST_PORT_MATCHER_RULE_H_
#define NET_BASE_SCHEME_HOST_PORT_MATCHER_RULE_H_

#include <memory>
#include <string>
#include <string_view>

#include "net/base/cronet_buildflags.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_export.h"
#include "net/base/scheme_host_port_matcher_result.h"
#include "url/gurl.h"

namespace net {

// Interface for an individual SchemeHostPortMatcher rule.
class NET_EXPORT SchemeHostPortMatcherRule {};

// Rule that matches URLs with wildcard hostname patterns, and
// scheme/port restrictions.
//
// For example:
//   *.google.com
//   https://*.google.com
//   google.com:443
class NET_EXPORT SchemeHostPortMatcherHostnamePatternRule
    : public SchemeHostPortMatcherRule {};

// Rule that matches URLs with IP address as hostname, and scheme/port
// restrictions. * only works in the host portion. i18n domain names must be
// input in punycode format.
//
// For example:
//   127.0.0.1,
//   http://127.0.0.1
//   [::1]
//   [0:0::1]
//   http://[::1]:99
class NET_EXPORT SchemeHostPortMatcherIPHostRule
    : public SchemeHostPortMatcherRule {};

// Rule for matching a URL that is an IP address, if that IP address falls
// within a certain numeric range.
//
// For example:
//   127.0.0.1/8.
//   FE80::/10
//   but not http://127.0.0.1:7/8 or http://[FE80::]/10 (IPv6 with brackets).
class NET_EXPORT SchemeHostPortMatcherIPBlockRule
    : public SchemeHostPortMatcherRule {};

}  // namespace net

#endif  // NET_BASE_SCHEME_HOST_PORT_MATCHER_RULE_H_