[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] shared_random_state.[ch]: Repair a bunch of doxygen comments



commit 06367299c2a057e5e18832078c3af4929a2ca6c6
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Oct 16 11:44:30 2019 -0400

    shared_random_state.[ch]: Repair a bunch of doxygen comments
    
    These need to start with /**, not /*.
---
 src/feature/dirauth/shared_random_state.c | 134 +++++++++++++++---------------
 src/feature/dirauth/shared_random_state.h |  57 ++++++-------
 2 files changed, 96 insertions(+), 95 deletions(-)

diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c
index 76befb0f5..474dcb271 100644
--- a/src/feature/dirauth/shared_random_state.c
+++ b/src/feature/dirauth/shared_random_state.c
@@ -26,18 +26,18 @@
 
 #include "app/config/or_state_st.h"
 
-/* Default filename of the shared random state on disk. */
+/** Default filename of the shared random state on disk. */
 static const char default_fname[] = "sr-state";
 
-/* String representation of a protocol phase. */
+/** String representation of a protocol phase. */
 static const char *phase_str[] = { "unknown", "commit", "reveal" };
 
-/* Our shared random protocol state. There is only one possible state per
+/** Our shared random protocol state. There is only one possible state per
  * protocol run so this is the global state which is reset at every run once
  * the shared random value has been computed. */
 static sr_state_t *sr_state = NULL;
 
-/* Representation of our persistent state on disk. The sr_state above
+/** Representation of our persistent state on disk. The sr_state above
  * contains the data parsed from this state. When we save to disk, we
  * translate the sr_state to this sr_disk_state. */
 static sr_disk_state_t *sr_disk_state = NULL;
@@ -56,14 +56,14 @@ DUMMY_TYPECHECK_INSTANCE(sr_disk_state_t);
 #define V(member,conftype,initvalue)            \
   VAR(#member, conftype, member, initvalue)
 
-/* Our persistent state magic number. */
+/** Our persistent state magic number. */
 #define SR_DISK_STATE_MAGIC 0x98AB1254
 
 static int
 disk_state_validate_cb(void *old_state, void *state, void *default_state,
                        int from_setconf, char **msg);
 
-/* Array of variables that are saved to disk as a persistent state. */
+/** Array of variables that are saved to disk as a persistent state. */
 static const config_var_t state_vars[] = {
   V(Version,                    POSINT, "0"),
   V(TorVersion,                 STRING, NULL),
@@ -78,7 +78,7 @@ static const config_var_t state_vars[] = {
   END_OF_CONFIG_VARS
 };
 
-/* "Extra" variable in the state that receives lines we can't parse. This
+/** "Extra" variable in the state that receives lines we can't parse. This
  * lets us preserve options from versions of Tor newer than us. */
 static const struct_member_t state_extra_var = {
   .name = "__extra",
@@ -86,7 +86,7 @@ static const struct_member_t state_extra_var = {
   .offset = offsetof(sr_disk_state_t, ExtraLines),
 };
 
-/* Configuration format of sr_disk_state_t. */
+/** Configuration format of sr_disk_state_t. */
 static const config_format_t state_format = {
   sizeof(sr_disk_state_t),
   {
@@ -103,7 +103,7 @@ static const config_format_t state_format = {
   -1,
 };
 
-/* Global configuration manager for the shared-random state file */
+/** Global configuration manager for the shared-random state file */
 static config_mgr_t *shared_random_state_mgr = NULL;
 
 /** Return the configuration manager for the shared-random state file. */
@@ -119,7 +119,7 @@ get_srs_mgr(void)
 
 static void state_query_del_(sr_state_object_t obj_type, void *data);
 
-/* Return a string representation of a protocol phase. */
+/** Return a string representation of a protocol phase. */
 STATIC const char *
 get_phase_str(sr_phase_t phase)
 {
@@ -137,7 +137,7 @@ get_phase_str(sr_phase_t phase)
 
   return the_string;
 }
-/* Return the time we should expire the state file created at <b>now</b>.
+/** Return the time we should expire the state file created at <b>now</b>.
  * We expire the state file in the beginning of the next protocol run. */
 STATIC time_t
 get_state_valid_until_time(time_t now)
@@ -168,7 +168,7 @@ get_state_valid_until_time(time_t now)
   return valid_until;
 }
 
-/* Given the consensus 'valid-after' time, return the protocol phase we should
+/** Given the consensus 'valid-after' time, return the protocol phase we should
  * be in. */
 STATIC sr_phase_t
 get_sr_protocol_phase(time_t valid_after)
@@ -188,7 +188,7 @@ get_sr_protocol_phase(time_t valid_after)
   }
 }
 
-/* Add the given <b>commit</b> to <b>state</b>. It MUST be a valid commit
+/** Add the given <b>commit</b> to <b>state</b>. It MUST be a valid commit
  * and there shouldn't be a commit from the same authority in the state
  * already else verification hasn't been done prior. This takes ownership of
  * the commit once in our state. */
@@ -213,7 +213,7 @@ commit_add_to_state(sr_commit_t *commit, sr_state_t *state)
   }
 }
 
