annotate libpurple/protocols/jabber/jingle/rawudp.h @ 26858:19d27ee1c72a

Use matching buffer lengths to avoid confusion.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 02 May 2009 18:19:55 +0000
parents 0c8d41f5caa0
children c585572e80dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
1 /**
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
2 * @file rawudp.h
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
3 *
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
4 * purple
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
5 *
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
9 * (at your option) any later version.
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
10 *
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
14 * GNU General Public License for more details.
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
15 *
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
19 */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
20
26562
0c8d41f5caa0 Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <paul@darkrain42.org>
parents: 26376
diff changeset
21 #ifndef PURPLE_JABBER_JINGLE_RAWUDP_H
0c8d41f5caa0 Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <paul@darkrain42.org>
parents: 26376
diff changeset
22 #define PURPLE_JABBER_JINGLE_RAWUDP_H
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
23
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
24 #include <glib.h>
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
25 #include <glib-object.h>
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
26
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
27 #include "transport.h"
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
28
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
29 G_BEGIN_DECLS
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
30
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
31 #define JINGLE_TYPE_RAWUDP (jingle_rawudp_get_type())
26030
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
32 #define JINGLE_TYPE_RAWUDP_CANDIDATE (jingle_rawudp_candidate_get_type())
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
33 #define JINGLE_RAWUDP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), JINGLE_TYPE_RAWUDP, JingleRawUdp))
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
34 #define JINGLE_RAWUDP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), JINGLE_TYPE_RAWUDP, JingleRawUdpClass))
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
35 #define JINGLE_IS_RAWUDP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), JINGLE_TYPE_RAWUDP))
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
36 #define JINGLE_IS_RAWUDP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), JINGLE_TYPE_RAWUDP))
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
37 #define JINGLE_RAWUDP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), JINGLE_TYPE_RAWUDP, JingleRawUdpClass))
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
38
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
39 /** @copydoc _JingleRawUdp */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
40 typedef struct _JingleRawUdp JingleRawUdp;
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
41 /** @copydoc _JingleRawUdpClass */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
42 typedef struct _JingleRawUdpClass JingleRawUdpClass;
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
43 /** @copydoc _JingleRawUdpPrivate */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
44 typedef struct _JingleRawUdpPrivate JingleRawUdpPrivate;
26030
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
45 /** @copydoc _JingleRawUdpCandidate */
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
46 typedef struct _JingleRawUdpCandidate JingleRawUdpCandidate;
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
47
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
48 /** The rawudp class */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
49 struct _JingleRawUdpClass
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
50 {
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
51 JingleTransportClass parent_class; /**< The parent class. */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
52
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
53 xmlnode *(*to_xml) (JingleTransport *transport, xmlnode *content, JingleActionType action);
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
54 JingleTransport *(*parse) (xmlnode *transport);
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
55 };
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
56
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
57 /** The rawudp class's private data */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
58 struct _JingleRawUdp
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
59 {
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
60 JingleTransport parent; /**< The parent of this object. */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
61 JingleRawUdpPrivate *priv; /**< The private data of this object. */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
62 };
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
63
26030
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
64 struct _JingleRawUdpCandidate
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
65 {
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
66 guint generation;
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
67 guint component;
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
68 gchar *id;
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
69 gchar *ip;
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
70 guint port;
26376
1ac93927e7f5 Don't forget to copy the rem_know attribute of IceUdp candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26030
diff changeset
71
1ac93927e7f5 Don't forget to copy the rem_know attribute of IceUdp candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26030
diff changeset
72 gboolean rem_known; /* TRUE if the remote side knows
1ac93927e7f5 Don't forget to copy the rem_know attribute of IceUdp candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26030
diff changeset
73 * about this candidate */
26030
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
74 };
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
75
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
76 #ifdef __cplusplus
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
77 extern "C" {
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
78 #endif
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
79
26030
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
80 GType jingle_rawudp_candidate_get_type(void);
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
81
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
82 /**
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
83 * Gets the rawudp class's GType
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
84 *
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
85 * @return The rawudp class's GType.
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
86 */
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
87 GType jingle_rawudp_get_type(void);
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
88
26030
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
89 JingleRawUdpCandidate *jingle_rawudp_candidate_new(const gchar *id,
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
90 guint generation, guint component, const gchar *ip, guint port);
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
91 void jingle_rawudp_add_local_candidate(JingleRawUdp *rawudp, JingleRawUdpCandidate *candidate);
365eb0b68d5f Update Jingle raw-udp to latest spec version.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26023
diff changeset
92 GList *jingle_rawudp_get_remote_candidates(JingleRawUdp *rawudp);
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
93
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
94 #ifdef __cplusplus
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
95 }
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
96 #endif
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
97
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
98 G_END_DECLS
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
99
26562
0c8d41f5caa0 Standardize the header file sentinels to PURPLE_JABBER_[BLAH]_H
Paul Aurich <paul@darkrain42.org>
parents: 26376
diff changeset
100 #endif /* PURPLE_JABBER_JINGLE_RAWUDP_H */
26023
7252e3d0c627 Add files I missed committing before and remove a few unnecessary functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
101