Tor
0.4.9.2-alpha-dev
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerator
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
b
c
d
f
g
h
l
m
n
o
p
r
s
v
Enumerations
a
b
c
d
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
g
h
i
m
n
o
p
q
r
s
t
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
core
or
relay_msg_st.h
Go to the documentation of this file.
1
/* Copyright (c) 2023, The Tor Project, Inc. */
2
/* See LICENSE for licensing information */
3
4
/**
5
* @file relay_msg_st.h
6
* @brief A relay message which contains a relay command and parameters,
7
* if any, that is from a relay cell.
8
**/
9
10
#ifndef TOR_RELAY_MSG_ST_H
11
#define TOR_RELAY_MSG_ST_H
12
13
#include "
core/or/or.h
"
14
15
/** A relay message object which contains pointers to the header and payload.
16
*
17
* One acquires a relay message through the use of an iterator. Once you get a
18
* reference, the getters MUST be used to access data.
19
*
20
* This CAN NOT be made opaque so to avoid heap allocation in the fast path. */
21
typedef
struct
relay_msg_t
{
22
/* Relay command of a message. */
23
uint8_t command;
24
/* Length of the message body.
25
*
26
* This value MUST always be less than or equal to the lower of:
27
* - the number of bytes available in `body`.
28
* - relay_cell_max_format(_, command).
29
*
30
* (These bounds on the length field are guaranteed by all message decoding
31
* functions, and enforced by all message encoding functions.)
32
*/
33
uint16_t length;
34
/* Optional routing header: stream ID of a message or 0. */
35
streamid_t
stream_id;
36
/* Indicate if this is a message from a relay early cell. */
37
bool
is_relay_early;
38
/* Message body of a relay message.
39
*
40
* Code MUST NOT access any part of `body` beyond the first `length` bytes.
41
*
42
* NOTE that this struct does not own the body; instead, this is a pointer
43
* into a different object. */
44
const
uint8_t *body;
45
}
relay_msg_t
;
46
47
#endif
/* !defined(TOR_RELAY_MSG_ST_H) */
or.h
Master header file for Tor-specific functionality.
streamid_t
uint16_t streamid_t
Definition:
or.h:586
relay_msg_t
Definition:
relay_msg_st.h:21
Generated by
1.9.4