aboutsummaryrefslogtreecommitdiff
path: root/src/trunnel/hs/cell_establish_intro.h
blob: 1924d9cab66e050cafaf3a1de968c12cf66f7049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
/* cell_establish_intro.h -- generated by Trunnel v1.5.3.
 * https://gitweb.torproject.org/trunnel.git
 * You probably shouldn't edit this file.
 */
#ifndef TRUNNEL_CELL_ESTABLISH_INTRO_H
#define TRUNNEL_CELL_ESTABLISH_INTRO_H

#include <stdint.h>
#include "trunnel.h"

struct trn_cell_extension_st;
#define TRUNNEL_SHA3_256_LEN 32
#define TRUNNEL_CELL_EXTENSION_TYPE_DOS 1
#define TRUNNEL_DOS_PARAM_TYPE_INTRO2_RATE_PER_SEC 1
#define TRUNNEL_DOS_PARAM_TYPE_INTRO2_BURST_PER_SEC 2
#if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_EXTENSION_DOS_PARAM)
struct trn_cell_extension_dos_param_st {
  uint8_t type;
  uint64_t value;
  uint8_t trunnel_error_code_;
};
#endif
typedef struct trn_cell_extension_dos_param_st trn_cell_extension_dos_param_t;
#if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_ESTABLISH_INTRO)
struct trn_cell_establish_intro_st {
  const uint8_t *start_cell;
  uint8_t auth_key_type;
  uint16_t auth_key_len;
  TRUNNEL_DYNARRAY_HEAD(, uint8_t) auth_key;
  struct trn_cell_extension_st *extensions;
  const uint8_t *end_mac_fields;
  uint8_t handshake_mac[TRUNNEL_SHA3_256_LEN];
  const uint8_t *end_sig_fields;
  uint16_t sig_len;
  TRUNNEL_DYNARRAY_HEAD(, uint8_t) sig;
  uint8_t trunnel_error_code_;
};
#endif
typedef struct trn_cell_establish_intro_st trn_cell_establish_intro_t;
#if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_EXTENSION_DOS)
struct trn_cell_extension_dos_st {
  uint8_t n_params;
  TRUNNEL_DYNARRAY_HEAD(, struct trn_cell_extension_dos_param_st *) params;
  uint8_t trunnel_error_code_;
};
#endif
typedef struct trn_cell_extension_dos_st trn_cell_extension_dos_t;
#if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TRN_CELL_INTRO_ESTABLISHED)
struct trn_cell_intro_established_st {
  struct trn_cell_extension_st *extensions;
  uint8_t trunnel_error_code_;
};
#endif
typedef struct trn_cell_intro_established_st trn_cell_intro_established_t;
/** Return a newly allocated trn_cell_extension_dos_param with all
 * elements set to zero.
 */
trn_cell_extension_dos_param_t *trn_cell_extension_dos_param_new(void);
/** Release all storage held by the trn_cell_extension_dos_param in
 * 'victim'. (Do nothing if 'victim' is NULL.)
 */
void trn_cell_extension_dos_param_free(trn_cell_extension_dos_param_t *victim);
/** Try to parse a trn_cell_extension_dos_param from the buffer in
 * 'input', using up to 'len_in' bytes from the input buffer. On
 * success, return the number of bytes consumed and set *output to the
 * newly allocated trn_cell_extension_dos_param_t. On failure, return
 * -2 if the input appears truncated, and -1 if the input is otherwise
 * invalid.
 */
ssize_t trn_cell_extension_dos_param_parse(trn_cell_extension_dos_param_t **output, const uint8_t *input, const size_t len_in);
/** Return the number of bytes we expect to need to encode the
 * trn_cell_extension_dos_param in 'obj'. On failure, return a
 * negative value. Note that this value may be an overestimate, and
 * can even be an underestimate for certain unencodeable objects.
 */
ssize_t trn_cell_extension_dos_param_encoded_len(const trn_cell_extension_dos_param_t *obj);
/** Try to encode the trn_cell_extension_dos_param from 'input' into
 * the buffer at 'output', using up to 'avail' bytes of the output
 * buffer. On success, return the number of bytes used. On failure,
 * return -2 if the buffer was not long enough, and -1 if the input
 * was invalid.
 */
