Apache2
h2.h File Reference
#include <apr_version.h>
#include <ap_mmn.h>
#include <nghttp2/nghttp2ver.h>
Include dependency graph for h2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  h2_priority
 
struct  h2_session_props
 
struct  h2_request
 

Macros

#define H2_USE_PIPES   (APR_FILES_AS_SOCKETS && APR_VERSION_AT_LEAST(1,6,0))
 
#define H2_USE_POLLFD_FROM_CONN   0
 
#define H2_USE_WEBSOCKETS   0
 
#define H2_ERR_NO_ERROR   (0x00)
 
#define H2_ERR_PROTOCOL_ERROR   (0x01)
 
#define H2_ERR_INTERNAL_ERROR   (0x02)
 
#define H2_ERR_FLOW_CONTROL_ERROR   (0x03)
 
#define H2_ERR_SETTINGS_TIMEOUT   (0x04)
 
#define H2_ERR_STREAM_CLOSED   (0x05)
 
#define H2_ERR_FRAME_SIZE_ERROR   (0x06)
 
#define H2_ERR_REFUSED_STREAM   (0x07)
 
#define H2_ERR_CANCEL   (0x08)
 
#define H2_ERR_COMPRESSION_ERROR   (0x09)
 
#define H2_ERR_CONNECT_ERROR   (0x0a)
 
#define H2_ERR_ENHANCE_YOUR_CALM   (0x0b)
 
#define H2_ERR_INADEQUATE_SECURITY   (0x0c)
 
#define H2_ERR_HTTP_1_1_REQUIRED   (0x0d)
 
#define H2_HEADER_METHOD   ":method"
 
#define H2_HEADER_METHOD_LEN   7
 
#define H2_HEADER_SCHEME   ":scheme"
 
#define H2_HEADER_SCHEME_LEN   7
 
#define H2_HEADER_AUTH   ":authority"
 
#define H2_HEADER_AUTH_LEN   10
 
#define H2_HEADER_PATH   ":path"
 
#define H2_HEADER_PATH_LEN   5
 
#define H2_HEADER_PROTO   ":protocol"
 
#define H2_HEADER_PROTO_LEN   9
 
#define H2_CRLF   "\r\n"
 
#define H2_FRAME_HDR_LEN   9
 
#define H2_DATA_CHUNK_SIZE   ((16*1024) - 100 - H2_FRAME_HDR_LEN)
 
#define H2_MAX_PADLEN   256
 
#define H2_INITIAL_WINDOW_SIZE   ((64*1024)-1)
 
#define H2_STREAM_CLIENT_INITIATED(id)   (id&0x01)
 
#define H2_ALEN(a)   (sizeof(a)/sizeof((a)[0]))
 
#define H2MAX(x, y)   ((x) > (y) ? (x) : (y))
 
#define H2MIN(x, y)   ((x) < (y) ? (x) : (y))
 
#define H2_HTTP_STATUS_UNSET   (0)
 
#define H2_HDR_CONFORMANCE   "http2-hdr-conformance"
 
#define H2_HDR_CONFORMANCE_UNSAFE   "unsafe"
 
#define H2_PUSH_MODE_NOTE   "http2-push-mode"
 
#define AP_HAS_RESPONSE_BUCKETS   0
 

Typedefs

typedef struct h2_priority h2_priority
 
typedef struct h2_session_props h2_session_props
 
typedef enum h2_stream_state_t h2_stream_state_t
 
typedef struct h2_request h2_request
 
typedef apr_status_t h2_io_data_cb(void *ctx, const char *data, apr_off_t len)
 
typedef int h2_stream_pri_cmp_fn(int stream_id1, int stream_id2, void *session)
 
typedef struct h2_streamh2_stream_get_fn(struct h2_session *session, int stream_id)
 

Enumerations

enum  h2_dependency { H2_DEPENDANT_AFTER , H2_DEPENDANT_INTERLEAVED , H2_DEPENDANT_BEFORE }
 
enum  h2_push_policy { H2_PUSH_NONE , H2_PUSH_DEFAULT , H2_PUSH_HEAD , H2_PUSH_FAST_LOAD }
 
