ginetaddressmask.h 3.1 KB

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