Tor  0.4.7.0-alpha-dev
nodefamily.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * \file nodefamily.h
9  * \brief Header file for nodefamily.c.
10  **/
11 
12 #ifndef TOR_NODEFAMILY_H
13 #define TOR_NODEFAMILY_H
14 
15 #include "lib/malloc/malloc.h"
16 #include <stdbool.h>
17 
18 typedef struct nodefamily_t nodefamily_t;
19 struct node_t;
20 struct smartlist_t;
21 
22 #define NF_WARN_MALFORMED (1u<<0)
23 #define NF_REJECT_MALFORMED (1u<<1)
24 
25 nodefamily_t *nodefamily_parse(const char *s,
26  const uint8_t *rsa_id_self,
27  unsigned flags);
28 nodefamily_t *nodefamily_from_members(const struct smartlist_t *members,
29  const uint8_t *rsa_id_self,
30  unsigned flags,
31  smartlist_t *unrecognized_out);
32 void nodefamily_free_(nodefamily_t *family);
33 #define nodefamily_free(family) \
34  FREE_AND_NULL(nodefamily_t, nodefamily_free_, (family))
35 
36 bool nodefamily_contains_rsa_id(const nodefamily_t *family,
37  const uint8_t *rsa_id);
39  const char *name);
40 bool nodefamily_contains_node(const nodefamily_t *family,
41  const struct node_t *node);
43  struct smartlist_t *out);
44 char *nodefamily_format(const nodefamily_t *family);
45 char *nodefamily_canonicalize(const char *s, const uint8_t *rsa_id_self,
46  unsigned flags);
47 
48 void nodefamily_free_all(void);
49 
50 #endif /* !defined(TOR_NODEFAMILY_H) */
const char * name
Definition: config.c:2434
Headers for util_malloc.c.
bool nodefamily_contains_node(const nodefamily_t *family, const node_t *node)
Definition: nodefamily.c:328
nodefamily_t * nodefamily_from_members(const smartlist_t *members, const uint8_t *rsa_id_self, unsigned flags, smartlist_t *unrecognized_out)
Definition: nodefamily.c:159
void nodefamily_add_nodes_to_smartlist(const nodefamily_t *family, struct smartlist_t *out)
Definition: nodefamily.c:342
bool nodefamily_contains_nickname(const nodefamily_t *family, const char *name)
Definition: nodefamily.c:304
void nodefamily_free_(nodefamily_t *family)
Definition: nodefamily.c:265
char * nodefamily_canonicalize(const char *s, const uint8_t *rsa_id_self, unsigned flags)
Definition: nodefamily.c:111
bool nodefamily_contains_rsa_id(const nodefamily_t *family, const uint8_t *rsa_id)
Definition: nodefamily.c:283
void nodefamily_free_all(void)
Definition: nodefamily.c:413
char * nodefamily_format(const nodefamily_t *family)
Definition: nodefamily.c:374
Definition: node_st.h:34