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.

21 lines
414 B

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "upnpnat.h"
  2. int main (int argc,char * argv[]){
  3. UPNPNAT nat;
  4. nat.init(5,10);
  5. if(!nat.discovery()){
  6. printf("discovery error is %s\n",nat.get_last_error());
  7. return -1;
  8. }
  9. if(!nat.add_port_mapping("test","192.168.12.117",1234,1234,"TCP")){
  10. printf("add_port_mapping error is %s\n",nat.get_last_error());
  11. return -1;
  12. }
  13. printf("add port mapping succ.\n");
  14. return 0;
  15. }