-/* Helper: deallocate a commit object. (Used with digestmap_free(), which
+/** Helper: deallocate a commit object. (Used with digestmap_free(), which
  * requires a function pointer whose argument is void *). */
 static void
 commit_free_(void *p)
@@ -224,7 +224,7 @@ commit_free_(void *p)
 #define state_free(val) \
   FREE_AND_NULL(sr_state_t, state_free_, (val))
 
-/* Free a state that was allocated with state_new(). */
+/** Free a state that was allocated with state_new(). */
 static void
 state_free_(sr_state_t *state)
 {
@@ -238,7 +238,7 @@ state_free_(sr_state_t *state)
   tor_free(state);
 }
 
-/* Allocate an sr_state_t object and returns it. If no <b>fname</b>, the
+/** Allocate an sr_state_t object and returns it. If no <b>fname</b>, the
  * default file name is used. This function does NOT initialize the state
  * timestamp, phase or shared random value. NULL is never returned. */
 static sr_state_t *
@@ -257,7 +257,7 @@ state_new(const char *fname, time_t now)
   return new_state;
 }
 
-/* Set our global state pointer with the one given. */
+/** Set our global state pointer with the one given. */
 static void
 state_set(sr_state_t *state)
 {
@@ -271,7 +271,7 @@ state_set(sr_state_t *state)
 #define disk_state_free(val) \
   FREE_AND_NULL(sr_disk_state_t, disk_state_free_, (val))
 
-/* Free an allocated disk state. */
+/** Free an allocated disk state. */
 static void
 disk_state_free_(sr_disk_state_t *state)
 {
@@ -281,7 +281,7 @@ disk_state_free_(sr_disk_state_t *state)
   config_free(get_srs_mgr(), state);
 }
 
-/* Allocate a new disk state, initialize it and return it. */
+/** Allocate a new disk state, initialize it and return it. */
 static sr_disk_state_t *
 disk_state_new(time_t now)
 {
@@ -297,7 +297,7 @@ disk_state_new(time_t now)
   return new_state;
 }
 
-/* Set our global disk state with the given state. */
+/** Set our global disk state with the given state. */
 static void
 disk_state_set(sr_disk_state_t *state)
 {
@@ -308,7 +308,7 @@ disk_state_set(sr_disk_state_t *state)
   sr_disk_state = state;
 }
 
-/* Return -1 if the disk state is invalid (something in there that we can't or
+/** Return -1 if the disk state is invalid (something in there that we can't or
  * shouldn't use). Return 0 if everything checks out. */
 static int
 disk_state_validate(const sr_disk_state_t *state)
@@ -343,7 +343,7 @@ disk_state_validate(const sr_disk_state_t *state)
   return -1;
 }
 
-/* Validate the disk state (NOP for now). */
+/** Validate the disk state (NOP for now). */
 static int
 disk_state_validate_cb(void *old_state, void *state, void *default_state,
                        int from_setconf, char **msg)
@@ -361,7 +361,7 @@ disk_state_validate_cb(void *old_state, void *state, void *default_state,
   return 0;
 }
 
