aboutsummaryrefslogtreecommitdiff
path: root/src/or/protover.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-08-09 19:11:47 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-26 10:56:48 -0700
commitb2b2e1c7f24d9b65059e3d089768d6c49ba4f58f (patch)
treeb9d7c893829d809dbb83e761af3c17c413415d1a /src/or/protover.h
parente3bf8854c81f46470d21f5e44cfa51b16e1d260b (diff)
downloadtor-b2b2e1c7f24d9b65059e3d089768d6c49ba4f58f.tar.gz
tor-b2b2e1c7f24d9b65059e3d089768d6c49ba4f58f.zip
checkpoint basic protover backend
Diffstat (limited to 'src/or/protover.h')
-rw-r--r--src/or/protover.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/or/protover.h b/src/or/protover.h
new file mode 100644
index 0000000000..d12a067578
--- /dev/null
+++ b/src/or/protover.h
@@ -0,0 +1,50 @@
+
+#ifndef TOR_PROTOVER_H
+#define TOR_PROTOVER_H
+
+#include "container.h"
+
+typedef enum protocol_type_t {
+ PRT_LINK,
+ PRT_LINKAUTH,
+ PRT_RELAY,
+ PRT_HSMID,
+ PRT_DIRCACHE,
+ PRT_HSDIR,
+ PRT_DESC,
+ PRT_MICRODESC,
+ PRT_CONS,
+} protocol_type_t;
+
+/*
+const protover_set_t *protover_get_supported(void);
+protover_set_t *protover_set_parse(const char *s);
+int protover_is_supported_here_str(const char *name, uint32_t ver);
+int protover_is_supported_by(protocol_type_t pr, uint32_t ver);
+*/
+
+int protover_all_supported(const char *s, char **missing);
+int protover_is_supported_here(protocol_type_t pr, uint32_t ver);
+const char *get_supported_protocols(void);
+
+void protover_free_all(void);
+
+#ifdef PROTOVER_PRIVATE
+typedef struct proto_range_t {
+ uint32_t low;
+ uint32_t high;
+} proto_range_t;
+
+typedef struct proto_entry_t {
+ char *name;
+ smartlist_t *ranges;
+} proto_entry_t;
+
+STATIC smartlist_t *parse_protocol_list(const char *s);
+STATIC void proto_entry_free(proto_entry_t *entry);
+STATIC char *encode_protocol_list(const smartlist_t *sl);
+STATIC const char *protocol_type_to_str(protocol_type_t pr);
+STATIC int str_to_protocol_type(const char *s, protocol_type_t *pr_out);
+#endif
+
+#endif