libgluonutil.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. Copyright (c) 2016, Matthias Schiffer <mschiffer@universe-factory.net>
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. 1. Redistributions of source code must retain the above copyright notice,
  7. this list of conditions and the following disclaimer.
  8. 2. Redistributions in binary form must reproduce the above copyright notice,
  9. this list of conditions and the following disclaimer in the documentation
  10. and/or other materials provided with the distribution.
  11. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  12. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  13. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  14. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  15. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  16. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  17. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  18. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  20. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. */
  22. #ifndef _LIBGLUON_LIBGLUON_H_
  23. #define _LIBGLUON_LIBGLUON_H_
  24. #include <netinet/in.h>
  25. #include <stdbool.h>
  26. char * gluonutil_read_line(const char *filename);
  27. char * gluonutil_get_sysconfig(const char *key);
  28. char * gluonutil_get_node_id(void);
  29. char * gluonutil_get_interface_address(const char *ifname);
  30. bool gluonutil_get_node_prefix6(struct in6_addr *prefix);
  31. struct json_object * gluonutil_wrap_string(const char *str);
  32. struct json_object * gluonutil_wrap_and_free_string(char *str);
  33. bool gluonutil_has_domains(void);
  34. char * gluonutil_get_domain(void);
  35. struct json_object * gluonutil_load_site_config(void);
  36. #endif /* _LIBGLUON_LIBGLUON_H_ */