fmt_routerstatus.h 1.4 KB

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