NetCore.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 NetCore_H
  16. #define NetCore_H
  17. #include "crypto/random/Random.h"
  18. #include "crypto/CryptoAuth.h"
  19. #include "crypto/AddressCalc.h"
  20. #include "memory/Allocator.h"
  21. #include "switch/SwitchCore.h"
  22. #include "util/log/Log.h"
  23. #include "util/events/EventBase.h"
  24. #include "net/SwitchPinger.h"
  25. #include "net/ControlHandler.h"
  26. #include "net/InterfaceController.h"
  27. #include "interface/Iface.h"
  28. #include "tunnel/IpTunnel.h"
  29. #include "net/EventEmitter.h"
  30. #include "net/SessionManager.h"
  31. #include "net/UpperDistributor.h"
  32. #include "net/TUNAdapter.h"
  33. #include "util/Linker.h"
  34. Linker_require("net/NetCore.c")
  35. struct NetCore
  36. {
  37. struct Allocator* alloc;
  38. struct EventBase* base;
  39. struct Random* rand;
  40. struct Log* log;
  41. struct CryptoAuth* ca;
  42. struct EventEmitter* ee;
  43. struct Address* myAddress;
  44. struct SwitchCore* switchCore;
  45. struct ControlHandler* controlHandler;
  46. struct SwitchPinger* sp;
  47. struct InterfaceController* ifController;
  48. struct SessionManager* sm;
  49. struct UpperDistributor* upper;
  50. struct TUNAdapter* tunAdapt;
  51. };
  52. struct NetCore* NetCore_new(uint8_t* privateKey,
  53. struct Allocator* alloc,
  54. struct EventBase* base,
  55. struct Random* rand,
  56. struct Log* log);
  57. #endif