File indexing completed on 2025-01-18 09:59:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef __G_RESOLVER_H__
0023 #define __G_RESOLVER_H__
0024
0025 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0026 #error "Only <gio/gio.h> can be included directly."
0027 #endif
0028
0029 #include <gio/giotypes.h>
0030
0031 G_BEGIN_DECLS
0032
0033 #define G_TYPE_RESOLVER (g_resolver_get_type ())
0034 #define G_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_RESOLVER, GResolver))
0035 #define G_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_RESOLVER, GResolverClass))
0036 #define G_IS_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_RESOLVER))
0037 #define G_IS_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_RESOLVER))
0038 #define G_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_RESOLVER, GResolverClass))
0039
0040 typedef struct _GResolverPrivate GResolverPrivate;
0041 typedef struct _GResolverClass GResolverClass;
0042
0043 struct _GResolver {
0044 GObject parent_instance;
0045
0046 GResolverPrivate *priv;
0047 };
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 typedef enum {
0060 G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT = 0,
0061 G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY = 1 << 0,
0062 G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY = 1 << 1,
0063 } GResolverNameLookupFlags;
0064
0065 struct _GResolverClass {
0066 GObjectClass parent_class;
0067
0068
0069 void ( *reload) (GResolver *resolver);
0070
0071
0072 GList * ( *lookup_by_name) (GResolver *resolver,
0073 const gchar *hostname,
0074 GCancellable *cancellable,
0075 GError **error);
0076 void ( *lookup_by_name_async) (GResolver *resolver,
0077 const gchar *hostname,
0078 GCancellable *cancellable,
0079 GAsyncReadyCallback callback,
0080 gpointer user_data);
0081 GList * ( *lookup_by_name_finish) (GResolver *resolver,
0082 GAsyncResult *result,
0083 GError **error);
0084
0085 gchar * ( *lookup_by_address) (GResolver *resolver,
0086 GInetAddress *address,
0087 GCancellable *cancellable,
0088 GError **error);
0089 void ( *lookup_by_address_async) (GResolver *resolver,
0090 GInetAddress *address,
0091 GCancellable *cancellable,
0092 GAsyncReadyCallback callback,
0093 gpointer user_data);
0094 gchar * ( *lookup_by_address_finish) (GResolver *resolver,
0095 GAsyncResult *result,
0096 GError **error);
0097
0098 GList * ( *lookup_service) (GResolver *resolver,
0099 const gchar *rrname,
0100 GCancellable *cancellable,
0101 GError **error);
0102 void ( *lookup_service_async) (GResolver *resolver,
0103 const gchar *rrname,
0104 GCancellable *cancellable,
0105 GAsyncReadyCallback callback,
0106 gpointer user_data);
0107 GList * ( *lookup_service_finish) (GResolver *resolver,
0108 GAsyncResult *result,
0109 GError **error);
0110
0111 GList * ( *lookup_records) (GResolver *resolver,
0112 const gchar *rrname,
0113 GResolverRecordType record_type,
0114 GCancellable *cancellable,
0115 GError **error);
0116
0117 void ( *lookup_records_async) (GResolver *resolver,
0118 const gchar *rrname,
0119 GResolverRecordType record_type,
0120 GCancellable *cancellable,
0121 GAsyncReadyCallback callback,
0122 gpointer user_data);
0123
0124 GList * ( *lookup_records_finish) (GResolver *resolver,
0125 GAsyncResult *result,
0126 GError **error);
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143 void ( *lookup_by_name_with_flags_async) (GResolver *resolver,
0144 const gchar *hostname,
0145 GResolverNameLookupFlags flags,
0146 GCancellable *cancellable,
0147 GAsyncReadyCallback callback,
0148 gpointer user_data);
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160 GList * ( *lookup_by_name_with_flags_finish) (GResolver *resolver,
0161 GAsyncResult *result,
0162 GError **error);
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178 GList * ( *lookup_by_name_with_flags) (GResolver *resolver,
0179 const gchar *hostname,
0180 GResolverNameLookupFlags flags,
0181 GCancellable *cancellable,
0182 GError **error);
0183
0184 };
0185
0186 GIO_AVAILABLE_IN_ALL
0187 GType g_resolver_get_type (void) G_GNUC_CONST;
0188 GIO_AVAILABLE_IN_ALL
0189 GResolver *g_resolver_get_default (void);
0190 GIO_AVAILABLE_IN_ALL
0191 void g_resolver_set_default (GResolver *resolver);
0192 GIO_AVAILABLE_IN_ALL
0193 GList *g_resolver_lookup_by_name (GResolver *resolver,
0194 const gchar *hostname,
0195 GCancellable *cancellable,
0196 GError **error);
0197 GIO_AVAILABLE_IN_ALL
0198 void g_resolver_lookup_by_name_async (GResolver *resolver,
0199 const gchar *hostname,
0200 GCancellable *cancellable,
0201 GAsyncReadyCallback callback,
0202 gpointer user_data);
0203 GIO_AVAILABLE_IN_ALL
0204 GList *g_resolver_lookup_by_name_finish (GResolver *resolver,
0205 GAsyncResult *result,
0206 GError **error);
0207 GIO_AVAILABLE_IN_2_60
0208 void g_resolver_lookup_by_name_with_flags_async (GResolver *resolver,
0209 const gchar *hostname,
0210 GResolverNameLookupFlags flags,
0211 GCancellable *cancellable,
0212 GAsyncReadyCallback callback,
0213 gpointer user_data);
0214 GIO_AVAILABLE_IN_2_60
0215 GList *g_resolver_lookup_by_name_with_flags_finish (GResolver *resolver,
0216 GAsyncResult *result,
0217 GError **error);
0218 GIO_AVAILABLE_IN_2_60
0219 GList *g_resolver_lookup_by_name_with_flags (GResolver *resolver,
0220 const gchar *hostname,
0221 GResolverNameLookupFlags flags,
0222 GCancellable *cancellable,
0223 GError **error);
0224 GIO_AVAILABLE_IN_ALL
0225 void g_resolver_free_addresses (GList *addresses);
0226 GIO_AVAILABLE_IN_ALL
0227 gchar *g_resolver_lookup_by_address (GResolver *resolver,
0228 GInetAddress *address,
0229 GCancellable *cancellable,
0230 GError **error);
0231 GIO_AVAILABLE_IN_ALL
0232 void g_resolver_lookup_by_address_async (GResolver *resolver,
0233 GInetAddress *address,
0234 GCancellable *cancellable,
0235 GAsyncReadyCallback callback,
0236 gpointer user_data);
0237 GIO_AVAILABLE_IN_ALL
0238 gchar *g_resolver_lookup_by_address_finish (GResolver *resolver,
0239 GAsyncResult *result,
0240 GError **error);
0241 GIO_AVAILABLE_IN_ALL
0242 GList *g_resolver_lookup_service (GResolver *resolver,
0243 const gchar *service,
0244 const gchar *protocol,
0245 const gchar *domain,
0246 GCancellable *cancellable,
0247 GError **error);
0248 GIO_AVAILABLE_IN_ALL
0249 void g_resolver_lookup_service_async (GResolver *resolver,
0250 const gchar *service,
0251 const gchar *protocol,
0252 const gchar *domain,
0253 GCancellable *cancellable,
0254 GAsyncReadyCallback callback,
0255 gpointer user_data);
0256 GIO_AVAILABLE_IN_ALL
0257 GList *g_resolver_lookup_service_finish (GResolver *resolver,
0258 GAsyncResult *result,
0259 GError **error);
0260 GIO_AVAILABLE_IN_2_34
0261 GList *g_resolver_lookup_records (GResolver *resolver,
0262 const gchar *rrname,
0263 GResolverRecordType record_type,
0264 GCancellable *cancellable,
0265 GError **error);
0266 GIO_AVAILABLE_IN_2_34
0267 void g_resolver_lookup_records_async (GResolver *resolver,
0268 const gchar *rrname,
0269 GResolverRecordType record_type,
0270 GCancellable *cancellable,
0271 GAsyncReadyCallback callback,
0272 gpointer user_data);
0273 GIO_AVAILABLE_IN_2_34
0274 GList *g_resolver_lookup_records_finish (GResolver *resolver,
0275 GAsyncResult *result,
0276 GError **error);
0277 GIO_AVAILABLE_IN_ALL
0278 void g_resolver_free_targets (GList *targets);
0279
0280 GIO_AVAILABLE_IN_2_78
0281 unsigned g_resolver_get_timeout (GResolver *resolver);
0282 GIO_AVAILABLE_IN_2_78
0283 void g_resolver_set_timeout (GResolver *resolver,
0284 unsigned timeout_ms);
0285
0286
0287
0288
0289
0290
0291
0292
0293 #define G_RESOLVER_ERROR (g_resolver_error_quark ())
0294 GIO_AVAILABLE_IN_ALL
0295 GQuark g_resolver_error_quark (void);
0296
0297 G_END_DECLS
0298
0299 #endif