cell_establish_intro.h (22100B)
1 /* cell_establish_intro.h -- generated by Trunnel v1.5.3. 2 * https://gitweb.torproject.org/trunnel.git 3 * You probably shouldn't edit this file. 4 */ 5 #ifndef TRUNNEL_CELL_ESTABLISH_INTRO_H 6 #define TRUNNEL_CELL_ESTABLISH_INTRO_H 7 8 #include <stdint.h> 9 #include "trunnel.h" 10 11 struct trn_extension_st; 12 #define TRUNNEL_SHA3_256_LEN 32 13 #define TRUNNEL_CELL_EXTENSION_TYPE_DOS 1 14 #define TRUNNEL_DOS_PARAM_TYPE_INTRO2_RATE_PER_SEC 1 15 #define TRUNNEL_DOS_PARAM_TYPE_INTRO2_BURST_PER_SEC 2 16 #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_EXTENSION_DOS_PARAM) 17 struct trn_cell_extension_dos_param_st { 18 uint8_t type; 19 uint64_t value; 20 uint8_t trunnel_error_code_; 21 }; 22 #endif 23 typedef struct trn_cell_extension_dos_param_st trn_cell_extension_dos_param_t; 24 #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_ESTABLISH_INTRO) 25 struct trn_cell_establish_intro_st { 26 const uint8_t *start_cell; 27 uint8_t auth_key_type; 28 uint16_t auth_key_len; 29 TRUNNEL_DYNARRAY_HEAD(, uint8_t) auth_key; 30 struct trn_extension_st *extensions; 31 const uint8_t *end_mac_fields; 32 uint8_t handshake_mac[TRUNNEL_SHA3_256_LEN]; 33 const uint8_t *end_sig_fields; 34 uint16_t sig_len; 35 TRUNNEL_DYNARRAY_HEAD(, uint8_t) sig; 36 uint8_t trunnel_error_code_; 37 }; 38 #endif 39 typedef struct trn_cell_establish_intro_st trn_cell_establish_intro_t; 40 #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_EXTENSION_DOS) 41 struct trn_cell_extension_dos_st { 42 uint8_t n_params; 43 TRUNNEL_DYNARRAY_HEAD(, struct trn_cell_extension_dos_param_st *) params; 44 uint8_t trunnel_error_code_; 45 }; 46 #endif 47 typedef struct trn_cell_extension_dos_st trn_cell_extension_dos_t; 48 #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_INTRO_ESTABLISHED) 49 struct trn_cell_intro_established_st { 50 struct trn_extension_st *extensions; 51 uint8_t trunnel_error_code_; 52 }; 53 #endif 54 typedef struct trn_cell_intro_established_st trn_cell_intro_established_t; 55 /** Return a newly allocated trn_cell_extension_dos_param with all 56 * elements set to zero. 57 */ 58 trn_cell_extension_dos_param_t *trn_cell_extension_dos_param_new(void); 59 /** Release all storage held by the trn_cell_extension_dos_param in 60 * 'victim'. (Do nothing if 'victim' is NULL.) 61 */ 62 void trn_cell_extension_dos_param_free(trn_cell_extension_dos_param_t *victim); 63 /** Try to parse a trn_cell_extension_dos_param from the buffer in 64 * 'input', using up to 'len_in' bytes from the input buffer. On 65 * success, return the number of bytes consumed and set *output to the 66 * newly allocated trn_cell_extension_dos_param_t. On failure, return 67 * -2 if the input appears truncated, and -1 if the input is otherwise 68 * invalid. 69 */ 70 ssize_t trn_cell_extension_dos_param_parse(trn_cell_extension_dos_param_t **output, const uint8_t *input, const size_t len_in); 71 /** Return the number of bytes we expect to need to encode the 72 * trn_cell_extension_dos_param in 'obj'. On failure, return a 73 * negative value. Note that this value may be an overestimate, and 74 * can even be an underestimate for certain unencodeable objects. 75 */ 76 ssize_t trn_cell_extension_dos_param_encoded_len(const trn_cell_extension_dos_param_t *obj); 77 /** Try to encode the trn_cell_extension_dos_param from 'input' into 78 * the buffer at 'output', using up to 'avail' bytes of the output 79 * buffer. On success, return the number of bytes used. On failure, 80 * return -2 if the buffer was not long enough, and -1 if the input 81 * was invalid. 82 */ 83 ssize_t trn_cell_extension_dos_param_encode(uint8_t *output, size_t avail, const trn_cell_extension_dos_param_t *input); 84 /** Check whether the internal state of the 85 * trn_cell_extension_dos_param in 'obj' is consistent. Return NULL if 86 * it is, and a short message if it is not. 87 */ 88 const char *trn_cell_extension_dos_param_check(const trn_cell_extension_dos_param_t *obj); 89 /** Clear any errors that were set on the object 'obj' by its setter 90 * functions. Return true iff errors were cleared. 91 */ 92 int trn_cell_extension_dos_param_clear_errors(trn_cell_extension_dos_param_t *obj); 93 /** Return the value of the type field of the 94 * trn_cell_extension_dos_param_t in 'inp' 95 */ 96 uint8_t trn_cell_extension_dos_param_get_type(const trn_cell_extension_dos_param_t *inp); 97 /** Set the value of the type field of the 98 * trn_cell_extension_dos_param_t in 'inp' to 'val'. Return 0 on 99 * success; return -1 and set the error code on 'inp' on failure. 100 */ 101 int trn_cell_extension_dos_param_set_type(trn_cell_extension_dos_param_t *inp, uint8_t val); 102 /** Return the value of the value field of the 103 * trn_cell_extension_dos_param_t in 'inp' 104 */ 105 uint64_t trn_cell_extension_dos_param_get_value(const trn_cell_extension_dos_param_t *inp); 106 /** Set the value of the value field of the 107 * trn_cell_extension_dos_param_t in 'inp' to 'val'. Return 0 on 108 * success; return -1 and set the error code on 'inp' on failure. 109 */ 110 int trn_cell_extension_dos_param_set_value(trn_cell_extension_dos_param_t *inp, uint64_t val); 111 /** Return a newly allocated trn_cell_establish_intro with all 112 * elements set to zero. 113 */ 114 trn_cell_establish_intro_t *trn_cell_establish_intro_new(void); 115 /** Release all storage held by the trn_cell_establish_intro in 116 * 'victim'. (Do nothing if 'victim' is NULL.) 117 */ 118 void trn_cell_establish_intro_free(trn_cell_establish_intro_t *victim); 119 /** Try to parse a trn_cell_establish_intro from the buffer in 120 * 'input', using up to 'len_in' bytes from the input buffer. On 121 * success, return the number of bytes consumed and set *output to the 122 * newly allocated trn_cell_establish_intro_t. On failure, return -2 123 * if the input appears truncated, and -1 if the input is otherwise 124 * invalid. 125 */ 126 ssize_t trn_cell_establish_intro_parse(trn_cell_establish_intro_t **output, const uint8_t *input, const size_t len_in); 127 /** Return the number of bytes we expect to need to encode the 128 * trn_cell_establish_intro in 'obj'. On failure, return a negative 129 * value. Note that this value may be an overestimate, and can even be 130 * an underestimate for certain unencodeable objects. 131 */ 132 ssize_t trn_cell_establish_intro_encoded_len(const trn_cell_establish_intro_t *obj); 133 /** Try to encode the trn_cell_establish_intro from 'input' into the 134 * buffer at 'output', using up to 'avail' bytes of the output buffer. 135 * On success, return the number of bytes used. On failure, return -2 136 * if the buffer was not long enough, and -1 if the input was invalid. 137 */ 138 ssize_t trn_cell_establish_intro_encode(uint8_t *output, size_t avail, const trn_cell_establish_intro_t *input); 139 /** Check whether the internal state of the trn_cell_establish_intro 140 * in 'obj' is consistent. Return NULL if it is, and a short message 141 * if it is not. 142 */ 143 const char *trn_cell_establish_intro_check(const trn_cell_establish_intro_t *obj); 144 /** Clear any errors that were set on the object 'obj' by its setter 145 * functions. Return true iff errors were cleared. 146 */ 147 int trn_cell_establish_intro_clear_errors(trn_cell_establish_intro_t *obj); 148 /** Return the position for start_cell when we parsed this object 149 */ 150 const uint8_t * trn_cell_establish_intro_get_start_cell(const trn_cell_establish_intro_t *inp); 151 /** Return the value of the auth_key_type field of the 152 * trn_cell_establish_intro_t in 'inp' 153 */ 154 uint8_t trn_cell_establish_intro_get_auth_key_type(const trn_cell_establish_intro_t *inp); 155 /** Set the value of the auth_key_type field of the 156 * trn_cell_establish_intro_t in 'inp' to 'val'. Return 0 on success; 157 * return -1 and set the error code on 'inp' on failure. 158 */ 159 int trn_cell_establish_intro_set_auth_key_type(trn_cell_establish_intro_t *inp, uint8_t val); 160 /** Return the value of the auth_key_len field of the 161 * trn_cell_establish_intro_t in 'inp' 162 */ 163 uint16_t trn_cell_establish_intro_get_auth_key_len(const trn_cell_establish_intro_t *inp); 164 /** Set the value of the auth_key_len field of the 165 * trn_cell_establish_intro_t in 'inp' to 'val'. Return 0 on success; 166 * return -1 and set the error code on 'inp' on failure. 167 */ 168 int trn_cell_establish_intro_set_auth_key_len(trn_cell_establish_intro_t *inp, uint16_t val); 169 /** Return the length of the dynamic array holding the auth_key field 170 * of the trn_cell_establish_intro_t in 'inp'. 171 */ 172 size_t trn_cell_establish_intro_getlen_auth_key(const trn_cell_establish_intro_t *inp); 173 /** Return the element at position 'idx' of the dynamic array field 174 * auth_key of the trn_cell_establish_intro_t in 'inp'. 175 */ 176 uint8_t trn_cell_establish_intro_get_auth_key(trn_cell_establish_intro_t *inp, size_t idx); 177 /** As trn_cell_establish_intro_get_auth_key, but take and return a 178 * const pointer 179 */ 180 uint8_t trn_cell_establish_intro_getconst_auth_key(const trn_cell_establish_intro_t *inp, size_t idx); 181 /** Change the element at position 'idx' of the dynamic array field 182 * auth_key of the trn_cell_establish_intro_t in 'inp', so that it 183 * will hold the value 'elt'. 184 */ 185 int trn_cell_establish_intro_set_auth_key(trn_cell_establish_intro_t *inp, size_t idx, uint8_t elt); 186 /** Append a new element 'elt' to the dynamic array field auth_key of 187 * the trn_cell_establish_intro_t in 'inp'. 188 */ 189 int trn_cell_establish_intro_add_auth_key(trn_cell_establish_intro_t *inp, uint8_t elt); 190 /** Return a pointer to the variable-length array field auth_key of 191 * 'inp'. 192 */ 193 uint8_t * trn_cell_establish_intro_getarray_auth_key(trn_cell_establish_intro_t *inp); 194 /** As trn_cell_establish_intro_get_auth_key, but take and return a 195 * const pointer 196 */ 197 const uint8_t * trn_cell_establish_intro_getconstarray_auth_key(const trn_cell_establish_intro_t *inp); 198 /** Change the length of the variable-length array field auth_key of 199 * 'inp' to 'newlen'.Fill extra elements with 0. Return 0 on success; 200 * return -1 and set the error code on 'inp' on failure. 201 */ 202 int trn_cell_establish_intro_setlen_auth_key(trn_cell_establish_intro_t *inp, size_t newlen); 203 /** Return the value of the extensions field of the 204 * trn_cell_establish_intro_t in 'inp' 205 */ 206 struct trn_extension_st * trn_cell_establish_intro_get_extensions(trn_cell_establish_intro_t *inp); 207 /** As trn_cell_establish_intro_get_extensions, but take and return a 208 * const pointer 209 */ 210 const struct trn_extension_st * trn_cell_establish_intro_getconst_extensions(const trn_cell_establish_intro_t *inp); 211 /** Set the value of the extensions field of the 212 * trn_cell_establish_intro_t in 'inp' to 'val'. Free the old value if 213 * any. Steals the referenceto 'val'.Return 0 on success; return -1 214 * and set the error code on 'inp' on failure. 215 */ 216 int trn_cell_establish_intro_set_extensions(trn_cell_establish_intro_t *inp, struct trn_extension_st *val); 217 /** As trn_cell_establish_intro_set_extensions, but does not free the 218 * previous value. 219 */ 220 int trn_cell_establish_intro_set0_extensions(trn_cell_establish_intro_t *inp, struct trn_extension_st *val); 221 /** Return the position for end_mac_fields when we parsed this object 222 */ 223 const uint8_t * trn_cell_establish_intro_get_end_mac_fields(const trn_cell_establish_intro_t *inp); 224 /** Return the (constant) length of the array holding the 225 * handshake_mac field of the trn_cell_establish_intro_t in 'inp'. 226 */ 227 size_t trn_cell_establish_intro_getlen_handshake_mac(const trn_cell_establish_intro_t *inp); 228 /** Return the element at position 'idx' of the fixed array field 229 * handshake_mac of the trn_cell_establish_intro_t in 'inp'. 230 */ 231 uint8_t trn_cell_establish_intro_get_handshake_mac(trn_cell_establish_intro_t *inp, size_t idx); 232 /** As trn_cell_establish_intro_get_handshake_mac, but take and return 233 * a const pointer 234 */ 235 uint8_t trn_cell_establish_intro_getconst_handshake_mac(const trn_cell_establish_intro_t *inp, size_t idx); 236 /** Change the element at position 'idx' of the fixed array field 237 * handshake_mac of the trn_cell_establish_intro_t in 'inp', so that 238 * it will hold the value 'elt'. 239 */ 240 int trn_cell_establish_intro_set_handshake_mac(trn_cell_establish_intro_t *inp, size_t idx, uint8_t elt); 241 /** Return a pointer to the TRUNNEL_SHA3_256_LEN-element array field 242 * handshake_mac of 'inp'. 243 */ 244 uint8_t * trn_cell_establish_intro_getarray_handshake_mac(trn_cell_establish_intro_t *inp); 245 /** As trn_cell_establish_intro_get_handshake_mac, but take and return 246 * a const pointer 247 */ 248 const uint8_t * trn_cell_establish_intro_getconstarray_handshake_mac(const trn_cell_establish_intro_t *inp); 249 /** Return the position for end_sig_fields when we parsed this object 250 */ 251 const uint8_t * trn_cell_establish_intro_get_end_sig_fields(const trn_cell_establish_intro_t *inp); 252 /** Return the value of the sig_len field of the 253 * trn_cell_establish_intro_t in 'inp' 254 */ 255 uint16_t trn_cell_establish_intro_get_sig_len(const trn_cell_establish_intro_t *inp); 256 /** Set the value of the sig_len field of the 257 * trn_cell_establish_intro_t in 'inp' to 'val'. Return 0 on success; 258 * return -1 and set the error code on 'inp' on failure. 259 */ 260 int trn_cell_establish_intro_set_sig_len(trn_cell_establish_intro_t *inp, uint16_t val); 261 /** Return the length of the dynamic array holding the sig field of 262 * the trn_cell_establish_intro_t in 'inp'. 263 */ 264 size_t trn_cell_establish_intro_getlen_sig(const trn_cell_establish_intro_t *inp); 265 /** Return the element at position 'idx' of the dynamic array field 266 * sig of the trn_cell_establish_intro_t in 'inp'. 267 */ 268 uint8_t trn_cell_establish_intro_get_sig(trn_cell_establish_intro_t *inp, size_t idx); 269 /** As trn_cell_establish_intro_get_sig, but take and return a const 270 * pointer 271 */ 272 uint8_t trn_cell_establish_intro_getconst_sig(const trn_cell_establish_intro_t *inp, size_t idx); 273 /** Change the element at position 'idx' of the dynamic array field 274 * sig of the trn_cell_establish_intro_t in 'inp', so that it will 275 * hold the value 'elt'. 276 */ 277 int trn_cell_establish_intro_set_sig(trn_cell_establish_intro_t *inp, size_t idx, uint8_t elt); 278 /** Append a new element 'elt' to the dynamic array field sig of the 279 * trn_cell_establish_intro_t in 'inp'. 280 */ 281 int trn_cell_establish_intro_add_sig(trn_cell_establish_intro_t *inp, uint8_t elt); 282 /** Return a pointer to the variable-length array field sig of 'inp'. 283 */ 284 uint8_t * trn_cell_establish_intro_getarray_sig(trn_cell_establish_intro_t *inp); 285 /** As trn_cell_establish_intro_get_sig, but take and return a const 286 * pointer 287 */ 288 const uint8_t * trn_cell_establish_intro_getconstarray_sig(const trn_cell_establish_intro_t *inp); 289 /** Change the length of the variable-length array field sig of 'inp' 290 * to 'newlen'.Fill extra elements with 0. Return 0 on success; return 291 * -1 and set the error code on 'inp' on failure. 292 */ 293 int trn_cell_establish_intro_setlen_sig(trn_cell_establish_intro_t *inp, size_t newlen); 294 /** Return a newly allocated trn_cell_extension_dos with all elements 295 * set to zero. 296 */ 297 trn_cell_extension_dos_t *trn_cell_extension_dos_new(void); 298 /** Release all storage held by the trn_cell_extension_dos in 299 * 'victim'. (Do nothing if 'victim' is NULL.) 300 */ 301 void trn_cell_extension_dos_free(trn_cell_extension_dos_t *victim); 302 /** Try to parse a trn_cell_extension_dos from the buffer in 'input', 303 * using up to 'len_in' bytes from the input buffer. On success, 304 * return the number of bytes consumed and set *output to the newly 305 * allocated trn_cell_extension_dos_t. On failure, return -2 if the 306 * input appears truncated, and -1 if the input is otherwise invalid. 307 */ 308 ssize_t trn_cell_extension_dos_parse(trn_cell_extension_dos_t **output, const uint8_t *input, const size_t len_in); 309 /** Return the number of bytes we expect to need to encode the 310 * trn_cell_extension_dos in 'obj'. On failure, return a negative 311 * value. Note that this value may be an overestimate, and can even be 312 * an underestimate for certain unencodeable objects. 313 */ 314 ssize_t trn_cell_extension_dos_encoded_len(const trn_cell_extension_dos_t *obj); 315 /** Try to encode the trn_cell_extension_dos from 'input' into the 316 * buffer at 'output', using up to 'avail' bytes of the output buffer. 317 * On success, return the number of bytes used. On failure, return -2 318 * if the buffer was not long enough, and -1 if the input was invalid. 319 */ 320 ssize_t trn_cell_extension_dos_encode(uint8_t *output, size_t avail, const trn_cell_extension_dos_t *input); 321 /** Check whether the internal state of the trn_cell_extension_dos in 322 * 'obj' is consistent. Return NULL if it is, and a short message if 323 * it is not. 324 */ 325 const char *trn_cell_extension_dos_check(const trn_cell_extension_dos_t *obj); 326 /** Clear any errors that were set on the object 'obj' by its setter 327 * functions. Return true iff errors were cleared. 328 */ 329 int trn_cell_extension_dos_clear_errors(trn_cell_extension_dos_t *obj); 330 /** Return the value of the n_params field of the 331 * trn_cell_extension_dos_t in 'inp' 332 */ 333 uint8_t trn_cell_extension_dos_get_n_params(const trn_cell_extension_dos_t *inp); 334 /** Set the value of the n_params field of the 335 * trn_cell_extension_dos_t in 'inp' to 'val'. Return 0 on success; 336 * return -1 and set the error code on 'inp' on failure. 337 */ 338 int trn_cell_extension_dos_set_n_params(trn_cell_extension_dos_t *inp, uint8_t val); 339 /** Return the length of the dynamic array holding the params field of 340 * the trn_cell_extension_dos_t in 'inp'. 341 */ 342 size_t trn_cell_extension_dos_getlen_params(const trn_cell_extension_dos_t *inp); 343 /** Return the element at position 'idx' of the dynamic array field 344 * params of the trn_cell_extension_dos_t in 'inp'. 345 */ 346 struct trn_cell_extension_dos_param_st * trn_cell_extension_dos_get_params(trn_cell_extension_dos_t *inp, size_t idx); 347 /** As trn_cell_extension_dos_get_params, but take and return a const 348 * pointer 349 */ 350 const struct trn_cell_extension_dos_param_st * trn_cell_extension_dos_getconst_params(const trn_cell_extension_dos_t *inp, size_t idx); 351 /** Change the element at position 'idx' of the dynamic array field 352 * params of the trn_cell_extension_dos_t in 'inp', so that it will 353 * hold the value 'elt'. Free the previous value, if any. 354 */ 355 int trn_cell_extension_dos_set_params(trn_cell_extension_dos_t *inp, size_t idx, struct trn_cell_extension_dos_param_st * elt); 356 /** As trn_cell_extension_dos_set_params, but does not free the 357 * previous value. 358 */ 359 int trn_cell_extension_dos_set0_params(trn_cell_extension_dos_t *inp, size_t idx, struct trn_cell_extension_dos_param_st * elt); 360 /** Append a new element 'elt' to the dynamic array field params of 361 * the trn_cell_extension_dos_t in 'inp'. 362 */ 363 int trn_cell_extension_dos_add_params(trn_cell_extension_dos_t *inp, struct trn_cell_extension_dos_param_st * elt); 364 /** Return a pointer to the variable-length array field params of 365 * 'inp'. 366 */ 367 struct trn_cell_extension_dos_param_st * * trn_cell_extension_dos_getarray_params(trn_cell_extension_dos_t *inp); 368 /** As trn_cell_extension_dos_get_params, but take and return a const 369 * pointer 370 */ 371 const struct trn_cell_extension_dos_param_st * const * trn_cell_extension_dos_getconstarray_params(const trn_cell_extension_dos_t *inp); 372 /** Change the length of the variable-length array field params of 373 * 'inp' to 'newlen'.Fill extra elements with NULL; free removed 374 * elements. Return 0 on success; return -1 and set the error code on 375 * 'inp' on failure. 376 */ 377 int trn_cell_extension_dos_setlen_params(trn_cell_extension_dos_t *inp, size_t newlen); 378 /** Return a newly allocated trn_cell_intro_established with all 379 * elements set to zero. 380 */ 381 trn_cell_intro_established_t *trn_cell_intro_established_new(void); 382 /** Release all storage held by the trn_cell_intro_established in 383 * 'victim'. (Do nothing if 'victim' is NULL.) 384 */ 385 void trn_cell_intro_established_free(trn_cell_intro_established_t *victim); 386 /** Try to parse a trn_cell_intro_established from the buffer in 387 * 'input', using up to 'len_in' bytes from the input buffer. On 388 * success, return the number of bytes consumed and set *output to the 389 * newly allocated trn_cell_intro_established_t. On failure, return -2 390 * if the input appears truncated, and -1 if the input is otherwise 391 * invalid. 392 */ 393 ssize_t trn_cell_intro_established_parse(trn_cell_intro_established_t **output, const uint8_t *input, const size_t len_in); 394 /** Return the number of bytes we expect to need to encode the 395 * trn_cell_intro_established in 'obj'. On failure, return a negative 396 * value. Note that this value may be an overestimate, and can even be 397 * an underestimate for certain unencodeable objects. 398 */ 399 ssize_t trn_cell_intro_established_encoded_len(const trn_cell_intro_established_t *obj); 400 /** Try to encode the trn_cell_intro_established from 'input' into the 401 * buffer at 'output', using up to 'avail' bytes of the output buffer. 402 * On success, return the number of bytes used. On failure, return -2 403 * if the buffer was not long enough, and -1 if the input was invalid. 404 */ 405 ssize_t trn_cell_intro_established_encode(uint8_t *output, size_t avail, const trn_cell_intro_established_t *input); 406 /** Check whether the internal state of the trn_cell_intro_established 407 * in 'obj' is consistent. Return NULL if it is, and a short message 408 * if it is not. 409 */ 410 const char *trn_cell_intro_established_check(const trn_cell_intro_established_t *obj); 411 /** Clear any errors that were set on the object 'obj' by its setter 412 * functions. Return true iff errors were cleared. 413 */ 414 int trn_cell_intro_established_clear_errors(trn_cell_intro_established_t *obj); 415 /** Return the value of the extensions field of the 416 * trn_cell_intro_established_t in 'inp' 417 */ 418 struct trn_extension_st * trn_cell_intro_established_get_extensions(trn_cell_intro_established_t *inp); 419 /** As trn_cell_intro_established_get_extensions, but take and return 420 * a const pointer 421 */ 422 const struct trn_extension_st * trn_cell_intro_established_getconst_extensions(const trn_cell_intro_established_t *inp); 423 /** Set the value of the extensions field of the 424 * trn_cell_intro_established_t in 'inp' to 'val'. Free the old value 425 * if any. Steals the referenceto 'val'.Return 0 on success; return -1 426 * and set the error code on 'inp' on failure. 427 */ 428 int trn_cell_intro_established_set_extensions(trn_cell_intro_established_t *inp, struct trn_extension_st *val); 429 /** As trn_cell_intro_established_set_extensions, but does not free 430 * the previous value. 431 */ 432 int trn_cell_intro_established_set0_extensions(trn_cell_intro_established_t *inp, struct trn_extension_st *val); 433 434 435 #endif