9 #ifndef TOR_PARSECOMMON_H
10 #define TOR_PARSECOMMON_H
26 K_DIRECTORY_SIGNATURE,
27 K_RECOMMENDED_SOFTWARE,
52 K_NETWORK_STATUS_VERSION,
57 K_RECOMMENDED_CLIENT_PROTOCOLS,
58 K_RECOMMENDED_RELAY_PROTOCOLS,
59 K_REQUIRED_CLIENT_PROTOCOLS,
60 K_REQUIRED_RELAY_PROTOCOLS,
75 K_ALLOW_SINGLE_HOP_EXITS,
80 K_ONION_KEY_CROSSCERT,
81 K_NTOR_ONION_KEY_CROSSCERT,
108 K_DIR_KEY_CERTIFICATE_VERSION,
112 K_DIR_KEY_CERTIFICATION,
129 K_ADDITIONAL_SIGNATURE,
145 R_RENDEZVOUS_SERVICE_DESCRIPTOR,
151 R_INTRODUCTION_POINTS,
157 R3_DESC_SIGNING_CERT,
162 R3_INTRO_AUTH_REQUIRED,
163 R3_SINGLE_ONION_SERVICE,
164 R3_INTRODUCTION_POINT,
168 R3_INTRO_ENC_KEY_CERT,
170 R3_INTRO_LEGACY_KEY_CERT,
229 #define TS_ANNOTATIONS_OK 1
231 #define TS_NO_NEW_ANNOTATIONS 4
243 #define END_OF_TABLE { NULL, NIL_, 0,0,0, NO_OBJ, 0, INT_MAX, 0, 0 }
245 #define T(s,t,a,o) { s, t, a, o, 0, INT_MAX, 0, 0 }
247 #define T0N(s,t,a,o) { s, t, a, o, 0, INT_MAX, 0, 0 }
249 #define T1(s,t,a,o) { s, t, a, o, 1, 1, 0, 0 }
251 #define T1_START(s,t,a,o) { s, t, a, o, 1, 1, AT_START, 0 }
253 #define T1_END(s,t,a,o) { s, t, a, o, 1, 1, AT_END, 0 }
255 #define T1N(s,t,a,o) { s, t, a, o, 1, INT_MAX, 0, 0 }
257 #define T01(s,t,a,o) { s, t, a, o, 0, 1, 0, 0 }
259 #define A01(s,t,a,o) { s, t, a, o, 0, 1, 0, 1 }
262 #define ARGS 0,INT_MAX,0
264 #define NO_ARGS 0,0,0
266 #define CONCAT_ARGS 1,1,1
268 #define GE(n) n,INT_MAX,0
302 const char *start,
const char *end,
313 const char *keyword_str);
315 #define find_by_keyword(s, keyword) \
316 find_by_keyword_((s), (keyword), #keyword)
directory_token_t * find_opt_by_keyword(const smartlist_t *s, directory_keyword keyword)
smartlist_t * find_all_by_keyword(const smartlist_t *s, directory_keyword k)
void token_clear(directory_token_t *tok)
directory_token_t * find_by_keyword_(struct smartlist_t *s, directory_keyword keyword, const char *keyword_str)
directory_token_t * get_next_token(struct memarea_t *area, const char **s, const char *eos, const token_rule_t *table)
int tokenize_string(struct memarea_t *area, const char *start, const char *end, struct smartlist_t *out, const token_rule_t *table, int flags)