GRPC Core  9.0.0
Data Structures | Macros | Enumerations | Functions
hpack_encoder.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
#include <assert.h>
#include <string.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/timeout_encoding.h"

Data Structures

struct  framer_state
 
struct  wire_value
 
struct  EmitIndexedStatus
 

Macros

#define GRPC_HPACK_ENCODER_USE_CUCKOO_HASH   1
 
#define HASH_FRAGMENT_MASK   (GRPC_CHTTP2_HPACKC_NUM_VALUES - 1)
 
#define HASH_FRAGMENT_1(x)   ((x)&HASH_FRAGMENT_MASK)
 
#define HASH_FRAGMENT_2(x)   (((x) >> GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS) & HASH_FRAGMENT_MASK)
 
#define HASH_FRAGMENT_3(x)   (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 2)) & HASH_FRAGMENT_MASK)
 
#define HASH_FRAGMENT_4(x)   (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 3)) & HASH_FRAGMENT_MASK)
 
#define ONE_ON_ADD_PROBABILITY   (GRPC_CHTTP2_HPACKC_NUM_VALUES >> 1)
 
#define STRLEN_LIT(x)   (sizeof(x) - 1)
 
#define TIMEOUT_KEY   "grpc-timeout"
 

Enumerations

enum  EmitLitHdrType
 
enum  EmitLitHdrVType
 

Functions

void grpc_chttp2_hpack_compressor_init (grpc_chttp2_hpack_compressor *c)
 
void grpc_chttp2_hpack_compressor_destroy (grpc_chttp2_hpack_compressor *c)
 
void grpc_chttp2_hpack_compressor_set_max_usable_size (grpc_chttp2_hpack_compressor *c, uint32_t max_table_size)
 
void grpc_chttp2_hpack_compressor_set_max_table_size (grpc_chttp2_hpack_compressor *c, uint32_t max_table_size)
 
void grpc_chttp2_encode_header (grpc_chttp2_hpack_compressor *c, grpc_mdelem **extra_headers, size_t extra_headers_size, grpc_metadata_batch *metadata, const grpc_encode_header_options *options, grpc_slice_buffer *outbuf)
 

Macro Definition Documentation

◆ GRPC_HPACK_ENCODER_USE_CUCKOO_HASH

#define GRPC_HPACK_ENCODER_USE_CUCKOO_HASH   1

◆ HASH_FRAGMENT_1

#define HASH_FRAGMENT_1 (   x)    ((x)&HASH_FRAGMENT_MASK)

◆ HASH_FRAGMENT_2

#define HASH_FRAGMENT_2 (   x)    (((x) >> GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS) & HASH_FRAGMENT_MASK)

◆ HASH_FRAGMENT_3

#define HASH_FRAGMENT_3 (   x)    (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 2)) & HASH_FRAGMENT_MASK)

◆ HASH_FRAGMENT_4

#define HASH_FRAGMENT_4 (   x)    (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 3)) & HASH_FRAGMENT_MASK)

◆ HASH_FRAGMENT_MASK

#define HASH_FRAGMENT_MASK   (GRPC_CHTTP2_HPACKC_NUM_VALUES - 1)

◆ ONE_ON_ADD_PROBABILITY

#define ONE_ON_ADD_PROBABILITY   (GRPC_CHTTP2_HPACKC_NUM_VALUES >> 1)

◆ STRLEN_LIT

#define STRLEN_LIT (   x)    (sizeof(x) - 1)

◆ TIMEOUT_KEY

#define TIMEOUT_KEY   "grpc-timeout"

Enumeration Type Documentation

◆ EmitLitHdrType

enum EmitLitHdrType
strong

◆ EmitLitHdrVType

enum EmitLitHdrVType
strong

Function Documentation

◆ grpc_chttp2_encode_header()

void grpc_chttp2_encode_header ( grpc_chttp2_hpack_compressor c,
grpc_mdelem **  extra_headers,
size_t  extra_headers_size,
grpc_metadata_batch metadata,
const grpc_encode_header_options options,
grpc_slice_buffer outbuf 
)

◆ grpc_chttp2_hpack_compressor_destroy()

void grpc_chttp2_hpack_compressor_destroy ( grpc_chttp2_hpack_compressor c)

◆ grpc_chttp2_hpack_compressor_init()

void grpc_chttp2_hpack_compressor_init ( grpc_chttp2_hpack_compressor c)

◆ grpc_chttp2_hpack_compressor_set_max_table_size()

void grpc_chttp2_hpack_compressor_set_max_table_size ( grpc_chttp2_hpack_compressor c,
uint32_t  max_table_size 
)

◆ grpc_chttp2_hpack_compressor_set_max_usable_size()

void grpc_chttp2_hpack_compressor_set_max_usable_size ( grpc_chttp2_hpack_compressor c,
uint32_t  max_table_size 
)