ssize_t trn_cell_extension_dos_param_encode(uint8_t *output, size_t avail, const trn_cell_extension_dos_param_t *input);
/** Check whether the internal state of the
 * trn_cell_extension_dos_param in 'obj' is consistent. Return NULL if
 * it is, and a short message if it is not.
 */
const char *trn_cell_extension_dos_param_check(const trn_cell_extension_dos_param_t *obj);
/** Clear any errors that were set on the object 'obj' by its setter
 * functions. Return true iff errors were cleared.
 */
int trn_cell_extension_dos_param_clear_errors(trn_cell_extension_dos_param_t *obj);
/** Return the value of the type field of the
 * trn_cell_extension_dos_param_t in 'inp'
 */
uint8_t trn_cell_extension_dos_param_get_type(const trn_cell_extension_dos_param_t *inp);
/** Set the value of the type field of the
 * trn_cell_extension_dos_param_t in 'inp' to 'val'. Return 0 on
 * success; return -1 and set the error code on 'inp' on failure.
 */
int trn_cell_extension_dos_param_set_type(trn_cell_extension_dos_param_t *inp, uint8_t val);
/** Return the value of the value field of the
 * trn_cell_extension_dos_param_t in 'inp'
 */
uint64_t trn_cell_extension_dos_param_get_value(const trn_cell_extension_dos_param_t *inp);
/** Set the value of the value field of the
 * trn_cell_extension_dos_param_t in 'inp' to 'val'. Return 0 on
 * success; return -1 and set the error code on 'inp' on failure.
 */
int trn_cell_extension_dos_param_set_value(trn_cell_extension_dos_param_t *inp, uint64_t val);
/** Return a newly allocated trn_cell_establish_intro with all
 * elements set to zero.
 */
trn_cell_establish_intro_t *trn_cell_establish_intro_new(void);
/** Release all storage held by the trn_cell_establish_intro in
 * 'victim'. (Do nothing if 'victim' is NULL.)
 */
void trn_cell_establish_intro_free(trn_cell_establish_intro_t *victim);
/** Try to parse a trn_cell_establish_intro from the buffer in
 * 'input', using up to 'len_in' bytes from the input buffer. On
 * success, return the number of bytes consumed and set *output to the
 * newly allocated trn_cell_establish_intro_t. On failure, return -2
 * if the input appears truncated, and -1 if the input is otherwise
 * invalid.
 */
ssize_t trn_cell_establish_intro_parse(trn_cell_establish_intro_t **output, const uint8_t *input, const size_t len_in);
/** Return the number of bytes we expect to need to encode the
 * trn_cell_establish_intro in 'obj'. On failure, return a negative
 * value. Note that this value may be an overestimate, and can even be
 * an underestimate for certain unencodeable objects.
 */
ssize_t trn_cell_establish_intro_encoded_len(const trn_cell_establish_intro_t *obj);
/** Try to encode the trn_cell_establish_intro from 'input' into the
 * buffer at 'output', using up to 'avail' bytes of the output buffer.
 * On success, return the number of bytes used. On failure, return -2
 * if the buffer was not long enough, and -1 if the input was invalid.
 */
ssize_t trn_cell_establish_intro_encode(uint8_t *output, size_t avail, const trn_cell_establish_intro_t *input);
/** Check whether the internal state of the trn_cell_establish_intro
 * in 'obj' is consistent. Return NULL if it is, and a short message
 * if it is not.
 */
const char *trn_cell_establish_intro_check(const trn_cell_establish_intro_t *obj);
/** Clear any errors that were set on the object 'obj' by its setter
 * functions. Return true iff errors were cleared.
 */
int trn_cell_establish_intro_clear_errors(trn_cell_establish_intro_t *obj);
/** Return the position for start_cell when we parsed this object
 */
const uint8_t * trn_cell_establish_intro_get_start_cell(const trn_cell_establish_intro_t *inp);
/** Return the value of the auth_key_type field of the
 * trn_cell_establish_intro_t in 'inp'
 */
