dnssrv.h

Go to the documentation of this file.
00001 
00005 /* purple
00006  *
00007  * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00022  */
00023 
00024 #ifndef _PURPLE_DNSSRV_H
00025 #define _PURPLE_DNSSRV_H
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 typedef struct _PurpleSrvQueryData PurpleSrvQueryData;
00032 typedef struct _PurpleSrvResponse PurpleSrvResponse;
00033 typedef struct _PurpleTxtResponse PurpleTxtResponse;
00034 
00035 #include <glib.h>
00036 
00037 struct _PurpleSrvResponse {
00038     char hostname[256];
00039     int port;
00040     int weight;
00041     int pref;
00042 };
00043 
00050 typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data);
00051 
00058 typedef void (*PurpleTxtCallback)(GList *responses, gpointer data);
00059 
00069 PurpleSrvQueryData *purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
00070 
00076 void purple_srv_cancel(PurpleSrvQueryData *query_data);
00077 
00088 PurpleSrvQueryData *purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
00089 
00096 void purple_txt_cancel(PurpleSrvQueryData *query_data);
00097 
00105 const gchar *purple_txt_response_get_content(PurpleTxtResponse *response);
00106 
00113 void purple_txt_response_destroy(PurpleTxtResponse *response);
00114 
00115 #ifdef __cplusplus
00116 }
00117 #endif
00118 
00119 #endif /* _PURPLE_DNSSRV_H */