SocketWrapper.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 SocketWrapper_H
  16. #define SocketWrapper_H
  17. #define SocketWrapper_TYPE_TUN_PACKET 0x0
  18. #define SocketWrapper_TYPE_CONF_ADD_IPV6_ADDRESS 0x1
  19. #define SocketWrapper_TYPE_CONF_SET_MTU 0x2
  20. #include "interface/Iface.h"
  21. #include "memory/Allocator.h"
  22. #include "util/log/Log.h"
  23. #include "util/Linker.h"
  24. Linker_require("interface/tuntap/SocketWrapper.c");
  25. struct SocketWrapper
  26. {
  27. struct Iface internalIf;
  28. struct Iface externalIf;
  29. };
  30. struct SocketWrapper* SocketWrapper_new(struct Allocator* alloc, struct Log* log);
  31. void SocketWrapper_addAddress(struct Iface* rawSocketIf,
  32. uint8_t* ipv6Addr,
  33. struct Log* logger,
  34. struct Except* eh,
  35. struct Allocator* alloc);
  36. void SocketWrapper_setMTU(struct Iface* rawSocketIf,
  37. uint32_t mtu,
  38. struct Log* logger,
  39. struct Except* eh,
  40. struct Allocator* alloc);
  41. #endif