-/* Parse the Commit line(s) in the disk state and translate them to the
+/** Parse the Commit line(s) in the disk state and translate them to the
  * the memory state. Return 0 on success else -1 on error. */
 static int
 disk_state_parse_commits(sr_state_t *state,
@@ -416,7 +416,7 @@ disk_state_parse_commits(sr_state_t *state,
   return -1;
 }
 
-/* Parse a share random value line from the disk state and save it to dst
+/** Parse a share random value line from the disk state and save it to dst
  * which is an allocated srv object. Return 0 on success else -1. */
 static int
 disk_state_parse_srv(const char *value, sr_srv_t *dst)
@@ -451,7 +451,7 @@ disk_state_parse_srv(const char *value, sr_srv_t *dst)
   return ret;
 }
 
-/* Parse both SharedRandCurrentValue and SharedRandPreviousValue line from
+/** Parse both SharedRandCurrentValue and SharedRandPreviousValue line from
  * the state. Return 0 on success else -1. */
 static int
 disk_state_parse_sr_values(sr_state_t *state,
@@ -502,7 +502,7 @@ disk_state_parse_sr_values(sr_state_t *state,
   return -1;
 }
 
-/* Parse the given disk state and set a newly allocated state. On success,
+/** Parse the given disk state and set a newly allocated state. On success,
  * return that state else NULL. */
 static sr_state_t *
 disk_state_parse(const sr_disk_state_t *new_disk_state)
@@ -536,7 +536,7 @@ disk_state_parse(const sr_disk_state_t *new_disk_state)
   return NULL;
 }
 
-/* From a valid commit object and an allocated config line, set the line's
+/** From a valid commit object and an allocated config line, set the line's
  * value to the state string representation of a commit. */
 static void
 disk_state_put_commit_line(const sr_commit_t *commit, config_line_t *line)
@@ -563,7 +563,7 @@ disk_state_put_commit_line(const sr_commit_t *commit, config_line_t *line)
   }
 }
 
-/* From a valid srv object and an allocated config line, set the line's
+/** From a valid srv object and an allocated config line, set the line's
  * value to the state string representation of a shared random value. */
 static void
 disk_state_put_srv_line(const sr_srv_t *srv, config_line_t *line)
@@ -581,7 +581,7 @@ disk_state_put_srv_line(const sr_srv_t *srv, config_line_t *line)
   tor_asprintf(&line->value, "%" PRIu64 " %s", srv->num_reveals, encoded);
 }
 
-/* Reset disk state that is free allocated memory and zeroed the object. */
+/** Reset disk state that is free allocated memory and zeroed the object. */
 static void
 disk_state_reset(void)
 {
@@ -600,7 +600,7 @@ disk_state_reset(void)
   sr_disk_state->TorVersion = tor_strdup(get_version());
 }
 
-/* Update our disk state based on our global SR state. */
+/** Update our disk state based on our global SR state. */
 static void
 disk_state_update(void)
 {
@@ -644,7 +644,7 @@ disk_state_update(void)
   } DIGESTMAP_FOREACH_END;
 }
 
-/* Load state from disk and put it into our disk state. If the state passes
+/** Load state from disk and put it into our disk state. If the state passes
  * validation, our global state will be updated with it. Return 0 on
  * success. On error, -EINVAL is returned if the state on disk did contained
  * something malformed or is unreadable. -ENOENT is returned indicating that
@@ -662,7 +662,7 @@ disk_state_load_from_disk(void)
   return ret;
 }
 
-/* Helper for disk_state_load_from_disk(). */
+/** Helper for disk_state_load_from_disk(). */
 STATIC int
 disk_state_load_from_disk_impl(const char *fname)
 {
@@ -724,7 +724,7 @@ disk_state_load_from_disk_impl(const char *fname)
   return ret;
 }
 
-/* Save the disk state to disk but before that update it from the current
+/** Save the disk state to disk but before that update it from the current
  * state so we always have the latest. Return 0 on success else -1. */
 static int
 disk_state_save_to_disk(void)
@@ -768,7 +768,7 @@ disk_state_save_to_disk(void)
   return ret;
 }
 
-/* Reset our state to prepare for a new protocol run. Once this returns, all
+/** Reset our state to prepare for a new protocol run. Once this returns, all
  * commits in the state will be removed and freed. */
 STATIC void
 reset_state_for_new_protocol_run(time_t valid_after)
