Data Structures | Defines | Functions | Variables

HdrToken.cc File Reference

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"
Include dependency graph for HdrToken.cc:

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)]
DFAhdrtoken_strs_dfa = NULL
HdrTokenHashBucket hdrtoken_hash_table [HDRTOKEN_HASH_TABLE_SIZE]
static const char * _hdrtoken_commonly_tokenized_strs []

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


Define Documentation

#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)

basic FNV hash

Definition at line 361 of file HdrToken.cc.

Referenced by hash_to_slot().


Function Documentation

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 (  ) 
void hdrtoken_init (  ) 
const char* hdrtoken_string_to_wks ( const char *  string  ) 
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 
)
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]
Returns:
returns 0 for n=0, unit*n for n <= unit

Definition at line 583 of file HdrToken.cc.

Referenced by hdrtoken_init().


Variable Documentation

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.

Definition at line 330 of file HdrToken.cc.

Referenced by hdrtoken_is_valid_wks_idx().

Definition at line 337 of file HdrToken.cc.

Referenced by hdrtoken_index_to_flags().

Definition at line 333 of file HdrToken.cc.

Referenced by hdrtoken_index_to_length().

Definition at line 336 of file HdrToken.cc.

Referenced by hdrtoken_index_to_mask().

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().

Definition at line 339 of file HdrToken.cc.