1
0

NetCore.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 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/SwitchAdapter.h"
  32. #include "net/ConverterV15.h"
  33. #include "net/UpperDistributor.h"
  34. #include "net/TUNAdapter.h"
  35. #include "util/Linker.h"
  36. Linker_require("net/NetCore.c")
  37. struct NetCore
  38. {
  39. struct Allocator* alloc;
  40. struct EventBase* base;
  41. struct Random* rand;
  42. struct Log* log;
  43. struct CryptoAuth* ca;
  44. struct EventEmitter* ee;
  45. struct Address* myAddress;
  46. struct SwitchCore* switchCore;
  47. struct SwitchAdapter* switchAdapter;
  48. struct ControlHandler* controlHandler;
  49. struct SwitchPinger* sp;
  50. struct InterfaceController* ifController;
  51. struct SessionManager* sm;
  52. struct UpperDistributor* upper;
  53. struct TUNAdapter* tunAdapt;
  54. };
  55. struct NetCore* NetCore_new(uint8_t* privateKey,
  56. struct Allocator* alloc,
  57. struct EventBase* base,
  58. struct Random* rand,
  59. struct Log* log);
  60. #endif