summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/WindowsNetworkEnvironment.h')
-rw-r--r--Swiften/Network/WindowsNetworkEnvironment.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/Swiften/Network/WindowsNetworkEnvironment.h b/Swiften/Network/WindowsNetworkEnvironment.h
new file mode 100644
index 0000000..2b79504
--- /dev/null
+++ b/Swiften/Network/WindowsNetworkEnvironment.h
@@ -0,0 +1,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();
+};
+
+}