+static int pfl_closing(Plug plug, const char *error_msg, int error_code,
+ int calling_back)
+{
+ struct PortListener *pl = (struct PortListener *) plug;
+ pfl_terminate(pl);
+ return 1;
+}
+
+static void wrap_send_port_open(void *channel, const char *hostname, int port,
+ Socket s)
+{
+ char *peerinfo, *description;
+ peerinfo = sk_peer_info(s);
+ if (peerinfo) {
+ description = dupprintf("forwarding from %s", peerinfo);
+ sfree(peerinfo);
+ } else {
+ description = dupstr("forwarding");
+ }
+ ssh_send_port_open(channel, hostname, port, description);
+ sfree(description);
+}
+