]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Extract tor_version_t into its own header.
authorNick Mathewson <nickm@torproject.org>
Fri, 15 Jun 2018 16:12:15 +0000 (12:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 15 Jun 2018 16:12:15 +0000 (12:12 -0400)
src/or/dirserv.c
src/or/include.am
src/or/or.h
src/or/routerparse.c
src/or/tor_version_st.h [new file with mode: 0644]
src/test/test_dir.c

index f2597aeaede56ea9bbfb9439b89a19649fb1e910..038b47e01a0f5fb237e122c857013f03f0534d02 100644 (file)
@@ -37,6 +37,7 @@
 #include "dirauth/dirvote.h"
 
 #include "dir_connection_st.h"
+#include "tor_version_st.h"
 
 /**
  * \file dirserv.c
index e38013f02bb8f95215f730b70ebcfe551cb290af..618ffacd03bf1d033b524968e2bc7976bfdf2055 100644 (file)
@@ -260,7 +260,7 @@ ORHEADERS = \
        src/or/or_handshake_state_st.h                  \
        src/or/origin_circuit_st.h                      \
        src/or/transports.h                             \
-       src/or/parsecommon.h                    \
+       src/or/parsecommon.h                            \
        src/or/periodic.h                               \
        src/or/port_cfg_st.h                            \
        src/or/policies.h                               \
@@ -294,6 +294,7 @@ ORHEADERS = \
        src/or/status.h                                 \
        src/or/torcert.h                                \
        src/or/tor_api_internal.h                       \
+       src/or/tor_version_st.h                         \
        src/or/voting_schedule.h
 
 # We add the headers of the modules even though they are disabled so we can
index 4403aae83d665876c1211da255333fe80bc81154..b67896d2a5a3eca924ad0363b64b7307c1658793 100644 (file)
@@ -4261,28 +4261,7 @@ typedef enum was_router_added_t {
   ROUTER_CERTS_EXPIRED = -8
 } was_router_added_t;
 
-/********************************* routerparse.c ************************/
-
-#define MAX_STATUS_TAG_LEN 32
-/** Structure to hold parsed Tor versions.  This is a little messier
- * than we would like it to be, because we changed version schemes with 0.1.0.
- *
- * See version-spec.txt for the whole business.
- */
-typedef struct tor_version_t {
-  int major;
-  int minor;
-  int micro;
-  /** Release status.  For version in the post-0.1 format, this is always
-   * VER_RELEASE. */
-  enum { VER_PRE=0, VER_RC=1, VER_RELEASE=2, } status;
-  int patchlevel;
-  char status_tag[MAX_STATUS_TAG_LEN];
-  int svn_revision;
-
-  int git_tag_len;
-  char git_tag[DIGEST_LEN];
-} tor_version_t;
+typedef struct tor_version_t tor_version_t;
 
 #endif /* !defined(TOR_OR_H) */
 
index 7af41c3baf4b708b751346bc757b10d4ea3673ff..06a37904dfce9b72a8400f905731b05951364366 100644 (file)
@@ -84,6 +84,8 @@
 
 #include "dirauth/dirvote.h"
 
+#include "tor_version_st.h"
+
 /****************************************************************************/
 
 /** List of tokens recognized in router descriptors */
diff --git a/src/or/tor_version_st.h b/src/or/tor_version_st.h
new file mode 100644 (file)
index 0000000..8c33602
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2017, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef TOR_VERSION_ST_H
+#define TOR_VERSION_ST_H
+
+#define MAX_STATUS_TAG_LEN 32
+/** Structure to hold parsed Tor versions.  This is a little messier
+ * than we would like it to be, because we changed version schemes with 0.1.0.
+ *
+ * See version-spec.txt for the whole business.
+ */
+struct tor_version_t {
+  int major;
+  int minor;
+  int micro;
+  /** Release status.  For version in the post-0.1 format, this is always
+   * VER_RELEASE. */
+  enum { VER_PRE=0, VER_RC=1, VER_RELEASE=2, } status;
+  int patchlevel;
+  char status_tag[MAX_STATUS_TAG_LEN];
+  int svn_revision;
+
+  int git_tag_len;
+  char git_tag[DIGEST_LEN];
+};
+
+#endif
+
index 538fb8db15e371e22bec4813c3dd176384843bbc..5bcbc80e8c9a9106a501a1aefc2245e4b7f1682e 100644 (file)
@@ -45,6 +45,7 @@
 #include "voting_schedule.h"
 
 #include "port_cfg_st.h"
+#include "tor_version_st.h"
 
 #define NS_MODULE dir