11477
|
1 /*
|
|
2 * This program is free software; you can redistribute it and/or modify
|
|
3 * it under the terms of the GNU General Public License as published by
|
|
4 * the Free Software Foundation; either version 2 of the License, or
|
|
5 * (at your option) any later version.
|
|
6 *
|
|
7 * This program is distributed in the hope that it will be useful,
|
|
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10 * GNU Library General Public License for more details.
|
|
11 *
|
|
12 * You should have received a copy of the GNU General Public License
|
|
13 * along with this program; if not, write to the Free Software
|
|
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
15 */
|
11539
|
16
|
11477
|
17 #ifndef _BONJOUR_DNS_SD
|
|
18 #define _BONJOUR_DNS_SD
|
|
19
|
|
20 #include <howl.h>
|
|
21 #include <glib.h>
|
|
22 #include "account.h"
|
11539
|
23
|
11477
|
24 #define BONJOUR_DEFAULT_PORT "5298"
|
|
25 #define BONJOUR_DEFAULT_PORT_INT 5298
|
|
26 #define ICHAT_SERVICE "_presence._tcp."
|
|
27
|
|
28 /**
|
|
29 * Data to be used by the dns-sd connection.
|
|
30 */
|
11539
|
31 typedef struct _BonjourDnsSd
|
|
32 {
|
|
33 sw_discovery *session;
|
11477
|
34 sw_discovery_oid session_id;
|
11539
|
35 GaimAccount *account;
|
|
36 gchar *name;
|
|
37 gchar *txtvers;
|
|
38 gchar *version;
|
|
39 gchar *first;
|
|
40 gchar *last;
|
11477
|
41 gint port_p2pj;
|
11539
|
42 gchar *phsh;
|
|
43 gchar *status;
|
|
44 gchar *email;
|
|
45 gchar *vc;
|
|
46 gchar *jid;
|
|
47 gchar *AIM;
|
|
48 gchar *msg;
|
|
49 GHashTable *buddies;
|
|
50 } BonjourDnsSd;
|
11477
|
51
|
11539
|
52 typedef enum _PublishType {
|
11477
|
53 PUBLISH_START,
|
|
54 PUBLISH_UPDATE
|
11539
|
55 } PublishType;
|
11477
|
56
|
|
57 /**
|
|
58 * Allocate space for the dns-sd data.
|
|
59 */
|
11539
|
60 BonjourDnsSd *bonjour_dns_sd_new();
|
11477
|
61
|
|
62 /**
|
|
63 * Deallocate the space of the dns-sd data.
|
|
64 */
|
11539
|
65 void bonjour_dns_sd_free(BonjourDnsSd *data);
|
11477
|
66
|
|
67 /**
|
|
68 * Send a new dns-sd packet updating our status.
|
|
69 */
|
11496
|
70 void bonjour_dns_sd_send_status(BonjourDnsSd *data, const char *status, const char *status_message);
|
11477
|
71
|
|
72 /**
|
11539
|
73 * Advertise our presence within the dns-sd daemon and start
|
|
74 * browsing for other bonjour peers.
|
11477
|
75 */
|
11539
|
76 void bonjour_dns_sd_start(BonjourDnsSd *data);
|
|
77
|
11477
|
78 /**
|
|
79 * Unregister the "_presence._tcp" service at the mDNS daemon.
|
|
80 */
|
11539
|
81 int bonjour_dns_sd_stop(BonjourDnsSd *data);
|
11477
|
82
|
|
83 #endif
|