@@ -789,7 +789,7 @@ reset_state_for_new_protocol_run(time_t valid_after)
   sr_state_delete_commits();
 }
 
-/* This is the first round of the new protocol run starting at
+/** This is the first round of the new protocol run starting at
  * <b>valid_after</b>. Do the necessary housekeeping. */
 STATIC void
 new_protocol_run(time_t valid_after)
@@ -823,7 +823,7 @@ new_protocol_run(time_t valid_after)
   }
 }
 
-/* Return 1 iff the <b>next_phase</b> is a phase transition from the current
+/** Return 1 iff the <b>next_phase</b> is a phase transition from the current
  * phase that is it's different. */
 STATIC int
 is_phase_transition(sr_phase_t next_phase)
@@ -831,7 +831,7 @@ is_phase_transition(sr_phase_t next_phase)
   return sr_state->phase != next_phase;
 }
 
-/* Helper function: return a commit using the RSA fingerprint of the
+/** Helper function: return a commit using the RSA fingerprint of the
  * authority or NULL if no such commit is known. */
 static sr_commit_t *
 state_query_get_commit(const char *rsa_fpr)
@@ -840,7 +840,7 @@ state_query_get_commit(const char *rsa_fpr)
   return digestmap_get(sr_state->commits, rsa_fpr);
 }
 
-/* Helper function: This handles the GET state action using an
+/** Helper function: This handles the GET state action using an
  * <b>obj_type</b> and <b>data</b> needed for the action. */
 static void *
 state_query_get_(sr_state_object_t obj_type, const void *data)
@@ -875,7 +875,7 @@ state_query_get_(sr_state_object_t obj_type, const void *data)
   return obj;
 }
 
-/* Helper function: This handles the PUT state action using an
+/** Helper function: This handles the PUT state action using an
  * <b>obj_type</b> and <b>data</b> needed for the action.
  * PUT frees the previous data before replacing it, if needed. */
 static void
@@ -928,7 +928,7 @@ state_query_put_(sr_state_object_t obj_type, void *data)
   }
 }
 
-/* Helper function: This handles the DEL_ALL state action using an
+/** Helper function: This handles the DEL_ALL state action using an
  * <b>obj_type</b> and <b>data</b> needed for the action. */
 static void
 state_query_del_all_(sr_state_object_t obj_type)
@@ -957,7 +957,7 @@ state_query_del_all_(sr_state_object_t obj_type)
   }
 }
 
-/* Helper function: This handles the DEL state action using an
+/** Helper function: This handles the DEL state action using an
  * <b>obj_type</b> and <b>data</b> needed for the action. */
 static void
 state_query_del_(sr_state_object_t obj_type, void *data)
@@ -983,7 +983,7 @@ state_query_del_(sr_state_object_t obj_type, void *data)
   }
 }
 
-/* Query state using an <b>action</b> for an object type <b>obj_type</b>.
+/** Query state using an <b>action</b> for an object type <b>obj_type</b>.
  * The <b>data</b> pointer needs to point to an object that the action needs
  * to use and if anything is required to be returned, it is stored in
  * <b>out</b>.
@@ -1025,7 +1025,7 @@ state_query(sr_state_action_t action, sr_state_object_t obj_type,
   }
 }
 
-/* Delete the current SRV value from the state freeing it and the value is set
+/** Delete the current SRV value from the state freeing it and the value is set
  * to NULL meaning empty. */
 STATIC void
 state_del_current_srv(void)
@@ -1033,7 +1033,7 @@ state_del_current_srv(void)
   state_query(SR_STATE_ACTION_DEL, SR_STATE_OBJ_CURSRV, NULL, NULL);
 }
 
-/* Delete the previous SRV value from the state freeing it and the value is
+/** Delete the previous SRV value from the state freeing it and the value is
  * set to NULL meaning empty. */
 STATIC void
 state_del_previous_srv(void)
@@ -1041,7 +1041,7 @@ state_del_previous_srv(void)
   state_query(SR_STATE_ACTION_DEL, SR_STATE_OBJ_PREVSRV, NULL, NULL);
 }
 
-/* Rotate SRV value by setting the previous SRV to the current SRV, and
+/** Rotate SRV value by setting the previous SRV to the current SRV, and
  * clearing the current SRV. */
 STATIC void
 state_rotate_srv(void)
