A brief file description. More...
#include "libts.h"
#include <stdio.h>
#include "Allocator.h"
#include "Compatability.h"
#include "HTTP.h"
#include "HdrToken.h"
#include "MIME.h"
#include "Regex.h"
#include "URL.h"
Go to the source code of this file.
Data Structures | |
struct | HdrTokenHashBucket |
Defines | |
#define | HDRTOKEN_HASH_TABLE_SIZE 65536 |
#define | HDRTOKEN_HASH_TABLE_MASK HDRTOKEN_HASH_TABLE_SIZE-1 |
#define | TINY_MASK(x) (((u_int32_t)1<<(x))-1) |
basic FNV hash | |
Functions | |
uint32_t | hash_to_slot (uint32_t hash) |
uint32_t | hdrtoken_hash (const unsigned char *string, unsigned int length) |
void | hdrtoken_hash_init () |
static unsigned int | snap_up_to_multiple (unsigned int n, unsigned int unit) |
void | hdrtoken_init () |
int | hdrtoken_tokenize_dfa (const char *string, int string_len, const char **wks_string_out) |
int | hdrtoken_tokenize (const char *string, int string_len, const char **wks_string_out) |
const char * | hdrtoken_string_to_wks (const char *string) |
const char * | hdrtoken_string_to_wks (const char *string, int length) |
Variables | |
static const char * | _hdrtoken_strs [] |
static HdrTokenTypeBinding | _hdrtoken_strs_type_initializers [] |
static HdrTokenFieldInfo | _hdrtoken_strs_field_initializers [] |
const char * | _hdrtoken_strs_heap_f = NULL |
const char * | _hdrtoken_strs_heap_l = NULL |
int | hdrtoken_num_wks = SIZEOF(_hdrtoken_strs) |
const char * | hdrtoken_strs [SIZEOF(_hdrtoken_strs)] |
int | hdrtoken_str_lengths [SIZEOF(_hdrtoken_strs)] |
HdrTokenType | hdrtoken_str_token_types [SIZEOF(_hdrtoken_strs)] |
int32_t | hdrtoken_str_slotids [SIZEOF(_hdrtoken_strs)] |
uint64_t | hdrtoken_str_masks [SIZEOF(_hdrtoken_strs)] |
uint32_t | hdrtoken_str_flags [SIZEOF(_hdrtoken_strs)] |
DFA * | hdrtoken_strs_dfa = NULL |
HdrTokenHashBucket | hdrtoken_hash_table [HDRTOKEN_HASH_TABLE_SIZE] |
static const char * | _hdrtoken_commonly_tokenized_strs [] |
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 HdrToken.cc.
#define HDRTOKEN_HASH_TABLE_MASK HDRTOKEN_HASH_TABLE_SIZE-1 |
Definition at line 348 of file HdrToken.cc.
#define HDRTOKEN_HASH_TABLE_SIZE 65536 |
Definition at line 347 of file HdrToken.cc.
#define TINY_MASK | ( | x | ) | (((u_int32_t)1<<(x))-1) |
uint32_t hash_to_slot | ( | uint32_t | hash | ) | [inline] |
Definition at line 364 of file HdrToken.cc.
References TINY_MASK.
Referenced by hdrtoken_hash_init(), and hdrtoken_tokenize().
uint32_t hdrtoken_hash | ( | const unsigned char * | string, | |
unsigned int | length | |||
) | [inline] |
Definition at line 370 of file HdrToken.cc.
Referenced by hdrtoken_hash_init(), and hdrtoken_tokenize().
void hdrtoken_hash_init | ( | ) |
Definition at line 539 of file HdrToken.cc.
References HdrTokenHashBucket::hash, hash_to_slot(), hdrtoken_hash(), hdrtoken_tokenize_dfa(), ink_release_assert, SIZEOF, and HdrTokenHashBucket::wks.
Referenced by hdrtoken_init().
void hdrtoken_init | ( | ) |
Definition at line 591 of file HdrToken.cc.
References _hdrtoken_strs, ats_malloc(), DFA::compile(), HdrTokenFieldInfo::flags, hdrtoken_hash_init(), hdrtoken_index_to_prefix(), hdrtoken_tokenize_dfa(), ink_assert, ink_strlcpy(), HdrTokenFieldInfo::mask, HdrTokenTypeBinding::name, HdrTokenFieldInfo::name, RE_CASE_INSENSITIVE, SIZEOF, HdrTokenFieldInfo::slotid, snap_up_to_multiple(), TOK_64_CONST, HdrTokenTypeBinding::type, HdrTokenHeapPrefix::wks_idx, HdrTokenHeapPrefix::wks_info, HdrTokenHeapPrefix::wks_length, and HdrTokenHeapPrefix::wks_token_type.
Referenced by HdrTest::go(), mime_init(), and url_init().
const char* hdrtoken_string_to_wks | ( | const char * | string | ) |
Definition at line 751 of file HdrToken.cc.
References hdrtoken_tokenize().
Referenced by HttpTransactCache::CalcVariability(), HttpTransact::check_request_validity(), http_init(), HttpTransact::initialize_state_variables_from_response(), mime_init(), mime_init_cache_control_cooking_masks(), and url_init().
const char* hdrtoken_string_to_wks | ( | const char * | string, | |
int | length | |||
) |
Definition at line 762 of file HdrToken.cc.
References hdrtoken_tokenize().
int hdrtoken_tokenize | ( | const char * | string, | |
int | string_len, | |||
const char ** | wks_string_out | |||
) |
Definition at line 716 of file HdrToken.cc.
References Debug, HdrTokenHashBucket::hash, hash_to_slot(), hdrtoken_hash(), hdrtoken_is_wks(), hdrtoken_wks_to_index(), hdrtoken_wks_to_length(), ink_assert, and HdrTokenHashBucket::wks.
Referenced by MIMEHdr::field_create(), HttpTransact::handle_upgrade_request(), hdrtoken_string_to_wks(), http_parser_parse_req(), http_str_store(), HTTPHdr::method_set(), mime_field_create_named(), mime_hdr_prepare_for_value_set(), mime_hdr_reset_accelerators_and_presence_bits(), mime_parser_parse(), MIMEField::name_set(), MIMEHdrImpl::recompute_cooked_stuff(), URL::scheme_set(), and url_parse_scheme().
int hdrtoken_tokenize_dfa | ( | const char * | string, | |
int | string_len, | |||
const char ** | wks_string_out | |||
) |
Definition at line 693 of file HdrToken.cc.
References hdrtoken_index_to_wks(), and DFA::match().
Referenced by hdrtoken_hash_init(), and hdrtoken_init().
static unsigned int snap_up_to_multiple | ( | unsigned int | n, | |
unsigned int | unit | |||
) | [inline, static] |
Definition at line 583 of file HdrToken.cc.
Referenced by hdrtoken_init().
const char* _hdrtoken_commonly_tokenized_strs[] [static] |
Definition at line 388 of file HdrToken.cc.
const char* _hdrtoken_strs[] [static] |
Definition at line 48 of file HdrToken.cc.
Referenced by hdrtoken_init().
Definition at line 247 of file HdrToken.cc.
const char* _hdrtoken_strs_heap_f = NULL |
Definition at line 327 of file HdrToken.cc.
Referenced by hdrtoken_is_wks().
const char* _hdrtoken_strs_heap_l = NULL |
Definition at line 328 of file HdrToken.cc.
Referenced by hdrtoken_is_wks().
Definition at line 195 of file HdrToken.cc.
HdrTokenHashBucket hdrtoken_hash_table[HDRTOKEN_HASH_TABLE_SIZE] |
Definition at line 356 of file HdrToken.cc.
int hdrtoken_num_wks = SIZEOF(_hdrtoken_strs) |
Definition at line 330 of file HdrToken.cc.
Referenced by hdrtoken_is_valid_wks_idx().
uint32_t hdrtoken_str_flags[SIZEOF(_hdrtoken_strs)] |
Definition at line 337 of file HdrToken.cc.
Referenced by hdrtoken_index_to_flags().
int hdrtoken_str_lengths[SIZEOF(_hdrtoken_strs)] |
Definition at line 333 of file HdrToken.cc.
Referenced by hdrtoken_index_to_length().
uint64_t hdrtoken_str_masks[SIZEOF(_hdrtoken_strs)] |
Definition at line 336 of file HdrToken.cc.
Referenced by hdrtoken_index_to_mask().
int32_t hdrtoken_str_slotids[SIZEOF(_hdrtoken_strs)] |
Definition at line 335 of file HdrToken.cc.
Referenced by hdrtoken_index_to_slotid().
Definition at line 334 of file HdrToken.cc.
Referenced by hdrtoken_index_to_token_type().
const char* hdrtoken_strs[SIZEOF(_hdrtoken_strs)] |
Definition at line 332 of file HdrToken.cc.
Referenced by hdrtoken_index_to_wks().
DFA* hdrtoken_strs_dfa = NULL |
Definition at line 339 of file HdrToken.cc.