Data Structures | Enumerations | Functions | Variables

MatcherUtils.h File Reference

A brief file description. More...

#include "ParseRules.h"
Include dependency graph for MatcherUtils.h:
This graph shows which files directly or indirectly include this file:

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

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


Enumeration Type Documentation

Enumerator:
MATCH_NONE 
MATCH_HOST 
MATCH_DOMAIN 
MATCH_IP 
MATCH_REGEX 
MATCH_URL 
MATCH_HOST_REGEX 

Definition at line 72 of file MatcherUtils.h.


Function Documentation

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.

Parameters:
[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.

Parameters:
[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 
)
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 = '\0' 
)

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

Definition at line 395 of file MatcherUtils.cc.

Referenced by TSMatcherParseSrcIPConfigLine().

const int MATCHER_MAX_TOKENS = 40
const char* matcher_type_str[]

Definition at line 279 of file MatcherUtils.cc.