versions.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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-2019, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file versions.h
  8. * \brief Header file for versions.c.
  9. **/
  10. #ifndef TOR_VERSIONS_H
  11. #define TOR_VERSIONS_H
  12. /** Possible statuses of a version of Tor, given opinions from the directory
  13. * servers. */
  14. typedef enum version_status_t {
  15. VS_RECOMMENDED=0, /**< This version is listed as recommended. */
  16. VS_OLD=1, /**< This version is older than any recommended version. */
  17. VS_NEW=2, /**< This version is newer than any recommended version. */
  18. VS_NEW_IN_SERIES=3, /**< This version is newer than any recommended version
  19. * in its series, but later recommended versions exist.
  20. */
  21. VS_UNRECOMMENDED=4, /**< This version is not recommended (general case). */
  22. VS_EMPTY=5, /**< The version list was empty; no agreed-on versions. */
  23. VS_UNKNOWN, /**< We have no idea. */
  24. } version_status_t;
  25. version_status_t tor_version_is_obsolete(const char *myversion,
  26. const char *versionlist);
  27. int tor_version_parse_platform(const char *platform,
  28. tor_version_t *version_out,
  29. int strict);
  30. int tor_version_as_new_as(const char *platform, const char *cutoff);
  31. int tor_version_parse(const char *s, tor_version_t *out);
  32. int tor_version_compare(tor_version_t *a, tor_version_t *b);
  33. int tor_version_same_series(tor_version_t *a, tor_version_t *b);
  34. void sort_version_list(smartlist_t *lst, int remove_duplicates);
  35. void summarize_protover_flags(protover_summary_flags_t *out,
  36. const char *protocols,
  37. const char *version);
  38. #endif /* !defined(TOR_VERSIONS_H) */