libpurple/protocols/jabber/jingle/iceudp.h

Thu, 22 Aug 2013 01:36:58 +0530

author
Ankit Vani <a@nevitus.org>
date
Thu, 22 Aug 2013 01:36:58 +0530
branch
soc.2013.gobjectification.plugins
changeset 36574
e9b59dd16117
parent 33632
78c026f584bd
child 34935
686fa55b0deb
permissions
-rw-r--r--

Merged soc.2013.gobjectification branch

26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
1 /**
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
2 * @file iceudp.h
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
3 *
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
4 * purple
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
5 *
28322
ac8fec1d2234 Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents: 26702
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
ac8fec1d2234 Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents: 26702
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
ac8fec1d2234 Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents: 26702
diff changeset
8 * source distribution.
ac8fec1d2234 Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents: 26702
diff changeset
9 *
26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
13 * (at your option) any later version.
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
14 *
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
18 * GNU General Public License for more details.
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
19 *
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
23 */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
24
26702
b3c0c14c4c5e Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <darkrain42@pidgin.im>
parents: 26413
diff changeset
25 #ifndef PURPLE_JABBER_JINGLE_ICEUDP_H
b3c0c14c4c5e Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <darkrain42@pidgin.im>
parents: 26413
diff changeset
26 #define PURPLE_JABBER_JINGLE_ICEUDP_H
26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
27
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
28 #include <glib.h>
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
29 #include <glib-object.h>
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
30
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
31 #include "transport.h"
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
32
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
33 G_BEGIN_DECLS
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
34
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
35 #define JINGLE_TYPE_ICEUDP (jingle_iceudp_get_type())
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
36 #define JINGLE_TYPE_ICEUDP_CANDIDATE (jingle_iceudp_candidate_get_type())
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
37 #define JINGLE_ICEUDP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), JINGLE_TYPE_ICEUDP, JingleIceUdp))
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
38 #define JINGLE_ICEUDP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), JINGLE_TYPE_ICEUDP, JingleIceUdpClass))
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
39 #define JINGLE_IS_ICEUDP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), JINGLE_TYPE_ICEUDP))
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
40 #define JINGLE_IS_ICEUDP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), JINGLE_TYPE_ICEUDP))
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
41 #define JINGLE_ICEUDP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), JINGLE_TYPE_ICEUDP, JingleIceUdpClass))
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
42
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
43 /** @copydoc _JingleIceUdp */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
44 typedef struct _JingleIceUdp JingleIceUdp;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
45 /** @copydoc _JingleIceUdpClass */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
46 typedef struct _JingleIceUdpClass JingleIceUdpClass;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
47 /** @copydoc _JingleIceUdpPrivate */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
48 typedef struct _JingleIceUdpPrivate JingleIceUdpPrivate;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
49 /** @copydoc _JingleIceUdpCandidate */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
50 typedef struct _JingleIceUdpCandidate JingleIceUdpCandidate;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
51
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
52 /** The iceudp class */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
53 struct _JingleIceUdpClass
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
54 {
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
55 JingleTransportClass parent_class; /**< The parent class. */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
56
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
57 xmlnode *(*to_xml) (JingleTransport *transport, xmlnode *content, JingleActionType action);
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
58 JingleTransport *(*parse) (xmlnode *transport);
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
59 };
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
60
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
61 /** The iceudp class's private data */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
62 struct _JingleIceUdp
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
63 {
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
64 JingleTransport parent; /**< The parent of this object. */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
65 JingleIceUdpPrivate *priv; /**< The private data of this object. */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
66 };
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
67
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
68 struct _JingleIceUdpCandidate
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
69 {
33631
21775fb6957a Abstract candidate translation for JingleTransports.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28322
diff changeset
70 gchar *id;
26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
71 guint component;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
72 gchar *foundation;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
73 guint generation;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
74 gchar *ip;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
75 guint network;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
76 guint port;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
77 guint priority;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
78 gchar *protocol;
26325
5427d1073629 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Michael Ruprecht <maiku@pidgin.im>
parents: 26302
diff changeset
79 gchar *reladdr;
5427d1073629 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Michael Ruprecht <maiku@pidgin.im>
parents: 26302
diff changeset
80 guint relport;
26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
81 gchar *type;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
82
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
83 gchar *username;
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
84 gchar *password;
26413
ffcca54b2b47 Make IceUdp candidates know whether the remote side knows about them.
Michael Ruprecht <maiku@pidgin.im>
parents: 26325
diff changeset
85
ffcca54b2b47 Make IceUdp candidates know whether the remote side knows about them.
Michael Ruprecht <maiku@pidgin.im>
parents: 26325
diff changeset
86 gboolean rem_known; /* TRUE if the remote side knows
ffcca54b2b47 Make IceUdp candidates know whether the remote side knows about them.
Michael Ruprecht <maiku@pidgin.im>
parents: 26325
diff changeset
87 * about this candidate */
26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
88 };
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
89
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
90 GType jingle_iceudp_candidate_get_type(void);
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
91
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
92 /**
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
93 * Gets the iceudp class's GType
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
94 *
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
95 * @return The iceudp class's GType.
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
96 */
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
97 GType jingle_iceudp_get_type(void);
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
98
33631
21775fb6957a Abstract candidate translation for JingleTransports.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28322
diff changeset
99 JingleIceUdpCandidate *jingle_iceudp_candidate_new(const gchar *id,
21775fb6957a Abstract candidate translation for JingleTransports.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28322
diff changeset
100 guint component, const gchar *foundation, guint generation,
26302
0fb3ad9495a5 Add the id attribute to ice-udp according to the XEP.
Michael Ruprecht <maiku@pidgin.im>
parents: 26166
diff changeset
101 const gchar *ip, guint network, guint port, guint priority,
0fb3ad9495a5 Add the id attribute to ice-udp according to the XEP.
Michael Ruprecht <maiku@pidgin.im>
parents: 26166
diff changeset
102 const gchar *protocol, const gchar *type,
0fb3ad9495a5 Add the id attribute to ice-udp according to the XEP.
Michael Ruprecht <maiku@pidgin.im>
parents: 26166
diff changeset
103 const gchar *username, const gchar *password);
26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
104
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
105 G_END_DECLS
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
106
26702
b3c0c14c4c5e Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <darkrain42@pidgin.im>
parents: 26413
diff changeset
107 #endif /* PURPLE_JABBER_JINGLE_ICEUDP_H */
26166
ad7d09fef256 Added a Jingle ice-udp transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
diff changeset
108

mercurial