1
0

CJDHTConstants.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 <http://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. // Find nodes query. "fn"
  22. static String* const CJDHTConstants_QUERY_FN = String_CONST_SO("fn");
  23. // Get (direct) peers query. "gp"
  24. static String* const CJDHTConstants_QUERY_GP = String_CONST_SO("gp");
  25. // Ping query
  26. static String* const CJDHTConstants_QUERY_PING = String_CONST_SO("pn");
  27. // A search target (address)
  28. static String* const CJDHTConstants_TARGET = String_CONST_SO("tar");
  29. // Response with nodes. "n"
  30. static String* const CJDHTConstants_NODES = String_CONST_SO("n");
  31. // Transaction id
  32. static String* const CJDHTConstants_TXID = String_CONST_SO("txid");
  33. // Version which is in ping responses.
  34. static String* const CJDHTConstants_VERSION = String_CONST_SO("v");
  35. // Node protocols, the protocol versions of the nodes in a node list.
  36. static String* const CJDHTConstants_NODE_PROTOCOLS = String_CONST_SO("np");
  37. // The protocol version of the sending node.
  38. static String* const CJDHTConstants_PROTOCOL = String_CONST_SO("p");
  39. // The encoding scheme definition for this node's switch encoding.
  40. static String* const CJDHTConstants_ENC_SCHEME = String_CONST_SO("es");
  41. // The *index* of the smallest encoding form which can represent the interface which
  42. // the querying node is behind.
  43. static String* const CJDHTConstants_ENC_INDEX = String_CONST_SO("ei");
  44. // Encoding scheme and index for the closest peer along the path.
  45. static String* const CJDHTConstants_PEER_ENC_SCHEME = String_CONST_SO("pes");
  46. static String* const CJDHTConstants_PEER_ENC_INDEX = String_CONST_SO("pei");
  47. #endif