Function

Purpleupnp_set_port_mapping

Declaration [src]

PurpleUPnPMappingAddRemove*
purple_upnp_set_port_mapping (
  unsigned short portmap,
  const gchar* protocol,
  PurpleUPnPCallback cb,
  gpointer cb_data
)

Description [src]

Maps Ports in a UPnP enabled IGD that sits on the local network to this purple client. Essentially, this function takes care of the port forwarding so things like file transfers can work behind NAT firewalls.

This function is not directly available to language bindings

Parameters

portmap unsigned short
 

The port to map to this client.

protocol const gchar*
 

The protocol to map, either “TCP” or “UDP

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
cb PurpleUPnPCallback
 

An optional callback function to be notified when the mapping addition is complete.

cb_data gpointer
 

Extra data to be passed to the callback.

 The argument can be NULL.
 The data is owned by the caller of the function.

Return value

Returns: PurpleUPnPMappingAddRemove
 

Data which can be passed to purple_upnp_cancel_port_mapping() to cancel.

 The caller of the function takes ownership of the data, and is responsible for freeing it.