You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
406 B

#include "upnpnat.h"
int main(int argc, char * argv[])
{
UPNPNAT nat;
nat.init(5, 10);
if (! nat.discovery())
{
printf("discovery error is %s\n", nat.get_last_error());
return -1;
}
if (! nat.add_port_mapping("test", "192.168.12.117", 1234, 1234, "TCP"))
{
printf("add_port_mapping error is %s\n", nat.get_last_error());
return -1;
}
printf("add port mapping succ.\n");
return 0;
}