2
Copyright (c) 2013 by Jakob Schroeter <js@camaya.net>
3
This file is part of the gloox library. http://camaya.net/gloox
5
This software is distributed under a license. The full license
6
agreement can be found in the file LICENSE in this distribution.
7
This software may not be copied, modified, sold or distributed
8
other than expressed in the named license agreement.
10
This software is distributed without any warranty.
14
#ifndef JINGLEICEUDP_H__
15
#define JINGLEICEUDP_H__
17
#include "jingleplugin.h"
31
* @brief An abstraction of the signaling part of Jingle ICE-UDP Transport Method (@xep{0176}).
35
* @author Jakob Schroeter <js@camaya.net>
38
class ICEUDP : public Plugin
42
* Describes the candidate type.
46
Host, /**< A host candidate. */
47
PeerReflexive, /**< A peer reflexive candidate. */
48
Relayed, /**< A relayed candidate. */
49
ServerReflexive /**< A server reflexive candidate. */
53
* Describes a single transport candidate.
57
std::string component; /**< A Component ID as defined in ICE-CORE. */
58
std::string foundation; /**< A Foundation as defined in ICE-CORE.*/
59
std::string generation; /**< An index, starting at 0, that enables the parties to keep track of
60
updates to the candidate throughout the life of the session. */
61
std::string id; /**< A unique identifier for the candidate. */
62
std::string ip; /**< The IP address for the candidate transport mechanism. */
63
std::string network; /**< An index, starting at 0, referencing which network this candidate is on for a given peer. */
64
int port; /**< The port at the candidate IP address. */
65
int priority; /**< A Priority as defined in ICE-CORE. */
66
std::string protocol; /**< The protocol to be used. Should be @b udp. */
67
std::string rel_addr; /**< A related address as defined in ICE-CORE. */
68
int rel_port; /**< A related port as defined in ICE-CORE. */
69
Type type; /**< A Candidate Type as defined in ICE-CORE. */
72
/** A list of transport candidates. */
73
typedef std::list<Candidate> CandidateList;
76
* Constructs a new instance.
77
* @param pwd The @c pwd value.
78
* @param ufrag The @c ufrag value.
79
* @param candidates A list of connection candidates.
81
ICEUDP( const std::string& pwd, const std::string& ufrag, CandidateList& candidates );
84
* Constructs a new instance from the given tag.
85
* @param tag The Tag to parse.
87
ICEUDP( const Tag* tag = 0 );
95
* Returns the @c pwd value.
96
* @return The @c pwd value.
98
const std::string& pwd() const { return m_pwd; }
101
* Returns the @c ufrag value.
102
* @return The @c ufrag value.
104
const std::string& ufrag() const { return m_ufrag; }
107
* Returns the list of connection candidates.
108
* @return The list of connection candidates.
110
const CandidateList& candidates() const { return m_candidates; }
112
// reimplemented from Plugin
113
virtual const StringList features() const;
115
// reimplemented from Plugin
116
virtual const std::string& filterString() const;
118
// reimplemented from Plugin
119
virtual Tag* tag() const;
121
// reimplemented from Plugin
122
virtual Plugin* newInstance( const Tag* tag ) const;
124
// reimplemented from Plugin
125
virtual Plugin* clone() const
127
return new ICEUDP( *this );
133
CandidateList m_candidates;
141
#endif // JINGLEICEUDP_H__