code: func Map(m Interface, c chan struct{}, protocol string, extport, intport int, name string) {
  	log := log.New("proto", protocol, "extport", extport, "intport", intport, "interface", m)
  	refresh := time.NewTimer(mapUpdateInterval)
  	defer func() {
  		refresh.Stop()
  		log.Debug("Deleting port mapping")
  		m.DeleteMapping(protocol, extport, intport)
  	}()
  	if err := m.AddMapping(protocol, extport, intport, name, mapTimeout); err != nil {
  		log.Debug("Couldn't add port mapping", "err", err)
  	} else {
  		log.Info("Mapped network port")
  	}
  	for {
  		select {
  		case _, ok := <-c:
  			if !ok {
  				return
  			}
  		case <-refresh.C:
  			log.Trace("Refreshing port mapping")
  			if err := m.AddMapping(protocol, extport, intport, name, mapTimeout); err != nil {
  				log.Debug("Couldn't add port mapping", "err", err)
  			}
  			refresh.Reset(mapUpdateInterval)
  		}
  	}
  }
docs: // Map adds a port mapping on m and keeps it alive until c is closed.
  // This function is typically invoked in its own goroutine.