UPNPDevice

    Category: Core

    UPNP device.

    Properties

    add_port_mapping ( port, int port_internal=0, desc=”“, String proto=”UDP”, duration=0 ) const
    int ( int port, proto=”UDP” ) const
    bool ( ) const
    String ( ) const

    Enumerations

    enum IGDStatus:

    • IGD_STATUS_OK = 0 — OK.
    • IGD_STATUS_HTTP_EMPTY = 2 — Empty HTTP response.
    • IGD_STATUS_NO_URLS = 3 — Returned response contained no URLs.
    • IGD_STATUS_NO_IGD = 4 — Not a valid IGD.
    • IGD_STATUS_DISCONNECTED = 5 — Disconnected.
    • IGD_STATUS_UNKNOWN_DEVICE = 6 — Unknown device.
    • IGD_STATUS_INVALID_CONTROL = 7 — Invalid control.
    • IGD_STATUS_MALLOC_ERROR = 8 — Memory allocation error.
    • IGD_STATUS_UNKNOWN_ERROR = 9 — Unknown error.

    UPNP device. See UPNP for UPNP discovery and utility functions. Provides low-level access to UPNP control commands. Allows to manage port mappings (port forwarding) and to query network information of the device (like local and external IP address and status). Note that methods on this class are synchronous and block the calling thread.

    Property Descriptions


    • igd_control_url
    Setterset_igd_control_url(value)
    Getterget_igd_control_url()

    IDG control URL.


    Address of the local machine in the network connecting it to this .


    Setterset_igd_service_type(value)
    Getterget_igd_service_type()

    IGD service type.


    • igd_status

    IGD status. See IGDStatus.


    • service_type
    Setterset_service_type(value)
    Getterget_service_type()
    • int add_port_mapping ( port, int port_internal=0, desc=”“, String proto=”UDP”, duration=0 ) const

    Adds a port mapping to forward the given external port on this UPNPDevice for the given protocol to the local machine. See .


    • int delete_port_mapping ( port, String proto=”UDP” ) const

    Deletes the port mapping identified by the given port and protocol combination on this device. See .


    • bool is_valid_gateway ( ) const

    Returns if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.


    Returns the external IP address of this or an empty string.