RouterModule_pvt.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 RouterModule_pvt_H
  16. #define RouterModule_pvt_H
  17. /**
  18. * Internal structures which are needed for testing but should not be exposed to the outside world.
  19. */
  20. struct RouterModule_Ping;
  21. /** The context for this module. */
  22. struct RouterModule
  23. {
  24. /** This node's address, doesn't contain networkAddress component. */
  25. struct Address address;
  26. /** An AverageRoller for calculating the global mean response time. */
  27. struct AverageRoller* gmrtRoller;
  28. /** The storage for the nodes. */
  29. struct NodeStore* nodeStore;
  30. /** The sum of reach of all nodes. */
  31. uint64_t totalReach;
  32. /** The registry which is needed so that we can send messages. */
  33. struct DHTModuleRegistry* registry;
  34. /** The libevent event base for handling timeouts. */
  35. struct EventBase* eventBase;
  36. struct Log* logger;
  37. struct Allocator* allocator;
  38. struct Pinger* pinger;
  39. struct Admin* admin;
  40. struct Random* rand;
  41. uint32_t pingsInFlight;
  42. /**
  43. * Used by handleIncoming() to pass a message to onResponse()
  44. * while the execution goes through pinger.
  45. */
  46. struct DHTMessage* currentMessage;
  47. Identity
  48. };
  49. #endif