|
Tor 0.4.9.3-alpha-dev
|
Header file for onion.c. More...
#include "lib/crypt_ops/crypto_ed25519.h"Go to the source code of this file.
Data Structures | |
| struct | create_cell_t |
| struct | created_cell_t |
| struct | extend_cell_t |
| struct | extended_cell_t |
Macros | |
| #define | MAX_ONIONSKIN_CHALLENGE_LEN 255 |
| #define | MAX_ONIONSKIN_REPLY_LEN 255 |
| #define | MAX_CREATE_LEN (CELL_PAYLOAD_SIZE - 4) |
| #define | MAX_CREATED_LEN (CELL_PAYLOAD_SIZE - 2) |
Functions | |
| void | create_cell_init (create_cell_t *cell_out, uint8_t cell_type, uint16_t handshake_type, uint16_t handshake_len, const uint8_t *onionskin) |
| int | create_cell_parse (create_cell_t *cell_out, const cell_t *cell_in) |
| int | created_cell_parse (created_cell_t *cell_out, const cell_t *cell_in) |
| int | extend_cell_parse (extend_cell_t *cell_out, const uint8_t command, const uint8_t *payload_in, size_t payload_len) |
| int | extended_cell_parse (extended_cell_t *cell_out, const uint8_t command, const uint8_t *payload_in, size_t payload_len) |
| int | create_cell_format (cell_t *cell_out, const create_cell_t *cell_in) |
| int | create_cell_format_relayed (cell_t *cell_out, const create_cell_t *cell_in) |
| int | created_cell_format (cell_t *cell_out, const created_cell_t *cell_in) |
| int | extend_cell_format (uint8_t *command_out, uint16_t *len_out, uint8_t *payload_out, const extend_cell_t *cell_in) |
| int | extended_cell_format (uint8_t *command_out, uint16_t *len_out, uint8_t *payload_out, const extended_cell_t *cell_in) |
| #define MAX_CREATE_LEN (CELL_PAYLOAD_SIZE - 4) |
| #define MAX_CREATED_LEN (CELL_PAYLOAD_SIZE - 2) |
| int create_cell_format | ( | cell_t * | cell_out, |
| const create_cell_t * | cell_in | ||
| ) |
| int create_cell_format_relayed | ( | cell_t * | cell_out, |
| const create_cell_t * | cell_in | ||
| ) |
| void create_cell_init | ( | create_cell_t * | cell_out, |
| uint8_t | cell_type, | ||
| uint16_t | handshake_type, | ||
| uint16_t | handshake_len, | ||
| const uint8_t * | onionskin | ||
| ) |
Write the various parameters into the create cell. Separate from create_cell_parse() to make unit testing easier.
Definition at line 101 of file onion.c.
Referenced by create_cell_parse(), and parse_create2_payload().
| int create_cell_parse | ( | create_cell_t * | cell_out, |
| const cell_t * | cell_in | ||
| ) |
Parse a CREATE, CREATE_FAST, or CREATE2 cell from cell_in into cell_out. Return 0 on success, -1 on failure. (We reject some syntactically valid CREATE2 cells that we can't generate or react to.)
Definition at line 153 of file onion.c.
Referenced by command_process_create_cell().
| int created_cell_format | ( | cell_t * | cell_out, |
| const created_cell_t * | cell_in | ||
| ) |
Fill cell_out with a correctly formatted version of the CREATED{,_FAST,2} cell in cell_in. Return 0 on success, -1 on failure.
Definition at line 504 of file onion.c.
Referenced by onionskin_answer().
| int created_cell_parse | ( | created_cell_t * | cell_out, |
| const cell_t * | cell_in | ||
| ) |
Parse a CREATED, CREATED_FAST, or CREATED2 cell from cell_in into cell_out. Return 0 on success, -1 on failure.
Definition at line 197 of file onion.c.
Referenced by command_process_created_cell().
| int extend_cell_format | ( | uint8_t * | command_out, |
| uint16_t * | len_out, | ||
| uint8_t * | payload_out, | ||
| const extend_cell_t * | cell_in | ||
| ) |
Format the EXTEND{,2} cell in cell_in, storing its relay payload in payload_out, the number of bytes used in *len_out, and the relay command in *command_out. The payload_out must have RELAY_PAYLOAD_SIZE_MAX bytes available.
Return 0 on success, -1 on failure.
Definition at line 551 of file onion.c.
Referenced by circuit_send_intermediate_onion_skin().
| int extend_cell_parse | ( | extend_cell_t * | cell_out, |
| const uint8_t | command, | ||
| const uint8_t * | payload, | ||
| size_t | payload_length | ||
| ) |
Parse an EXTEND or EXTEND2 cell (according to command) from the payload_length bytes of payload into cell_out. Return 0 on success, -1 on failure.
Definition at line 350 of file onion.c.
Referenced by circuit_extend().
| int extended_cell_format | ( | uint8_t * | command_out, |
| uint16_t * | len_out, | ||
| uint8_t * | payload_out, | ||
| const extended_cell_t * | cell_in | ||
| ) |
Format the EXTENDED{,2} cell in cell_in, storing its relay payload in payload_out, the number of bytes used in *len_out, and the relay command in *command_out. The payload_out must have RELAY_PAYLOAD_SIZE_MAX bytes available.
Return 0 on success, -1 on failure.
Definition at line 645 of file onion.c.
Referenced by command_process_created_cell().
| int extended_cell_parse | ( | extended_cell_t * | cell_out, |
| const uint8_t | command, | ||
| const uint8_t * | payload, | ||
| size_t | payload_len | ||
| ) |
Parse an EXTENDED or EXTENDED2 cell (according to command) from the payload_len bytes of payload into cell_out. Return 0 on success, -1 on failure.
Definition at line 407 of file onion.c.
Referenced by handle_relay_msg().