RouterModule_pvt.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 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. uint8_t gitVersionBytes[20];
  41. String gitVersion;
  42. struct Random* rand;
  43. /**
  44. * Used by handleIncoming() to pass a message to onResponse()
  45. * while the execution goes through pinger.
  46. */
  47. struct DHTMessage* currentMessage;
  48. Identity
  49. };
  50. #endif