Frameworks/libpurple.framework/Versions/0.6.2/Headers/dnssrv.h
changeset 2592 e8d15275025e
parent 2535 39c3c161de14
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/dnssrv.h	Fri Aug 21 13:25:11 2009 -0700
     1.3 @@ -0,0 +1,119 @@
     1.4 +/**
     1.5 + * @file dnssrv.h
     1.6 + */
     1.7 +
     1.8 +/* purple
     1.9 + *
    1.10 + * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
    1.11 + *
    1.12 + * This program is free software; you can redistribute it and/or modify
    1.13 + * it under the terms of the GNU General Public License as published by
    1.14 + * the Free Software Foundation; either version 2 of the License, or
    1.15 + * (at your option) any later version.
    1.16 + *
    1.17 + * This program is distributed in the hope that it will be useful,
    1.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.20 + * GNU General Public License for more details.
    1.21 + *
    1.22 + * You should have received a copy of the GNU General Public License
    1.23 + * along with this program; if not, write to the Free Software
    1.24 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.25 + */
    1.26 +
    1.27 +#ifndef _PURPLE_DNSSRV_H
    1.28 +#define _PURPLE_DNSSRV_H
    1.29 +
    1.30 +#ifdef __cplusplus
    1.31 +extern "C" {
    1.32 +#endif
    1.33 +
    1.34 +typedef struct _PurpleSrvQueryData PurpleSrvQueryData;
    1.35 +typedef struct _PurpleSrvResponse PurpleSrvResponse;
    1.36 +typedef struct _PurpleTxtResponse PurpleTxtResponse;
    1.37 +
    1.38 +#include <glib.h>
    1.39 +
    1.40 +struct _PurpleSrvResponse {
    1.41 +	char hostname[256];
    1.42 +	int port;
    1.43 +	int weight;
    1.44 +	int pref;
    1.45 +};
    1.46 +
    1.47 +/**
    1.48 + * @param resp An array of PurpleSrvResponse of size results.  The array
    1.49 + *        is sorted based on the order described in the DNS SRV RFC.
    1.50 + *        Users of this API should try each record in resp in order,
    1.51 + *        starting at the beginning.
    1.52 + */
    1.53 +typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data);
    1.54 +
    1.55 +/**
    1.56 + * Callback that returns the data retrieved from a DNS TXT lookup.
    1.57 + *
    1.58 + * @param responses   A GList of PurpleTxtResponse objects.
    1.59 + * @param data        The extra data passed to purple_txt_resolve.
    1.60 + */
    1.61 +typedef void (*PurpleTxtCallback)(GList *responses, gpointer data);
    1.62 +
    1.63 +/**
    1.64 + * Queries an SRV record.
    1.65 + *
    1.66 + * @param protocol Name of the protocol (e.g. "sip")
    1.67 + * @param transport Name of the transport ("tcp" or "udp")
    1.68 + * @param domain Domain name to query (e.g. "blubb.com")
    1.69 + * @param cb A callback which will be called with the results
    1.70 + * @param extradata Extra data to be passed to the callback
    1.71 + */
    1.72 +PurpleSrvQueryData *purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
    1.73 +
    1.74 +/**
    1.75 + * Cancel an SRV DNS query.
    1.76 + *
    1.77 + * @param query_data The request to cancel.
    1.78 + */
    1.79 +void purple_srv_cancel(PurpleSrvQueryData *query_data);
    1.80 +
    1.81 +/**
    1.82 + * Queries an TXT record.
    1.83 + *
    1.84 + * @param owner Name of the protocol (e.g. "_xmppconnect")
    1.85 + * @param domain Domain name to query (e.g. "blubb.com")
    1.86 + * @param cb A callback which will be called with the results
    1.87 + * @param extradata Extra data to be passed to the callback
    1.88 + *
    1.89 + * @since 2.6.0
    1.90 + */
    1.91 +PurpleSrvQueryData *purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
    1.92 +
    1.93 +/**
    1.94 + * Cancel an TXT DNS query.
    1.95 + *
    1.96 + * @param query_data The request to cancel.
    1.97 + * @since 2.6.0
    1.98 + */
    1.99 +void purple_txt_cancel(PurpleSrvQueryData *query_data);
   1.100 +
   1.101 +/**
   1.102 + * Get the value of the current TXT record.
   1.103 + *
   1.104 + * @param resp  The TXT response record
   1.105 + * @returns The value of the current TXT record.
   1.106 + * @since 2.6.0
   1.107 + */
   1.108 +const gchar *purple_txt_response_get_content(PurpleTxtResponse *resp);
   1.109 +
   1.110 +/**
   1.111 + * Destroy a TXT DNS response object.
   1.112 + *
   1.113 + * @param response The PurpleTxtResponse to destroy.
   1.114 + * @since 2.6.0
   1.115 + */
   1.116 +void purple_txt_response_destroy(PurpleTxtResponse *resp);
   1.117 +
   1.118 +#ifdef __cplusplus
   1.119 +}
   1.120 +#endif
   1.121 +
   1.122 +#endif /* _PURPLE_DNSSRV_H */