ga-service-resolver.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * ga-service-resolver.h - Header for GaServiceResolver
  3. * Copyright (C) 2006-2007 Collabora Ltd.
  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.1 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 Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #ifndef __GA_SERVICE_RESOLVER_H__
  20. #define __GA_SERVICE_RESOLVER_H__
  21. #include <avahi-common/address.h>
  22. #include <glib-object.h>
  23. #include "ga-client.h"
  24. #include "ga-enums.h"
  25. G_BEGIN_DECLS
  26. typedef struct _GaServiceResolver GaServiceResolver;
  27. typedef struct _GaServiceResolverClass GaServiceResolverClass;
  28. struct _GaServiceResolverClass {
  29. GObjectClass parent_class;
  30. };
  31. struct _GaServiceResolver {
  32. GObject parent;
  33. };
  34. GType ga_service_resolver_get_type(void);
  35. /* TYPE MACROS */
  36. #define GA_TYPE_SERVICE_RESOLVER \
  37. (ga_service_resolver_get_type())
  38. #define GA_SERVICE_RESOLVER(obj) \
  39. (G_TYPE_CHECK_INSTANCE_CAST((obj), GA_TYPE_SERVICE_RESOLVER, GaServiceResolver))
  40. #define GA_SERVICE_RESOLVER_CLASS(klass) \
  41. (G_TYPE_CHECK_CLASS_CAST((klass), GA_TYPE_SERVICE_RESOLVER, GaServiceResolverClass))
  42. #define IS_GA_SERVICE_RESOLVER(obj) \
  43. (G_TYPE_CHECK_INSTANCE_TYPE((obj), GA_TYPE_SERVICE_RESOLVER))
  44. #define IS_GA_SERVICE_RESOLVER_CLASS(klass) \
  45. (G_TYPE_CHECK_CLASS_TYPE((klass), GA_TYPE_SERVICE_RESOLVER))
  46. #define GA_SERVICE_RESOLVER_GET_CLASS(obj) \
  47. (G_TYPE_INSTANCE_GET_CLASS ((obj), GA_TYPE_SERVICE_RESOLVER, GaServiceResolverClass))
  48. GaServiceResolver *ga_service_resolver_new(AvahiIfIndex interface,
  49. AvahiProtocol protocol,
  50. const gchar * name,
  51. const gchar * type,
  52. const gchar * domain,
  53. AvahiProtocol address_protocol,
  54. GaLookupFlags flags);
  55. gboolean
  56. ga_service_resolver_attach(GaServiceResolver * resolver,
  57. GaClient * client, GError ** error);
  58. gboolean
  59. ga_service_resolver_get_address(GaServiceResolver * resolver,
  60. AvahiAddress * address, uint16_t * port);
  61. G_END_DECLS
  62. #endif /* #ifndef __GA_SERVICE_RESOLVER_H__ */