natpmp_error() = unsupported_version | not_authorized | network_failure | out_of_resource | unsupported_opcode | bad_response
add_port_mapping/4 | add a port mapping with default lifetime. |
add_port_mapping/5 | add a port mapping. |
delete_port_mapping/4 | delete a port mapping. |
discover/0 | discover a Nat gateway. |
get_device_address/1 | |
get_external_address/1 | get external ip. |
get_internal_address/1 | get internal address used for this gateway. |
add_port_mapping(Gateway, Protocol, InternalPort, ExternalPortRequest) -> {ok, Since, InternalPort, ExternalPort, MappingLifetime} | {error, Reason}
Gateway = inet:ip_address() | inet:hostname()
Protocol = tcp | udp
InternalPort = non_neg_integer()
ExternalPortRequest = non_neg_integer()
Since = non_neg_integer()
ExternalPort = non_neg_integer()
MappingLifetime = non_neg_integer()
Reason = natpmp_error()
add a port mapping with default lifetime
add_port_mapping(Gateway, Protocol, InternalPort, ExternalPortRequest, Lifetime) -> {ok, Since, InternalPort, ExternalPort, MappingLifetime} | {error, Reason}
Gateway = inet:ip_address() | inet:hostname()
Protocol = tcp | udp
InternalPort = non_neg_integer()
ExternalPortRequest = non_neg_integer()
Lifetime = non_neg_integer()
Since = non_neg_integer()
ExternalPort = non_neg_integer()
MappingLifetime = non_neg_integer()
Reason = natpmp_error()
add a port mapping
delete_port_mapping(Gateway, Protocol, InternalPort, ExternalPortRequest) -> ok | {error, Reason}
Gateway = inet:ip_address() | inet:hostname()
Protocol = tcp | udp
InternalPort = non_neg_integer()
ExternalPortRequest = non_neg_integer()
Reason = natpmp_error()
delete a port mapping
discover() -> {ok, Gateway} | {error, any()}
Gateway = inet:ip_address()
discover a Nat gateway
get_device_address(Gateway) -> {ok, Ip} | {error, Reason}
Gateway = inet:ip_address() | inet:hostname()
Ip = inet:ip_address() | inet:hostname()
Reason = natpmp_error()
get_external_address(Gateway) -> {ok, ExternalIp} | {error, Reason}
Gateway = inet:ip_address() | inet:hostname()
ExternalIp = inet:ip_address() | inet:hostname()
Reason = natpmp_error()
get external ip
get_internal_address(Gateway) -> {ok, InternalIp}
Gateway = inet:ip_address() | inet:hostname()
InternalIp = inet:ip_address() | inet:hostname()
get internal address used for this gateway