@@ -1054,7 +1054,7 @@ state_rotate_srv(void)
   sr_state_set_current_srv(NULL);
 }
 
-/* Set valid after time in the our state. */
+/** Set valid after time in the our state. */
 void
 sr_state_set_valid_after(time_t valid_after)
 {
@@ -1062,7 +1062,7 @@ sr_state_set_valid_after(time_t valid_after)
               (void *) &valid_after, NULL);
 }
 
-/* Return the phase we are currently in according to our state. */
+/** Return the phase we are currently in according to our state. */
 sr_phase_t
 sr_state_get_phase(void)
 {
@@ -1071,7 +1071,7 @@ sr_state_get_phase(void)
   return *(sr_phase_t *) ptr;
 }
 
-/* Return the previous SRV value from our state. Value CAN be NULL.
+/** Return the previous SRV value from our state. Value CAN be NULL.
  * The state object owns the SRV, so the calling code should not free the SRV.
  * Use sr_srv_dup() if you want to keep a copy of the SRV. */
 const sr_srv_t *
@@ -1083,7 +1083,7 @@ sr_state_get_previous_srv(void)
   return srv;
 }
 
-/* Set the current SRV value from our state. Value CAN be NULL. The srv
+/** Set the current SRV value from our state. Value CAN be NULL. The srv
  * object ownership is transferred to the state object. */
 void
 sr_state_set_previous_srv(const sr_srv_t *srv)
@@ -1092,7 +1092,7 @@ sr_state_set_previous_srv(const sr_srv_t *srv)
               NULL);
 }
 
-/* Return the current SRV value from our state. Value CAN be NULL.
+/** Return the current SRV value from our state. Value CAN be NULL.
  * The state object owns the SRV, so the calling code should not free the SRV.
  * Use sr_srv_dup() if you want to keep a copy of the SRV. */
 const sr_srv_t *
@@ -1104,7 +1104,7 @@ sr_state_get_current_srv(void)
   return srv;
 }
 
-/* Set the current SRV value from our state. Value CAN be NULL. The srv
+/** Set the current SRV value from our state. Value CAN be NULL. The srv
  * object ownership is transferred to the state object. */
 void
 sr_state_set_current_srv(const sr_srv_t *srv)
@@ -1113,7 +1113,7 @@ sr_state_set_current_srv(const sr_srv_t *srv)
               NULL);
 }
 
-/* Clean all the SRVs in our state. */
+/** Clean all the SRVs in our state. */
 void
 sr_state_clean_srvs(void)
 {
@@ -1122,7 +1122,7 @@ sr_state_clean_srvs(void)
   state_del_current_srv();
 }
 
-/* Return a pointer to the commits map from our state. CANNOT be NULL. */
+/** Return a pointer to the commits map from our state. CANNOT be NULL. */
 digestmap_t *
 sr_state_get_commits(void)
 {
@@ -1133,7 +1133,7 @@ sr_state_get_commits(void)
   return commits;
 }
 
-/* Update the current SR state as needed for the upcoming voting round at
+/** Update the current SR state as needed for the upcoming voting round at
  * <b>valid_after</b>. */
 void
 sr_state_update(time_t valid_after)
@@ -1197,7 +1197,7 @@ sr_state_update(time_t valid_after)
   }
 }
 
-/* Return commit object from the given authority digest <b>rsa_identity</b>.
+/** Return commit object from the given authority digest <b>rsa_identity</b>.
  * Return NULL if not found. */
 sr_commit_t *
 sr_state_get_commit(const char *rsa_identity)
@@ -1211,7 +1211,7 @@ sr_state_get_commit(const char *rsa_identity)
   return commit;
 }
 
-/* Add <b>commit</b> to the permanent state. The commit object ownership is
+/** Add <b>commit</b> to the permanent state. The commit object ownership is
  * transferred to the state so the caller MUST not free it. */
 void
 sr_state_add_commit(sr_commit_t *commit)
@@ -1226,14 +1226,14 @@ sr_state_add_commit(sr_commit_t *commit)
             sr_commit_get_rsa_fpr(commit));
 }
 
