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.




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



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