A brief file description. More...
#include "ParseRules.h"
Go to the source code of this file.
Data Structures | |
struct | matcher_line |
struct | matcher_tags |
Enumerations | |
enum | matcher_type { MATCH_NONE, MATCH_HOST, MATCH_DOMAIN, MATCH_IP, MATCH_REGEX, MATCH_URL, MATCH_HOST_REGEX } |
Functions | |
char * | readIntoBuffer (const char *file_path, const char *module_name, int *read_size_ptr) |
int | unescapifyStr (char *buffer) |
char const * | ExtractIpRange (char *match_str, sockaddr *min, sockaddr *max) |
Extract an IP range. | |
char const * | ExtractIpRange (char *match_str, in_addr_t *addr1, in_addr_t *addr2) |
Convenience overload for IPv4. | |
char const * | ExtractIpRange (char *match_str, sockaddr_in6 *addr1, sockaddr_in6 *addr2) |
Convenience overload for IPv6. | |
char * | tokLine (char *buf, char **last, char cont= '\0') |
const char * | processDurationString (char *str, int *seconds) |
const char * | parseConfigLine (char *line, matcher_line *p_line, const matcher_tags *tags) |
static void | LowerCaseStr (char *str) |
Variables | |
const char * | matcher_type_str [] |
const int | MATCHER_MAX_TOKENS = 40 |
const matcher_tags | http_dest_tags |
const matcher_tags | ip_allow_tags |
const matcher_tags | socks_server_tags |
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file MatcherUtils.h.
enum matcher_type |
Definition at line 72 of file MatcherUtils.h.
char const* ExtractIpRange | ( | char * | match_str, | |
sockaddr * | min, | |||
sockaddr * | max | |||
) |
Extract an IP range.
min and max should be at least the size of sockaddr_in6
to hold an IP address.
Definition at line 169 of file MatcherUtils.cc.
References a, ats_ip4_addr_cast(), ats_ip4_set(), ats_ip_addr_cmp(), ats_ip_copy(), ats_ip_pton(), ats_is_ip4(), Tokenizer::Initialize(), IpEndpoint::sa, and SHARE_TOKS.
char const* ExtractIpRange | ( | char * | match_str, | |
in_addr_t * | addr1, | |||
in_addr_t * | addr2 | |||
) |
Convenience overload for IPv4.
[in,out] | addr1 | Returned address in host order. |
[in,out] | addr2 | Returned address in host order. |
Definition at line 140 of file MatcherUtils.cc.
References ats_ip4_addr_cast(), ats_is_ip4(), ExtractIpRange(), and IpEndpoint::sa.
Referenced by ExtractIpRange(), IpMatcher< Data, Result >::NewEntry(), remap_validate_filter_args(), and TSMatcherExtractIPRange().
char const* ExtractIpRange | ( | char * | match_str, | |
sockaddr_in6 * | addr1, | |||
sockaddr_in6 * | addr2 | |||
) | [inline] |
Convenience overload for IPv6.
[in,out] | addr1 | Returned address in network order. |
[in,out] | addr2 | Returned address in network order. |
Definition at line 59 of file MatcherUtils.h.
References ats_ip_sa_cast(), and ExtractIpRange().
static void LowerCaseStr | ( | char * | str | ) | [inline, static] |
Definition at line 124 of file MatcherUtils.h.
References ParseRules::ink_tolower().
Referenced by HostLookup::MatchFirst(), and remap_parse_config_bti().
const char* parseConfigLine | ( | char * | line, | |
matcher_line * | p_line, | |||
const matcher_tags * | tags | |||
) |
Definition at line 413 of file MatcherUtils.cc.
References matcher_line::dest_entry, matcher_tags::dest_error_msg, matcher_tags::empty(), ink_assert, ParseRules::is_char(), ParseRules::is_digit(), matcher_line::line, matcher_tags::match_domain, matcher_tags::match_host, matcher_tags::match_host_regex, matcher_tags::match_ip, MATCH_NONE, matcher_tags::match_regex, matcher_tags::match_url, MATCHER_MAX_TOKENS, memcpy, matcher_line::num_el, matcher_line::type, and val.
Referenced by ControlMatcher< Data, Result >::BuildTableFromString(), CacheHostTable::BuildTableFromString(), SSLParseCertificateConfiguration(), and TSMatcherParseSrcIPConfigLine().
const char* processDurationString | ( | char * | str, | |
int * | seconds | |||
) |
Definition at line 306 of file MatcherUtils.cc.
References ink_assert, and ParseRules::is_digit().
Referenced by CacheControlRecord::Init().
char* readIntoBuffer | ( | const char * | file_path, | |
const char * | module_name, | |||
int * | read_size_ptr | |||
) |
Definition at line 44 of file MatcherUtils.cc.
References _O_ATTRIB_NORMAL, ats_free(), ats_malloc(), and Error.
Referenced by ControlMatcher< Data, Result >::BuildTable(), CacheHostTable::BuildTable(), ConfigVolumes::read_config_file(), remap_parse_config_bti(), ssl_context_enable_tickets(), SSLParseCertificateConfiguration(), and TSMatcherReadIntoBuffer().
char* tokLine | ( | char * | buf, | |
char ** | last, | |||
char | cont = '\0' | |||
) |
Definition at line 241 of file MatcherUtils.cc.
References start.
Referenced by remap_parse_config_bti(), SSLParseCertificateConfiguration(), and TSMatcherTokLine().
int unescapifyStr | ( | char * | buffer | ) |
Definition at line 110 of file MatcherUtils.cc.
Referenced by HttpRequestData::get_string(), StatPagesManager::handle_http(), StatPagesManager::is_cache_inspector_page(), StatPagesManager::is_stat_page(), CommandLineArgs::parse_arguments(), and ShowCache::ShowCache().
const matcher_tags http_dest_tags |
Definition at line 391 of file MatcherUtils.cc.
Referenced by initCacheControl(), ParentConfig::reconfigure(), and reloadCacheControl().
const matcher_tags ip_allow_tags |
Definition at line 395 of file MatcherUtils.cc.
Referenced by TSMatcherParseSrcIPConfigLine().
const int MATCHER_MAX_TOKENS = 40 |
Definition at line 79 of file MatcherUtils.h.
Referenced by CacheHostTable::BuildTableFromString(), ParentRecord::Init(), CongestionControlRecord::Init(), CacheHostRecord::Init(), CacheControlRecord::Init(), IpMatcher< Data, Result >::NewEntry(), RegexMatcher< Data, Result >::NewEntry(), UrlMatcher< Data, Result >::NewEntry(), HostMatcher< Data, Result >::NewEntry(), CacheHostMatcher::NewEntry(), parseConfigLine(), ControlBase::ProcessModifiers(), and ssl_extract_certificate().
const char* matcher_type_str[] |
Definition at line 279 of file MatcherUtils.cc.
Definition at line 399 of file MatcherUtils.cc.
Referenced by ControlMatcher< Data, Result >::BuildTableFromString(), and SocksServerConfig::reconfigure().