Tor 0.4.9.8
Loading...
Searching...
No Matches
proto_ext_or.c File Reference

Parsing/encoding for the extended OR protocol. More...

Go to the source code of this file.

Macros

#define EXT_OR_CMD_HEADER_SIZE   4
 

Functions

int fetch_ext_or_command_from_buf (buf_t *buf, ext_or_cmd_t **out)
 

Detailed Description

Parsing/encoding for the extended OR protocol.

Definition in file proto_ext_or.c.

Macro Definition Documentation

◆ EXT_OR_CMD_HEADER_SIZE

#define EXT_OR_CMD_HEADER_SIZE   4

The size of the header of an Extended ORPort message: 2 bytes for COMMAND, 2 bytes for BODYLEN

Definition at line 19 of file proto_ext_or.c.

Referenced by fetch_ext_or_command_from_buf().

Function Documentation

◆ fetch_ext_or_command_from_buf()

int fetch_ext_or_command_from_buf ( buf_t * buf,
ext_or_cmd_t ** out )

Read buf, which should contain an Extended ORPort message from a transport proxy. If well-formed, create and populate out with the Extended ORport message. Return 0 if the buffer was incomplete, 1 if it was well-formed and -1 if we encountered an error while parsing it.

Definition at line 27 of file proto_ext_or.c.

Referenced by connection_fetch_ext_or_cmd_from_buf().