uint8_t trn_cell_establish_intro_get_auth_key_type(const trn_cell_establish_intro_t *inp);
/** Set the value of the auth_key_type field of the
 * trn_cell_establish_intro_t in 'inp' to 'val'. Return 0 on success;
 * return -1 and set the error code on 'inp' on failure.
 */
int trn_cell_establish_intro_set_auth_key_type(trn_cell_establish_intro_t *inp, uint8_t val);
/** Return the value of the auth_key_len field of the
 * trn_cell_establish_intro_t in 'inp'
 */
uint16_t trn_cell_establish_intro_get_auth_key_len(const trn_cell_establish_intro_t *inp);
/** Set the value of the auth_key_len field of the
 * trn_cell_establish_intro_t in 'inp' to 'val'. Return 0 on success;
 * return -1 and set the error code on 'inp' on failure.
 */
int trn_cell_establish_intro_set_auth_key_len(trn_cell_establish_intro_t *inp, uint16_t val);
/** Return the length of the dynamic array holding the auth_key field
 * of the trn_cell_establish_intro_t in 'inp'.
 */
size_t trn_cell_establish_intro_getlen_auth_key(const trn_cell_establish_intro_t *inp);
/** Return the element at position 'idx' of the dynamic array field
 * auth_key of the trn_cell_establish_intro_t in 'inp'.
 */
uint8_t trn_cell_establish_intro_get_auth_key(trn_cell_establish_intro_t *inp, size_t idx);
/** As trn_cell_establish_intro_get_auth_key, but take and return a
 * const pointer
 */
uint8_t trn_cell_establish_intro_getconst_auth_key(const trn_cell_establish_intro_t *inp, size_t idx);
/** Change the element at position 'idx' of the dynamic array field
 * auth_key of the trn_cell_establish_intro_t in 'inp', so that it
 * will hold the value 'elt'.
 */
int trn_cell_establish_intro_set_auth_key(trn_cell_establish_intro_t *inp, size_t idx, uint8_t elt);
/** Append a new element 'elt' to the dynamic array field auth_key of
 * the trn_cell_establish_intro_t in 'inp'.
 */
int trn_cell_establish_intro_add_auth_key(trn_cell_establish_intro_t *inp, uint8_t elt);
/** Return a pointer to the variable-length array field auth_key of
 * 'inp'.
 */
uint8_t * trn_cell_establish_intro_getarray_auth_key(trn_cell_establish_intro_t *inp);
/** As trn_cell_establish_intro_get_auth_key, but take and return a
 * const pointer
 */
const uint8_t  * trn_cell_establish_intro_getconstarray_auth_key(const trn_cell_establish_intro_t *inp);
/** Change the length of the variable-length array field auth_key of
 * 'inp' to 'newlen'.Fill extra elements with 0. Return 0 on success;
 * return -1 and set the error code on 'inp' on failure.
 */
int trn_cell_establish_intro_setlen_auth_key(trn_cell_establish_intro_t *inp, size_t newlen);
/** Return the value of the extensions field of the
 * trn_cell_establish_intro_t in 'inp'
 */
struct trn_cell_extension_st * trn_cell_establish_intro_get_extensions(trn_cell_establish_intro_t *inp);
/** As trn_cell_establish_intro_get_extensions, but take and return a
 * const pointer
 */
const struct trn_cell_extension_st * trn_cell_establish_intro_getconst_extensions(const trn_cell_establish_intro_t *inp);
/** Set the value of the extensions field of the
 * trn_cell_establish_intro_t in 'inp' to 'val'. Free the old value if
 * any. Steals the referenceto 'val'.Return 0 on success; return -1
 * and set the error code on 'inp' on failure.
 */
int trn_cell_establish_intro_set_extensions(trn_cell_establish_intro_t *inp, struct trn_cell_extension_st *val);
/** As trn_cell_establish_intro_set_extensions, but does not free the
 * previous value.
 */
int trn_cell_establish_intro_set0_extensions(trn_cell_establish_intro_t *inp, struct trn_cell_extension_st *val);
/** Return the position for end_mac_fields when we parsed this object
 */