-/* Remove all commits from our state. */
+/** Remove all commits from our state. */
 void
 sr_state_delete_commits(void)
 {
   state_query(SR_STATE_ACTION_DEL_ALL, SR_STATE_OBJ_COMMIT, NULL, NULL);
 }
 
-/* Copy the reveal information from <b>commit</b> into <b>saved_commit</b>.
+/** Copy the reveal information from <b>commit</b> into <b>saved_commit</b>.
  * This <b>saved_commit</b> MUST come from our current SR state. Once modified,
  * the disk state is updated. */
 void
@@ -1254,7 +1254,7 @@ sr_state_copy_reveal_info(sr_commit_t *saved_commit, const sr_commit_t *commit)
             sr_commit_get_rsa_fpr(saved_commit));
 }
 
-/* Set the fresh SRV flag from our state. This doesn't need to trigger a
+/** Set the fresh SRV flag from our state. This doesn't need to trigger a
  * disk state synchronization so we directly change the state. */
 void
 sr_state_set_fresh_srv(void)
@@ -1262,7 +1262,7 @@ sr_state_set_fresh_srv(void)
   sr_state->is_srv_fresh = 1;
 }
 
-/* Unset the fresh SRV flag from our state. This doesn't need to trigger a
+/** Unset the fresh SRV flag from our state. This doesn't need to trigger a
  * disk state synchronization so we directly change the state. */
 void
 sr_state_unset_fresh_srv(void)
@@ -1270,14 +1270,14 @@ sr_state_unset_fresh_srv(void)
   sr_state->is_srv_fresh = 0;
 }
 
-/* Return the value of the fresh SRV flag. */
+/** Return the value of the fresh SRV flag. */
 unsigned int
 sr_state_srv_is_fresh(void)
 {
   return sr_state->is_srv_fresh;
 }
 
-/* Cleanup and free our disk and memory state. */
+/** Cleanup and free our disk and memory state. */
 void
 sr_state_free_all(void)
 {
@@ -1289,7 +1289,7 @@ sr_state_free_all(void)
   config_mgr_free(shared_random_state_mgr);
 }
 
-/* Save our current state in memory to disk. */
+/** Save our current state in memory to disk. */
 void
 sr_state_save(void)
 {
@@ -1297,7 +1297,7 @@ sr_state_save(void)
   state_query(SR_STATE_ACTION_SAVE, 0, NULL, NULL);
 }
 
-/* Return 1 iff the state has been initialized that is it exists in memory.
+/** Return 1 iff the state has been initialized that is it exists in memory.
  * Return 0 otherwise. */
 int
 sr_state_is_initialized(void)
@@ -1305,7 +1305,7 @@ sr_state_is_initialized(void)
   return sr_state == NULL ? 0 : 1;
 }
 
-/* Initialize the disk and memory state.
+/** Initialize the disk and memory state.
  *
  * If save_to_disk is set to 1, the state is immediately saved to disk after
  * creation else it's not thus only kept in memory.
@@ -1368,7 +1368,7 @@ sr_state_init(int save_to_disk, int read_from_disk)
 
 #ifdef TOR_UNIT_TESTS
 
-/* Set the current phase of the protocol. Used only by unit tests. */
+/** Set the current phase of the protocol. Used only by unit tests. */
 void
 set_sr_phase(sr_phase_t phase)
 {
@@ -1377,7 +1377,7 @@ set_sr_phase(sr_phase_t phase)
   sr_state->phase = phase;
 }
 
