Functions | Variables

MatcherUtils.cc File Reference

A brief file description. More...

#include "libts.h"
Include dependency graph for MatcherUtils.cc:

Go to the source code of this file.

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, in_addr_t *min, in_addr_t *max)
 Convenience overload for IPv4.
const char * ExtractIpRange (char *match_str, sockaddr *addr1, sockaddr *addr2)
 Extract an IP range.
char * tokLine (char *buf, char **last, char cont)
const char * processDurationString (char *str, int *seconds)
const char * parseConfigLine (char *line, matcher_line *p_line, const matcher_tags *tags)

Variables

const char * matcher_type_str []
const matcher_tags http_dest_tags
const matcher_tags ip_allow_tags
const matcher_tags socks_server_tags

Detailed Description

A brief file description.

License

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.cc.


Function Documentation

char const* ExtractIpRange ( char *  match_str,
in_addr_t *  min,
in_addr_t *  max 
)

Convenience overload for IPv4.

Parameters:
[in,out] min Returned address in host order.
[in,out] max 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().

const char* 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.

const char* parseConfigLine ( char *  line,
matcher_line p_line,
const matcher_tags tags 
)
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 
)
char* tokLine ( char *  buf,
char **  last,
char  cont 
)

Definition at line 241 of file MatcherUtils.cc.

References start.

Referenced by remap_parse_config_bti(), SSLParseCertificateConfiguration(), and TSMatcherTokLine().

int unescapifyStr ( char *  buffer  ) 

Variable Documentation

Initial value:
 {
  "dest_host", "dest_domain", "dest_ip", "url_regex", "url", "host_regex", true
}

Definition at line 391 of file MatcherUtils.cc.

Referenced by initCacheControl(), ParentConfig::reconfigure(), and reloadCacheControl().

Initial value:
 {
  NULL, NULL, "src_ip", NULL, NULL, NULL, false
}

Definition at line 395 of file MatcherUtils.cc.

Referenced by TSMatcherParseSrcIPConfigLine().

const char* matcher_type_str[]
Initial value:
 {
  "invalid",
  "host",
  "domain",
  "ip",
  "url_regex",
  "url",
  "host_regex"
}

Definition at line 279 of file MatcherUtils.cc.

Initial value:
 {
  NULL, NULL, "dest_ip", NULL, NULL, NULL, false
}

Definition at line 399 of file MatcherUtils.cc.

Referenced by ControlMatcher< Data, Result >::BuildTableFromString(), and SocksServerConfig::reconfigure().