A simple UPnP client implementation.
More...
This is a simple implementation of UPnP client. Its main function is to request a port mapping from an Internet Gateway Device (IGD), which will redirect communication received on a specified external port to a local socket.
◆ pj_upnp_add_port_mapping()
This is the main function to request a port mapping. If successful, the Internet Gateway Device will redirect communication received on the specified external ports to the local sockets.
- Parameters
-
sock_cnt | Number of sockets in the socket array. |
sock | Array of local UDP sockets that will be mapped. |
ext_port | (Optional) Array of external port numbers. If NULL, the external port numbers requested will be identical to the sockets' local port numbers. |
mapped_addr | Array to receive the mapped public addresses and ports of the local UDP sockets, when the function returns PJ_SUCCESS. |
- Returns
- PJ_SUCCESS on success, or the appropriate error status.
◆ pj_upnp_deinit()
Deinitialize UPnP library.
- Returns
- PJ_SUCCESS on success, or the appropriate error status.
◆ pj_upnp_del_port_mapping()
Send request to delete a port mapping.
- Parameters
-
mapped_addr | The public address and external port mapping to be deleted. |
- Returns
- PJ_SUCCESS on success, or the appropriate error status.
References PJ_END_DECL.
◆ pj_upnp_init()
Initialize UPnP library and initiate the search for valid Internet Gateway Devices (IGD) in the network.
- Parameters
-
param | The UPnP initialization parameter. |
- Returns
- PJ_SUCCESS on success, or the appropriate error status.