CJDHTConstants.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* vim: set expandtab ts=4 sw=4: */
  2. /*
  3. * You may redistribute this program and/or modify it under the terms of
  4. * the GNU General Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #ifndef CJDHTConstants_H
  16. #define CJDHTConstants_H
  17. #include "benc/String.h"
  18. #include "util/version/Version.h"
  19. // Signifying that this message is a query and defining the query type.
  20. static String* const CJDHTConstants_QUERY = String_CONST_SO("q");
  21. // Get the next hop in a (hypothetical) packet forward operation
  22. static String* const CJDHTConstants_QUERY_NH = String_CONST_SO("nh");
  23. // Find nodes query. "fn"
  24. static String* const CJDHTConstants_QUERY_FN = String_CONST_SO("fn");
  25. // Get (direct) peers query. "gp"
  26. static String* const CJDHTConstants_QUERY_GP = String_CONST_SO("gp");
  27. // Ping query
  28. static String* const CJDHTConstants_QUERY_PING = String_CONST_SO("pn");
  29. // A search target (address)
  30. static String* const CJDHTConstants_TARGET = String_CONST_SO("tar");
  31. // Response with nodes. "n"
  32. static String* const CJDHTConstants_NODES = String_CONST_SO("n");
  33. // Transaction id
  34. static String* const CJDHTConstants_TXID = String_CONST_SO("txid");
  35. // Version which is in ping responses.
  36. static String* const CJDHTConstants_VERSION = String_CONST_SO("v");
  37. // Node protocols, the protocol versions of the nodes in a node list.
  38. static String* const CJDHTConstants_NODE_PROTOCOLS = String_CONST_SO("np");
  39. // The protocol version of the sending node.
  40. static String* const CJDHTConstants_PROTOCOL = String_CONST_SO("p");
  41. // The encoding scheme definition for this node's switch encoding.
  42. static String* const CJDHTConstants_ENC_SCHEME = String_CONST_SO("es");
  43. // The *index* of the smallest encoding form which can represent the interface which
  44. // the querying node is behind.
  45. static String* const CJDHTConstants_ENC_INDEX = String_CONST_SO("ei");
  46. // Encoding scheme and index for the closest peer along the path.
  47. static String* const CJDHTConstants_PEER_ENC_SCHEME = String_CONST_SO("pes");
  48. static String* const CJDHTConstants_PEER_ENC_INDEX = String_CONST_SO("pei");
  49. #endif