Tor 0.4.9.0-alpha-dev
Data Structures | Macros | Functions
proto_ext_or.h File Reference

Header for proto_ext_or.c. More...

Go to the source code of this file.

Data Structures

struct  ext_or_cmd_t
 

Macros

#define ext_or_cmd_free(cmd)    FREE_AND_NULL(ext_or_cmd_t, ext_or_cmd_free_, (cmd))
 

Functions

int fetch_ext_or_command_from_buf (struct buf_t *buf, struct ext_or_cmd_t **out)
 
ext_or_cmd_text_or_cmd_new (uint16_t len)
 
void ext_or_cmd_free_ (ext_or_cmd_t *cmd)
 

Detailed Description

Header for proto_ext_or.c.

Definition in file proto_ext_or.h.

Macro Definition Documentation

◆ ext_or_cmd_free

#define ext_or_cmd_free (   cmd)     FREE_AND_NULL(ext_or_cmd_t, ext_or_cmd_free_, (cmd))

Definition at line 29 of file proto_ext_or.h.

Function Documentation

◆ ext_or_cmd_free_()

void ext_or_cmd_free_ ( ext_or_cmd_t cmd)

Deallocate the Extended ORPort message in cmd.

Definition at line 46 of file ext_orport.c.

◆ ext_or_cmd_new()

ext_or_cmd_t * ext_or_cmd_new ( uint16_t  len)

Allocate and return a structure capable of holding an Extended ORPort message of body length len.

Definition at line 36 of file ext_orport.c.

Referenced by fetch_ext_or_command_from_buf().

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