const uint8_t * trn_cell_establish_intro_get_end_mac_fields(const trn_cell_establish_intro_t *inp);
/** Return the (constant) length of the array holding the
 * handshake_mac field of the trn_cell_establish_intro_t in 'inp'.
 */
size_t trn_cell_establish_intro_getlen_handshake_mac(const trn_cell_establish_intro_t *inp);
/** Return the element at position 'idx' of the fixed array field
 * handshake_mac of the trn_cell_establish_intro_t in 'inp'.
 */
uint8_t trn_cell_establish_intro_get_handshake_mac(trn_cell_establish_intro_t *inp, size_t idx);
/** As trn_cell_establish_intro_get_handshake_mac, but take and return
 * a const pointer
 */
uint8_t trn_cell_establish_intro_getconst_handshake_mac(const trn_cell_establish_intro_t *inp, size_t idx);
/** Change the element at position 'idx' of the fixed array field
 * handshake_mac of the trn_cell_establish_intro_t in 'inp', so that
 * it will hold the value 'elt'.
 */
int trn_cell_establish_intro_set_handshake_mac(trn_cell_establish_intro_t *inp, size_t idx, uint8_t elt);
/** Return a pointer to the TRUNNEL_SHA3_256_LEN-element array field
 * handshake_mac of 'inp'.
 */
uint8_t * trn_cell_establish_intro_getarray_handshake_mac(trn_cell_establish_intro_t *inp);
/** As trn_cell_establish_intro_get_handshake_mac, but take and return
 * a const pointer
 */
const uint8_t  * trn_cell_establish_intro_getconstarray_handshake_mac(const trn_cell_establish_intro_t *inp);
/** Return the position for end_sig_fields when we parsed this object
 */
const uint8_t * trn_cell_establish_intro_get_end_sig_fields(const trn_cell_establish_intro_t *inp);
/** Return the value of the sig_len field of the
 * trn_cell_establish_intro_t in 'inp'
 */
uint16_t trn_cell_establish_intro_get_sig_len(const trn_cell_establish_intro_t *inp);
/** Set the value of the sig_len field of the
 * trn_cell_establish_intro_t in 'inp' to 'val'. Return 0 on success;
 * return -1 and set the error code on 'inp' on failure.
 */
int trn_cell_establish_intro_set_sig_len(trn_cell_establish_intro_t *inp, uint16_t val);
/** Return the length of the dynamic array holding the sig field of
 * the trn_cell_establish_intro_t in 'inp'.
 */
size_t trn_cell_establish_intro_getlen_sig(const trn_cell_establish_intro_t *inp);
/** Return the element at position 'idx' of the dynamic array field
 * sig of the trn_cell_establish_intro_t in 'inp'.
 */
uint8_t trn_cell_establish_intro_get_sig(trn_cell_establish_intro_t *inp, size_t idx);
/** As trn_cell_establish_intro_get_sig, but take and return a const
 * pointer
 */
uint8_t trn_cell_establish_intro_getconst_sig(const trn_cell_establish_intro_t *inp, size_t idx);
/** Change the element at position 'idx' of the dynamic array field
 * sig of the trn_cell_establish_intro_t in 'inp', so that it will
 * hold the value 'elt'.
 */
int trn_cell_establish_intro_set_sig(trn_cell_establish_intro_t *inp, size_t idx, uint8_t elt);
/** Append a new element 'elt' to the dynamic array field sig of the
 * trn_cell_establish_intro_t in 'inp'.
 */
int trn_cell_establish_intro_add_sig(trn_cell_establish_intro_t *inp, uint8_t elt);
/** Return a pointer to the variable-length array field sig of 'inp'.
 */
uint8_t * trn_cell_establish_intro_getarray_sig(trn_cell_establish_intro_t *inp);
/** As trn_cell_establish_intro_get_sig, but take and return a const
 * pointer
 */
const uint8_t  * trn_cell_establish_intro_getconstarray_sig(const trn_cell_establish_intro_t *inp);
/** Change the length of the variable-length array field sig of 'inp'
 * to 'newlen'.Fill extra elements with 0. Return 0 on success; return
 * -1 and set the error code on 'inp' on failure.
 */
