ginetaddressmask.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright 2011 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __G_INET_ADDRESS_MASK_H__
  19. #define __G_INET_ADDRESS_MASK_H__
  20. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  21. #error "Only <gio/gio.h> can be included directly."
  22. #endif
  23. #include <gio/giotypes.h>
  24. G_BEGIN_DECLS
  25. #define G_TYPE_INET_ADDRESS_MASK (g_inet_address_mask_get_type ())
  26. #define G_INET_ADDRESS_MASK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_INET_ADDRESS_MASK, GInetAddressMask))
  27. #define G_INET_ADDRESS_MASK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_INET_ADDRESS_MASK, GInetAddressMaskClass))
  28. #define G_IS_INET_ADDRESS_MASK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_INET_ADDRESS_MASK))
  29. #define G_IS_INET_ADDRESS_MASK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_INET_ADDRESS_MASK))
  30. #define G_INET_ADDRESS_MASK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_INET_ADDRESS_MASK, GInetAddressMaskClass))
  31. typedef struct _GInetAddressMaskClass GInetAddressMaskClass;
  32. typedef struct _GInetAddressMaskPrivate GInetAddressMaskPrivate;
  33. struct _GInetAddressMask
  34. {
  35. GObject parent_instance;
  36. /*< private >*/
  37. GInetAddressMaskPrivate *priv;
  38. };
  39. struct _GInetAddressMaskClass
  40. {
  41. GObjectClass parent_class;
  42. };
  43. GLIB_AVAILABLE_IN_2_32
  44. GType g_inet_address_mask_get_type (void) G_GNUC_CONST;
  45. GLIB_AVAILABLE_IN_2_32
  46. GInetAddressMask *g_inet_address_mask_new (GInetAddress *addr,
  47. guint length,
  48. GError **error);
  49. GLIB_AVAILABLE_IN_2_32
  50. GInetAddressMask *g_inet_address_mask_new_from_string (const gchar *mask_string,
  51. GError **error);
  52. GLIB_AVAILABLE_IN_2_32
  53. gchar *g_inet_address_mask_to_string (GInetAddressMask *mask);
  54. GLIB_AVAILABLE_IN_2_32
  55. GSocketFamily g_inet_address_mask_get_family (GInetAddressMask *mask);
  56. GLIB_AVAILABLE_IN_2_32
  57. GInetAddress *g_inet_address_mask_get_address (GInetAddressMask *mask);
  58. GLIB_AVAILABLE_IN_2_32
  59. guint g_inet_address_mask_get_length (GInetAddressMask *mask);
  60. GLIB_AVAILABLE_IN_2_32
  61. gboolean g_inet_address_mask_matches (GInetAddressMask *mask,
  62. GInetAddress *address);
  63. GLIB_AVAILABLE_IN_2_32
  64. gboolean g_inet_address_mask_equal (GInetAddressMask *mask,
  65. GInetAddressMask *mask2);
  66. G_END_DECLS
  67. #endif /* __G_INET_ADDRESS_MASK_H__ */