summaryrefslogtreecommitdiffstats
blob: 2b795048afb50b93465c8d11ce52d58f8dc7639b (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
56
/*
 * Copyright (c) 2011 Tobias Markmann
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#pragma once

#include <vector>

#include <Swiften/Base/boost_bsignals.h>

#include <Swiften/Network/NetworkEnvironment.h>
#include <Swiften/Network/NetworkInterface.h>

namespace Swift {

class WindowsNetworkEnvironment : public NetworkEnvironment {
	class WindowsNetworkInterface : public NetworkInterface {
	public:
		typedef boost::shared_ptr<WindowsNetworkInterface> ref;

	public:
		virtual ~WindowsNetworkInterface() { }
		virtual std::vector<HostAddress> getAddresses() {
			return addresses;
		}

		virtual std::string getName() {
			return name;
		}

		virtual bool isLoopback() {
			return false;
		}

	public:
		void addHostAddress(HostAddress address) {
			addresses.push_back(address);
		}

		void setName(const std::string& name) {
			this->name = name;
		}

	private:
		std::vector<HostAddress> addresses;
		InterfaceType type;
		std::string name;
	};

public:
	std::vector<NetworkInterface::ref> getNetworkInterfaces();
};

}