NCDIfConfig.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @file NCDIfConfig.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * This file is part of BadVPN.
  8. *
  9. * BadVPN is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * BadVPN is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. */
  22. #ifndef BADVPN_NCD_NCDIFCONFIG_H
  23. #define BADVPN_NCD_NCDIFCONFIG_H
  24. #include <stddef.h>
  25. #include <misc/ipaddr.h>
  26. #define NCDIFCONFIG_FLAG_EXISTS (1 << 0)
  27. #define NCDIFCONFIG_FLAG_UP (1 << 1)
  28. #define NCDIFCONFIG_FLAG_RUNNING (1 << 2)
  29. int NCDIfConfig_query (const char *ifname);
  30. int NCDIfConfig_set_up (const char *ifname);
  31. int NCDIfConfig_set_down (const char *ifname);
  32. int NCDIfConfig_add_ipv4_addr (const char *ifname, struct ipv4_ifaddr ifaddr);
  33. int NCDIfConfig_remove_ipv4_addr (const char *ifname, struct ipv4_ifaddr ifaddr);
  34. int NCDIfConfig_add_ipv4_route (struct ipv4_ifaddr dest, const uint32_t *gateway, int metric, const char *device);
  35. int NCDIfConfig_remove_ipv4_route (struct ipv4_ifaddr dest, const uint32_t *gateway, int metric, const char *device);
  36. int NCDIfConfig_set_dns_servers (uint32_t *servers, size_t num_servers);
  37. int NCDIfConfig_make_tuntap (const char *ifname, const char *owner, int tun);
  38. int NCDIfConfig_remove_tuntap (const char *ifname, int tun);
  39. #endif