int trn_cell_establish_intro_setlen_sig(trn_cell_establish_intro_t *inp, size_t newlen);
/** Return a newly allocated trn_cell_extension_dos with all elements
 * set to zero.
 */
trn_cell_extension_dos_t *trn_cell_extension_dos_new(void);
/** Release all storage held by the trn_cell_extension_dos in
 * 'victim'. (Do nothing if 'victim' is NULL.)
 */
void trn_cell_extension_dos_free(trn_cell_extension_dos_t *victim);
/** Try to parse a trn_cell_extension_dos from the buffer in 'input',
 * using up to 'len_in' bytes from the input buffer. On success,
 * return the number of bytes consumed and set *output to the newly
 * allocated trn_cell_extension_dos_t. On failure, return -2 if the
 * input appears truncated, and -1 if the input is otherwise invalid.
 */
ssize_t trn_cell_extension_dos_parse(trn_cell_extension_dos_t **output, const uint8_t *input, const size_t len_in);
/** Return the number of bytes we expect to need to encode the
 * trn_cell_extension_dos in 'obj'. On failure, return a negative
 * value. Note that this value may be an overestimate, and can even be
 * an underestimate for certain unencodeable objects.
 */
ssize_t trn_cell_extension_dos_encoded_len(const trn_cell_extension_dos_t *obj);
/** Try to encode the trn_cell_extension_dos from 'input' into the
 * buffer at 'output', using up to 'avail' bytes of the output buffer.
 * On success, return the number of bytes used. On failure, return -2
 * if the buffer was not long enough, and -1 if the input was invalid.
 */
ssize_t trn_cell_extension_dos_encode(uint8_t *output, size_t avail, const trn_cell_extension_dos_t *input);
/** Check whether the internal state of the trn_cell_extension_dos in
 * 'obj' is consistent. Return NULL if it is, and a short message if
 * it is not.
 */
const char *trn_cell_extension_dos_check(const trn_cell_extension_dos_t *obj);
/** Clear any errors that were set on the object 'obj' by its setter
 * functions. Return true iff errors were cleared.
 */
int trn_cell_extension_dos_clear_errors(trn_cell_extension_dos_t *obj);
/** Return the value of the n_params field of the
 * trn_cell_extension_dos_t in 'inp'
 */
uint8_t trn_cell_extension_dos_get_n_params(const trn_cell_extension_dos_t *inp);
/** Set the value of the n_params field of the
 * trn_cell_extension_dos_t in 'inp' to 'val'. Return 0 on success;
 * return -1 and set the error code on 'inp' on failure.
 */
int trn_cell_extension_dos_set_n_params(trn_cell_extension_dos_t *inp, uint8_t val);
/** Return the length of the dynamic array holding the params field of
 * the trn_cell_extension_dos_t in 'inp'.
 */
size_t trn_cell_extension_dos_getlen_params(const trn_cell_extension_dos_t *inp);
/** Return the element at position 'idx' of the dynamic array field
 * params of the trn_cell_extension_dos_t in 'inp'.
 */
struct trn_cell_extension_dos_param_st * trn_cell_extension_dos_get_params(trn_cell_extension_dos_t *inp, size_t idx);
/** As trn_cell_extension_dos_get_params, but take and return a const
 * pointer
 */
 const struct trn_cell_extension_dos_param_st * trn_cell_extension_dos_getconst_params(const trn_cell_extension_dos_t *inp, size_t idx);
/** Change the element at position 'idx' of the dynamic array field
 * params of the trn_cell_extension_dos_t in 'inp', so that it will
 * hold the value 'elt'. Free the previous value, if any.
 */
int trn_cell_extension_dos_set_params(trn_cell_extension_dos_t *inp, size_t idx, struct trn_cell_extension_dos_param_st * elt);
/** As trn_cell_extension_dos_set_params, but does not free the
 * previous value.
 */
int trn_cell_extension_dos_set0_params(trn_cell_extension_dos_t *inp, size_t idx, struct trn_cell_extension_dos_param_st * elt);
/** Append a new element 'elt' to the dynamic array field params of
 * the trn_cell_extension_dos_t in 'inp'.
 */
