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. /** This node's encoding scheme. */
  27. struct EncodingScheme* encodingScheme;
  28. /** An AverageRoller for calculating the global mean response time. */
  29. struct AverageRoller* gmrtRoller;
  30. /** The storage for the nodes. */
  31. struct NodeStore* nodeStore;
  32. /** The sum of reach of all nodes. */
  33. uint64_t totalReach;
  34. /** The registry which is needed so that we can send messages. */
  35. struct DHTModuleRegistry* registry;
  36. /** The libevent event base for handling timeouts. */
  37. struct EventBase* eventBase;
  38. struct Log* logger;
  39. struct Allocator* allocator;
  40. struct Pinger* pinger;
  41. struct Admin* admin;
  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