summaryrefslogtreecommitdiffstats
blob: ecd6539fd5560c02c47f5f0289c0fc29552a8c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Copyright (c) 2012 Yoann Blein
 * Licensed under the GNU General Public License v3.
 * See Documentation/Licenses/GPLv3.txt for more information.
 */

#pragma once

#include <vector>

#include <boost/shared_ptr.hpp>

#include <Swiften/Elements/JingleTransportPayload.h>
#include <Swiften/Network/HostAddressPort.h>


namespace Swift {
	class JingleRawUDPTransportPayload : public JingleTransportPayload {
		public:
			struct Candidate {
				enum Type {
					Unknown, // default case
					Host,
					PeerReflected,
					Relayed,
					ServerReflected,
				};

				Candidate() : component(0), generation(0), type(Unknown) {}

				boost::uint8_t component;
				boost::uint8_t generation;
				std::string cid;
				HostAddressPort hostAddressPort;
				Type type;
			};

		public:
			typedef boost::shared_ptr<JingleRawUDPTransportPayload> ref;

		public:
			JingleRawUDPTransportPayload() {}

			const std::vector<Candidate>& getCandidates() const {
				return candidates;
			}

			void addCandidate(const Candidate& candidate) {
				candidates.push_back(candidate);
			}

		private:
			std::vector<Candidate> candidates;
	};
}