2
0

WinFWHelper.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  4. *
  5. * (c) ZeroTier, Inc.
  6. * https://www.zerotier.com/
  7. */
  8. #ifndef WIN_FW_HELPER_H_
  9. #define WIN_FW_HELPER_H_
  10. #include "../node/InetAddress.hpp"
  11. #include <cstdint>
  12. #include <vector>
  13. namespace ZeroTier {
  14. class WinFWHelper {
  15. public:
  16. static void newICMPRule(const InetAddress& ip, uint64_t nwid);
  17. static void removeICMPRule(const InetAddress& ip, uint64_t nwid);
  18. static void removeICMPRules(uint64_t nwid);
  19. static void removeICMPRules();
  20. private:
  21. static void _run(std::string cmd);
  22. static void newICMPv4Rule(std::string address, uint64_t nwid);
  23. static void newICMPv6Rule(std::string address, uint64_t nwid);
  24. static void removeICMPv4Rule(std::string address, uint64_t nwid);
  25. static void removeICMPv6Rule(std::string address, uint64_t nwid);
  26. static void removeICMPv4Rules(uint64_t nwid);
  27. static void removeICMPv6Rules(uint64_t nwid);
  28. };
  29. } // namespace ZeroTier
  30. #endif