summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/NullNATTraversalInterface.h')
-rw-r--r--Swiften/Network/NullNATTraversalInterface.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/Swiften/Network/NullNATTraversalInterface.h b/Swiften/Network/NullNATTraversalInterface.h
new file mode 100644
index 0000000..72a4a08
--- /dev/null
+++ b/Swiften/Network/NullNATTraversalInterface.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011 Remko Tronçon
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Network/NATTraversalInterface.h>
+
+namespace Swift {
+ class NullNATTraversalInterface : public NATTraversalInterface {
+ public:
+ virtual bool isAvailable() {
+ return true;
+ }
+
+ virtual boost::optional<HostAddress> getPublicIP() {
+ return boost::optional<HostAddress>();
+ }
+
+ virtual boost::optional<NATPortMapping> addPortForward(int, int) {
+ return boost::optional<NATPortMapping>();
+ }
+
+ virtual bool removePortForward(const NATPortMapping&) {
+ return false;
+ }
+ };
+}