int trn_cell_extension_dos_add_params(trn_cell_extension_dos_t *inp, struct trn_cell_extension_dos_param_st * elt);
/** Return a pointer to the variable-length array field params of
 * 'inp'.
 */
struct trn_cell_extension_dos_param_st * * trn_cell_extension_dos_getarray_params(trn_cell_extension_dos_t *inp);
/** As trn_cell_extension_dos_get_params, but take and return a const
 * pointer
 */
const struct trn_cell_extension_dos_param_st *  const  * trn_cell_extension_dos_getconstarray_params(const trn_cell_extension_dos_t *inp);
/** Change the length of the variable-length array field params of
 * 'inp' to 'newlen'.Fill extra elements with NULL; free removed
 * elements. Return 0 on success; return -1 and set the error code on
 * 'inp' on failure.
 */
int trn_cell_extension_dos_setlen_params(trn_cell_extension_dos_t *inp, size_t newlen);
/** Return a newly allocated trn_cell_intro_established with all
 * elements set to zero.
 */
trn_cell_intro_established_t *trn_cell_intro_established_new(void);
/** Release all storage held by the trn_cell_intro_established in
 * 'victim'. (Do nothing if 'victim' is NULL.)
 */
void trn_cell_intro_established_free(trn_cell_intro_established_t *victim);
/** Try to parse a trn_cell_intro_established from the buffer in
 * 'input', using up to 'len_in' bytes from the input buffer. On
 * success, return the number of bytes consumed and set *output to the
 * newly allocated trn_cell_intro_established_t. On failure, return -2
 * if the input appears truncated, and -1 if the input is otherwise
 * invalid.
 */
ssize_t trn_cell_intro_established_parse(trn_cell_intro_established_t **output, const uint8_t *input, const size_t len_in);
/** Return the number of bytes we expect to need to encode the
 * trn_cell_intro_established in 'obj'. On failure, return a negative
 * value. Note that this value may be an overestimate, and can even be
 * an underestimate for certain unencodeable objects.
 */
ssize_t trn_cell_intro_established_encoded_len(const trn_cell_intro_established_t *obj);
/** Try to encode the trn_cell_intro_established from 'input' into the
 * buffer at 'output', using up to 'avail' bytes of the output buffer.
 * On success, return the number of bytes used. On failure, return -2
 * if the buffer was not long enough, and -1 if the input was invalid.
 */
ssize_t trn_cell_intro_established_encode(uint8_t *output, size_t avail, const trn_cell_intro_established_t *input);
/** Check whether the internal state of the trn_cell_intro_established
 * in 'obj' is consistent. Return NULL if it is, and a short message
 * if it is not.
 */
const char *trn_cell_intro_established_check(const trn_cell_intro_established_t *obj);
/** Clear any errors that were set on the object 'obj' by its setter
 * functions. Return true iff errors were cleared.
 */
int trn_cell_intro_established_clear_errors(trn_cell_intro_established_t *obj);
/** Return the value of the extensions field of the
 * trn_cell_intro_established_t in 'inp'
 */
struct trn_cell_extension_st * trn_cell_intro_established_get_extensions(trn_cell_intro_established_t *inp);
/** As trn_cell_intro_established_get_extensions, but take and return
 * a const pointer
 */
const struct trn_cell_extension_st * trn_cell_intro_established_getconst_extensions(const trn_cell_intro_established_t *inp);
/** Set the value of the extensions field of the
 * trn_cell_intro_established_t in 'inp' to 'val'. Free the old value
 * if any. Steals the referenceto 'val'.Return 0 on success; return -1
 * and set the error code on 'inp' on failure.
 */
int trn_cell_intro_established_set_extensions(trn_cell_intro_established_t *inp, struct trn_cell_extension_st *val);
/** As trn_cell_intro_established_set_extensions, but does not free
 * the previous value.
 */
int trn_cell_intro_established_set0_extensions(trn_cell_intro_established_t *inp, struct trn_cell_extension_st *val);


#endif