CJDHTConstants.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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/Object.h"
  18. // Signifying that this message is a query and defining the query type.
  19. static String* const CJDHTConstants_QUERY = String_CONST_SO("q");
  20. // Find nodes query. "fn"
  21. static String* const CJDHTConstants_QUERY_FN = String_CONST_SO("fn");
  22. // Get (direct) peers query. "gp"
  23. static String* const CJDHTConstants_QUERY_GP = String_CONST_SO("gp");
  24. // Ping query
  25. static String* const CJDHTConstants_QUERY_PING = String_CONST_SO("pn");
  26. // A search target (address)
  27. static String* const CJDHTConstants_TARGET = String_CONST_SO("tar");
  28. // Response with nodes. "n"
  29. static String* const CJDHTConstants_NODES = String_CONST_SO("n");
  30. // Transaction id
  31. static String* const CJDHTConstants_TXID = String_CONST_SO("txid");
  32. // Version which is in ping responses.
  33. static String* const CJDHTConstants_VERSION = String_CONST_SO("v");
  34. // Node protocols, the protocol versions of the nodes in a node list.
  35. static String* const CJDHTConstants_NODE_PROTOCOLS = String_CONST_SO("np");
  36. // The protocol version of the sending node.
  37. static String* const CJDHTConstants_PROTOCOL = String_CONST_SO("p");
  38. // The encoding scheme definition for this node's switch encoding.
  39. static String* const CJDHTConstants_ENC_SCHEME = String_CONST_SO("es");
  40. // The *index* of the smallest encoding form which can represent the interface which
  41. // the querying node is behind.
  42. static String* const CJDHTConstants_ENC_INDEX = String_CONST_SO("ei");
  43. #endif