enum  h2_session_state {
  H2_SESSION_ST_INIT , H2_SESSION_ST_DONE , H2_SESSION_ST_IDLE , H2_SESSION_ST_BUSY ,
  H2_SESSION_ST_WAIT , H2_SESSION_ST_CLEANUP
}
 
enum  h2_stream_state_t {
  H2_SS_IDLE , H2_SS_RSVD_R , H2_SS_RSVD_L , H2_SS_OPEN ,
  H2_SS_CLOSED_R , H2_SS_CLOSED_L , H2_SS_CLOSED , H2_SS_CLEANUP ,
  H2_SS_MAX
}
 
enum  h2_stream_event_t {
  H2_SEV_CLOSED_L , H2_SEV_CLOSED_R , H2_SEV_CANCELLED , H2_SEV_EOS_SENT ,
  H2_SEV_IN_ERROR , H2_SEV_IN_DATA_PENDING , H2_SEV_OUT_C1_BLOCK
}
 

Variables

const char * H2_MAGIC_TOKEN
 

Macro Definition Documentation

◆ AP_HAS_RESPONSE_BUCKETS

#define AP_HAS_RESPONSE_BUCKETS   0

◆ H2_ALEN

#define H2_ALEN (   a)    (sizeof(a)/sizeof((a)[0]))

◆ H2_CRLF

#define H2_CRLF   "\r\n"

◆ H2_DATA_CHUNK_SIZE

#define H2_DATA_CHUNK_SIZE   ((16*1024) - 100 - H2_FRAME_HDR_LEN)

◆ H2_ERR_CANCEL

#define H2_ERR_CANCEL   (0x08)

◆ H2_ERR_COMPRESSION_ERROR

#define H2_ERR_COMPRESSION_ERROR   (0x09)

◆ H2_ERR_CONNECT_ERROR

#define H2_ERR_CONNECT_ERROR   (0x0a)

◆ H2_ERR_ENHANCE_YOUR_CALM

#define H2_ERR_ENHANCE_YOUR_CALM   (0x0b)

◆ H2_ERR_FLOW_CONTROL_ERROR

#define H2_ERR_FLOW_CONTROL_ERROR   (0x03)

◆ H2_ERR_FRAME_SIZE_ERROR

#define H2_ERR_FRAME_SIZE_ERROR   (0x06)

◆ H2_ERR_HTTP_1_1_REQUIRED

#define H2_ERR_HTTP_1_1_REQUIRED   (0x0d)

◆ H2_ERR_INADEQUATE_SECURITY

#define H2_ERR_INADEQUATE_SECURITY   (0x0c)

◆ H2_ERR_INTERNAL_ERROR

#define H2_ERR_INTERNAL_ERROR   (0x02)

◆ H2_ERR_NO_ERROR

#define H2_ERR_NO_ERROR   (0x00)

◆ H2_ERR_PROTOCOL_ERROR

#define H2_ERR_PROTOCOL_ERROR   (0x01)

◆ H2_ERR_REFUSED_STREAM

#define H2_ERR_REFUSED_STREAM   (0x07)

◆ H2_ERR_SETTINGS_TIMEOUT

#define H2_ERR_SETTINGS_TIMEOUT   (0x04)

◆ H2_ERR_STREAM_CLOSED

#define H2_ERR_STREAM_CLOSED   (0x05)

◆ H2_FRAME_HDR_LEN

#define H2_FRAME_HDR_LEN   9

◆ H2_HDR_CONFORMANCE

#define H2_HDR_CONFORMANCE   "http2-hdr-conformance"

◆ H2_HDR_CONFORMANCE_UNSAFE

#define H2_HDR_CONFORMANCE_UNSAFE   "unsafe"

◆ H2_HEADER_AUTH

#define H2_HEADER_AUTH   ":authority"

◆ H2_HEADER_AUTH_LEN

#define H2_HEADER_AUTH_LEN   10

◆ H2_HEADER_METHOD

#define H2_HEADER_METHOD   ":method"

◆ H2_HEADER_METHOD_LEN

#define H2_HEADER_METHOD_LEN   7

◆ H2_HEADER_PATH

#define H2_HEADER_PATH   ":path"

◆ H2_HEADER_PATH_LEN

#define H2_HEADER_PATH_LEN   5

◆ H2_HEADER_PROTO

#define H2_HEADER_PROTO   ":protocol"

◆ H2_HEADER_PROTO_LEN

#define H2_HEADER_PROTO_LEN   9

◆ H2_HEADER_SCHEME

#define H2_HEADER_SCHEME   ":scheme"

◆ H2_HEADER_SCHEME_LEN

#define H2_HEADER_SCHEME_LEN   7

◆ H2_HTTP_STATUS_UNSET

#define H2_HTTP_STATUS_UNSET   (0)

◆ H2_INITIAL_WINDOW_SIZE

#define H2_INITIAL_WINDOW_SIZE   ((64*1024)-1)

◆ H2_MAX_PADLEN

#define H2_MAX_PADLEN   256

◆ H2_PUSH_MODE_NOTE

#define H2_PUSH_MODE_NOTE   "http2-push-mode"

◆ H2_STREAM_CLIENT_INITIATED

#define H2_STREAM_CLIENT_INITIATED (   id)    (id&0x01)

◆ H2_USE_PIPES

#define H2_USE_PIPES   (APR_FILES_AS_SOCKETS && APR_VERSION_AT_LEAST(1,6,0))

◆ H2_USE_POLLFD_FROM_CONN

#define H2_USE_POLLFD_FROM_CONN   0

◆ H2_USE_WEBSOCKETS

#define H2_USE_WEBSOCKETS   0

◆ H2MAX

#define H2MAX (   x,
 
)    ((x) > (y) ? (x) : (y))

◆ H2MIN

#define H2MIN (   x,
 
)    ((x) < (y) ? (x) : (y))

Typedef Documentation

◆ h2_io_data_cb

typedef apr_status_t h2_io_data_cb(void *ctx, const char *data, apr_off_t len)

◆ h2_priority

typedef struct h2_priority h2_priority

◆ h2_request

typedef struct h2_request h2_request

◆ h2_session_props

◆ h2_stream_get_fn

typedef struct h2_stream* h2_stream_get_fn(struct h2_session *session, int stream_id)

◆ h2_stream_pri_cmp_fn

typedef int h2_stream_pri_cmp_fn(int stream_id1, int stream_id2, void *session)

◆ h2_stream_state_t

Enumeration Type Documentation

◆ h2_dependency

Enumerator
H2_DEPENDANT_AFTER 
H2_DEPENDANT_INTERLEAVED 
H2_DEPENDANT_BEFORE 

◆ h2_push_policy

Enumerator
H2_PUSH_NONE 
H2_PUSH_DEFAULT 
H2_PUSH_HEAD 
H2_PUSH_FAST_LOAD 

◆ h2_session_state

Enumerator
H2_SESSION_ST_INIT 
H2_SESSION_ST_DONE 
H2_SESSION_ST_IDLE 
H2_SESSION_ST_BUSY 
H2_SESSION_ST_WAIT 
H2_SESSION_ST_CLEANUP 

◆ h2_stream_event_t

Enumerator
H2_SEV_CLOSED_L 
H2_SEV_CLOSED_R 
H2_SEV_CANCELLED 
H2_SEV_EOS_SENT 
H2_SEV_IN_ERROR 
H2_SEV_IN_DATA_PENDING 
H2_SEV_OUT_C1_BLOCK 

◆ h2_stream_state_t

Enumerator
H2_SS_IDLE 
H2_SS_RSVD_R 
H2_SS_RSVD_L 
H2_SS_OPEN 
H2_SS_CLOSED_R 
H2_SS_CLOSED_L 
H2_SS_CLOSED 
H2_SS_CLEANUP 
H2_SS_MAX 

Variable Documentation

◆ H2_MAGIC_TOKEN

const char* H2_MAGIC_TOKEN
extern

The magic PRIamble of RFC 7540 that is always sent when starting a h2 communication.