fmt_routerstatus.h (1429B)
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 fmt_routerstatus.h 9 * \brief Header file for fmt_routerstatus.c. 10 **/ 11 12 #ifndef TOR_FMT_ROUTERSTATUS_H 13 #define TOR_FMT_ROUTERSTATUS_H 14 15 /** An enum to describe what format we're generating a routerstatus line in. 16 */ 17 typedef enum { 18 /** For use in a v2 opinion */ 19 NS_V2, 20 /** For use in a consensus networkstatus document (ns flavor) */ 21 NS_V3_CONSENSUS, 22 /** For use in a vote networkstatus document */ 23 NS_V3_VOTE, 24 /** For passing to the controlport in response to a GETINFO request */ 25 NS_CONTROL_PORT, 26 /** For use in a consensus networkstatus document (microdesc flavor) */ 27 NS_V3_CONSENSUS_MICRODESC 28 } routerstatus_format_type_t; 29 30 /** Maximum allowable length of a version line in a networkstatus. */ 31 #define MAX_V_LINE_LEN 128 32 33 char *routerstatus_format_entry( 34 const routerstatus_t *rs, 35 const char *version, 36 const char *protocols, 37 routerstatus_format_type_t format, 38 const vote_routerstatus_t *vrs, 39 time_t declared_publish_time); 40 41 #endif /* !defined(TOR_FMT_ROUTERSTATUS_H) */