diff options
author | David Goulet <dgoulet@torproject.org> | 2017-07-21 17:06:04 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-08-24 13:03:28 -0400 |
commit | cb336a7062f87c5c306549a4f4a26eab66c5b825 (patch) | |
tree | 98bbdeba5938c46e530919916a9ee9ca7ee5bebd /src/or/hs_cell.h | |
parent | e7c06e694766c6e2fb1f06ed5e1bf9c216e7a976 (diff) | |
download | tor-cb336a7062f87c5c306549a4f4a26eab66c5b825.tar.gz tor-cb336a7062f87c5c306549a4f4a26eab66c5b825.zip |
prop224: Parse INTRODUCE_ACK cell
Add a function to parse an INTRODUCE_ACK cell in hs_cell.c. Furthermore, add
an enum that lists all possible expected status code.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_cell.h')
-rw-r--r-- | src/or/hs_cell.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/hs_cell.h b/src/or/hs_cell.h index 29e451cf0f..606a08dd66 100644 --- a/src/or/hs_cell.h +++ b/src/or/hs_cell.h @@ -16,6 +16,14 @@ * 3.2.2 of the specification). Below this value, the cell must be padded. */ #define HS_CELL_INTRODUCE1_MIN_SIZE 246 +/* Status code of an INTRODUCE_ACK cell. */ +typedef enum { + HS_CELL_INTRO_ACK_SUCCESS = 0x0000, /* Cell relayed to service. */ + HS_CELL_INTRO_ACK_FAILURE = 0x0001, /* Service ID not recognized */ + HS_CELL_INTRO_ACK_BADFMT = 0x0002, /* Bad message format */ + HS_CELL_INTRO_ACK_NORELAY = 0x0003, /* Can't relay cell to service */ +} hs_cell_introd_ack_status_t; + /* Onion key type found in the INTRODUCE1 cell. */ typedef enum { HS_CELL_ONION_KEY_TYPE_NTOR = 1, @@ -102,6 +110,7 @@ ssize_t hs_cell_parse_intro_established(const uint8_t *payload, ssize_t hs_cell_parse_introduce2(hs_cell_introduce2_data_t *data, const origin_circuit_t *circ, const hs_service_t *service); +int hs_cell_parse_introduce_ack(const uint8_t *payload, size_t payload_len); #endif /* TOR_HS_CELL_H */ |