add upnp/natpmp support

Change-Id: I4945a7df3a30cb39d81a33fc7a32e9fea600bdff
diff --git a/src/upnp/protocol/mapping.cpp b/src/upnp/protocol/mapping.cpp
index 3aa24b3..4b9d5ba 100644
--- a/src/upnp/protocol/mapping.cpp
+++ b/src/upnp/protocol/mapping.cpp
@@ -94,6 +94,20 @@
     state_ = state;
 }
 
+void
+Mapping::updateState(const MappingState& newState, bool notify)
+{
+    std::unique_lock<std::mutex> lock(mutex_);
+    if (newState == state_)
+        return;
+    state_ = newState;
+
+    if (notify && notifyCb_) {
+        lock.unlock();
+        notifyCb_(shared_from_this());
+    }
+}
+
 const char*
 Mapping::getStateStr() const
 {