Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Latest commit

 

History

History
110 lines (65 loc) · 3.58 KB

nat_upnp.md

File metadata and controls

110 lines (65 loc) · 3.58 KB

Module nat_upnp

Data Types


protocol() = tcp | udp

Function Index

add_port_mapping/4
add_port_mapping/5Add a port mapping with an infinie release time.
add_port_mapping/6Add a port mapping and release after Timeout.
delete_port_mapping/3Delete a port mapping from the router.
discover/0discover the gateway and our IP to associate.
discover/1discover the gateway and our IP to associate, stop to wait after a timeout (default is infinity).
status_info/1get router status.

Function Details

add_port_mapping/4


add_port_mapping(Context::nat_upnp_proto:nat_upnp(), Protocol::protocol(), Port::integer(), Description::string()) -> ok | {error, term()}

add_port_mapping/5


add_port_mapping(Context::nat_upnp_proto:nat_upnp(), Protocol::protocol(), ExternalPort::integer(), InternalPort::integer(), Description::string()) -> ok | {error, term()}

Add a port mapping with an infinie release time

add_port_mapping/6


add_port_mapping(Context::nat_upnp_proto:nat_upnp(), Protocol::protocol(), ExternalPort::integer(), InternalPort::integer(), Description::string(), Timeout::integer()) -> ok | {error, term()}

Add a port mapping and release after Timeout

delete_port_mapping/3


delete_port_mapping(Context::nat_upnp_proto:nat_upnp(), Protocol::protocol(), Port::integer()) -> ok | {error, term()}

Delete a port mapping from the router

discover/0


discover() -> {ok, Context::nat_upnp_proto:nat_upnp()} | {error, term()}

discover the gateway and our IP to associate

discover/1


discover(Timeout::integer()) -> {ok, Context::nat_upnp_proto:nat_upnp()} | {error, term()}

discover the gateway and our IP to associate, stop to wait after a timeout (default is infinity).

status_info/1


status_info(Context::nat_upnp_proto:nat_upnp()) -> {Status::string(), LastConnectionError::string(), Uptime::string()} | {error, term()}

get router status