Tor  0.4.6.0-alpha-dev
Macros | Functions
proto_ext_or.c File Reference

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

#include "core/or/or.h"
#include "lib/buf/buffers.h"
#include "feature/relay/ext_orport.h"
#include "core/proto/proto_ext_or.h"

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.

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().