aboutsummaryrefslogtreecommitdiff
path: root/Mono.Nat/AbstractNatDevice.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Mono.Nat/AbstractNatDevice.cs')
-rw-r--r--Mono.Nat/AbstractNatDevice.cs45
1 files changed, 2 insertions, 43 deletions
diff --git a/Mono.Nat/AbstractNatDevice.cs b/Mono.Nat/AbstractNatDevice.cs
index 046cfc10f..1b4216002 100644
--- a/Mono.Nat/AbstractNatDevice.cs
+++ b/Mono.Nat/AbstractNatDevice.cs
@@ -30,6 +30,7 @@ using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
+using System.Threading.Tasks;
namespace Mono.Nat
{
@@ -50,48 +51,6 @@ namespace Mono.Nat
set { lastSeen = value; }
}
- public virtual void CreatePortMap (Mapping mapping)
- {
- IAsyncResult result = BeginCreatePortMap (mapping, null, null);
- EndCreatePortMap(result);
- }
-
- public virtual void DeletePortMap (Mapping mapping)
- {
- IAsyncResult result = BeginDeletePortMap (mapping, null, mapping);
- EndDeletePortMap(result);
- }
-
- public virtual Mapping[] GetAllMappings ()
- {
- IAsyncResult result = BeginGetAllMappings (null, null);
- return EndGetAllMappings (result);
- }
-
- public virtual IPAddress GetExternalIP ()
- {
- IAsyncResult result = BeginGetExternalIP(null, null);
- return EndGetExternalIP(result);
- }
-
- public virtual Mapping GetSpecificMapping (Protocol protocol, int port)
- {
- IAsyncResult result = this.BeginGetSpecificMapping (protocol, port, null, null);
- return this.EndGetSpecificMapping(result);
- }
-
- public abstract IAsyncResult BeginCreatePortMap(Mapping mapping, AsyncCallback callback, object asyncState);
- public abstract IAsyncResult BeginDeletePortMap (Mapping mapping, AsyncCallback callback, object asyncState);
-
- public abstract IAsyncResult BeginGetAllMappings (AsyncCallback callback, object asyncState);
- public abstract IAsyncResult BeginGetExternalIP (AsyncCallback callback, object asyncState);
- public abstract IAsyncResult BeginGetSpecificMapping(Protocol protocol, int externalPort, AsyncCallback callback, object asyncState);
-
- public abstract void EndCreatePortMap (IAsyncResult result);
- public abstract void EndDeletePortMap (IAsyncResult result);
-
- public abstract Mapping[] EndGetAllMappings (IAsyncResult result);
- public abstract IPAddress EndGetExternalIP (IAsyncResult result);
- public abstract Mapping EndGetSpecificMapping (IAsyncResult result);
+ public abstract Task CreatePortMap(Mapping mapping);
}
}