-/* Get the SR state. Used only by unit tests */
+/** Get the SR state. Used only by unit tests */
 sr_state_t *
 get_sr_state(void)
 {
diff --git a/src/feature/dirauth/shared_random_state.h b/src/feature/dirauth/shared_random_state.h
index 08f999f9d..f6bcddd08 100644
--- a/src/feature/dirauth/shared_random_state.h
+++ b/src/feature/dirauth/shared_random_state.h
@@ -6,7 +6,7 @@
 
 #include "feature/dirauth/shared_random.h"
 
-/* Action that can be performed on the state for any objects. */
+/** Action that can be performed on the state for any objects. */
 typedef enum {
   SR_STATE_ACTION_GET     = 1,
   SR_STATE_ACTION_PUT     = 2,
@@ -15,52 +15,53 @@ typedef enum {
   SR_STATE_ACTION_SAVE    = 5,
 } sr_state_action_t;
 
-/* Object in the state that can be queried through the state API. */
+/** Object in the state that can be queried through the state API. */
 typedef enum {
-  /* Will return a single commit using an authority identity key. */
+  /** Will return a single commit using an authority identity key. */
   SR_STATE_OBJ_COMMIT,
-  /* Returns the entire list of commits from the state. */
+  /** Returns the entire list of commits from the state. */
   SR_STATE_OBJ_COMMITS,
-  /* Return the current SRV object pointer. */
+  /** Return the current SRV object pointer. */
   SR_STATE_OBJ_CURSRV,
-  /* Return the previous SRV object pointer. */
+  /** Return the previous SRV object pointer. */
   SR_STATE_OBJ_PREVSRV,
-  /* Return the phase. */
+  /** Return the phase. */
   SR_STATE_OBJ_PHASE,
-  /* Get or Put the valid after time. */
+  /** Get or Put the valid after time. */
   SR_STATE_OBJ_VALID_AFTER,
 } sr_state_object_t;
 
-/* State of the protocol. It's also saved on disk in fname. This data
+/** State of the protocol. It's also saved on disk in fname. This data
  * structure MUST be synchronized at all time with the one on disk. */
 typedef struct sr_state_t {
-  /* Filename of the state file on disk. */
+  /** Filename of the state file on disk. */
   char *fname;
-  /* Version of the protocol. */
+  /** Version of the protocol. */
   uint32_t version;
-  /* The valid-after of the voting period we have prepared the state for. */
+  /** The valid-after of the voting period we have prepared the state for. */
   time_t valid_after;
-  /* Until when is this state valid? */
+  /** Until when is this state valid? */
   time_t valid_until;
-  /* Protocol phase. */
+  /** Protocol phase. */
   sr_phase_t phase;
 
-  /* Number of runs completed. */
+  /** Number of runs completed. */
   uint64_t n_protocol_runs;
-  /* The number of commitment rounds we've performed in this protocol run. */
+  /** The number of commitment rounds we've performed in this protocol run. */
   unsigned int n_commit_rounds;
-  /* The number of reveal rounds we've performed in this protocol run. */
+  /** The number of reveal rounds we've performed in this protocol run. */
   unsigned int n_reveal_rounds;
 
-  /* A map of all the received commitments for this protocol run. This is
+  /** A map of all the received commitments for this protocol run. This is
    * indexed by authority RSA identity digest. */
   digestmap_t *commits;
 
-  /* Current and previous shared random value. */
+  /** Current shared random value. */
   sr_srv_t *previous_srv;
+  /** Previous shared random value. */
   sr_srv_t *current_srv;
 
-  /* Indicate if the state contains an SRV that was _just_ generated. This is
+  /** Indicate if the state contains an SRV that was _just_ generated. This is
    * used during voting so that we know whether to use the super majority rule
    * or not when deciding on keeping it for the consensus. It is _always_ set
    * to 0 post consensus.
@@ -73,22 +74,22 @@ typedef struct sr_state_t {
   unsigned int is_srv_fresh:1;
 } sr_state_t;
 
-/* Persistent state of the protocol, as saved to disk. */
+/** Persistent state of the protocol, as saved to disk. */
 typedef struct sr_disk_state_t {
   uint32_t magic_;
-  /* Version of the protocol. */
+  /** Version of the protocol. */
   int Version;
-  /* Version of our running tor. */
+  /** Version of our running tor. */
   char *TorVersion;
-  /* Creation time of this state */
+  /** Creation time of this state */
   time_t ValidAfter;
-  /* State valid until? */
+  /** State valid until? */
   time_t ValidUntil;
-  /* All commits seen that are valid. */
+  /** All commits seen that are valid. */
   struct config_line_t *Commit;
-  /* Previous and current shared random value. */
+  /** Previous and current shared random value. */
   struct config_line_t *SharedRandValues;
-  /* Extra Lines for configuration we might not know. */
+  /** Extra Lines for configuration we might not know. */
   struct config_line_t *ExtraLines;
 } sr_disk_state_t;
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits