-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathlsquic_types.h
More file actions
60 lines (45 loc) · 1.32 KB
/
Copy pathlsquic_types.h
File metadata and controls
60 lines (45 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Copyright (c) 2017 - 2026 LiteSpeed Technologies Inc. See LICENSE. */
#ifndef __LSQUIC_TYPES_H__
#define __LSQUIC_TYPES_H__
/**
* @file
* LSQUIC types.
*/
#include <stdint.h>
#include <sys/types.h>
#define MAX_CID_LEN 20
#define GQUIC_CID_LEN 8
#if defined(_MSC_VER)
#define ALIGNED_(x) __declspec(align(x))
#else
#if defined(__GNUC__)
#define ALIGNED_(x) __attribute__ ((aligned(x)))
#endif
#endif
/**
* Connection ID
*/
typedef struct ALIGNED_(8) lsquic_cid
{
uint8_t buf[MAX_CID_LEN];
#define idbuf buf
uint_fast8_t len;
} lsquic_cid_t;
#define LSQUIC_CIDS_EQ(a, b) ((a)->len == 8 ? \
(b)->len == 8 && *(uint64_t *)((a)->buf) == *(uint64_t *)((b)->buf) : \
(a)->len == (b)->len && 0 == memcmp((a)->idbuf, (b)->idbuf, (a)->len))
/** Stream ID */
typedef uint64_t lsquic_stream_id_t;
/** LSQUIC engine */
typedef struct lsquic_engine lsquic_engine_t;
/** Connection */
typedef struct lsquic_conn lsquic_conn_t;
/** Connection context. This is the return value of @ref on_new_conn. */
typedef struct lsquic_conn_ctx lsquic_conn_ctx_t;
/** Stream */
typedef struct lsquic_stream lsquic_stream_t;
/** Stream context. This is the return value of @ref on_new_stream. */
typedef struct lsquic_stream_ctx lsquic_stream_ctx_t;
/** HTTP headers */
typedef struct lsquic_http_headers lsquic_http_headers_t;
#endif