gloox  1.0.20
jingleiceudp.h
1 /*
2  Copyright (c) 2013-2017 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
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.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef JINGLEICEUDP_H__
15 #define JINGLEICEUDP_H__
16 
17 #include "jingleplugin.h"
18 
19 #include <string>
20 #include <list>
21 
22 namespace gloox
23 {
24 
25  class Tag;
26 
27  namespace Jingle
28  {
29 
38  class GLOOX_API ICEUDP : public Plugin
39  {
40  public:
44  enum Type
45  {
46  Host,
49  ServerReflexive
50  };
51 
55  struct Candidate
56  {
57  std::string component;
58  std::string foundation;
59  std::string generation;
61  std::string id;
62  std::string ip;
63  std::string network;
64  int port;
65  int priority;
66  std::string protocol;
67  std::string rel_addr;
68  int rel_port;
70  };
71 
73  typedef std::list<Candidate> CandidateList;
74 
81  ICEUDP( const std::string& pwd, const std::string& ufrag, CandidateList& candidates );
82 
87  ICEUDP( const Tag* tag = 0 );
88 
92  virtual ~ICEUDP() {}
93 
98  const std::string& pwd() const { return m_pwd; }
99 
104  const std::string& ufrag() const { return m_ufrag; }
105 
110  const CandidateList& candidates() const { return m_candidates; }
111 
112  // reimplemented from Plugin
113  virtual const StringList features() const;
114 
115  // reimplemented from Plugin
116  virtual const std::string& filterString() const;
117 
118  // reimplemented from Plugin
119  virtual Tag* tag() const;
120 
121  // reimplemented from Plugin
122  virtual Plugin* newInstance( const Tag* tag ) const;
123 
124  // reimplemented from Plugin
125  virtual Plugin* clone() const
126  {
127  return new ICEUDP( *this );
128  }
129 
130  private:
131  std::string m_pwd;
132  std::string m_ufrag;
133  CandidateList m_candidates;
134 
135  };
136 
137  }
138 
139 }
140 
141 #endif // JINGLEICEUDP_H__
An abstraction of a Jingle plugin. This is part of Jingle (XEP-0166 et al.)
Definition: jingleplugin.h:67
const std::string & ufrag() const
Definition: jingleiceudp.h:104
std::list< std::string > StringList
Definition: gloox.h:1251
const std::string & pwd() const
Definition: jingleiceudp.h:98
const CandidateList & candidates() const
Definition: jingleiceudp.h:110
The namespace for the gloox library.
Definition: adhoc.cpp:27
virtual Plugin * clone() const
Definition: jingleiceudp.h:125
An abstraction of the signaling part of Jingle ICE-UDP Transport Method (XEP-0176).
Definition: jingleiceudp.h:38
std::list< Candidate > CandidateList
Definition: jingleiceudp.h:73
This is an abstraction of an XML element.
Definition: tag.h:46