SocketWrapper.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 "exception/Er.h"
  21. #include "interface/Iface.h"
  22. #include "memory/Allocator.h"
  23. #include "util/log/Log.h"
  24. #include "util/Linker.h"
  25. Linker_require("interface/tuntap/SocketWrapper.c")
  26. struct SocketWrapper
  27. {
  28. struct Iface internalIf;
  29. struct Iface externalIf;
  30. };
  31. struct SocketWrapper* SocketWrapper_new(struct Allocator* alloc, struct Log* log);
  32. Er_DEFUN(void SocketWrapper_addAddress(struct Iface* rawSocketIf,
  33. uint8_t* ipv6Addr,
  34. struct Log* logger,
  35. struct Allocator* alloc));
  36. Er_DEFUN(void SocketWrapper_setMTU(struct Iface* rawSocketIf,
  37. uint32_t mtu,
  38. struct Log* logger,
  39. struct Allocator* alloc));
  40. #endif