博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
miniupnpc
阅读量:7034 次
发布时间:2019-06-28

本文共 3947 字,大约阅读时间需要 13 分钟。

upnp端口映射:

http://bbs.csdn.net/topics/70382968

 

http://blog.csdn.net/jiuaiwo1314/article/details/7656446

http://blog.csdn.net/jiuaiwo1314/article/details/7656427

http://blog.csdn.net/wiznet2012/article/details/7693430

 

MiniUPnP download zone

http://miniupnp.tuxfamily.org/files/

 

 

a command line upnp client that will allow me to write scripts to enable and disable port forwarding on my router

upnpc -a `ifconfig wlan0 | grep "inet addr" | cut -d : -f 2 | cut -d " " -f 1` 4668 4668 TCPupnpc -a `ifconfig wlan0 | grep "inet addr" | cut -d : -f 2 | cut -d " " -f 1` 4678 4678 UDP upnpc-static -a 192.168.99.40 4678 4678 UDP M-SEARCH * HTTP/1.1\r\n HOST: 239.255.255.250:1900\r\n ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n MAN: \"ssdp:discover\"\r\n MX: 2\r\n\r\n HTTP/1.1 200 OK\r\n Cache-Control: max-age=300\r\n Date: Wed, 12 Mar 2014 10:06:19 GMT\r\n Ext: \r\n Location: http://192.168.99.1:1780/InternetGatewayDevice.xml\r\n Server: POSIX UPnP/1.0 DD-WRT Linux/V24\r\n ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n USN: uuid:40C596C5-9BF9-CB72-3586-660E4C29BD20::urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n\r\n soapbody 
\r\n
\r\n
soappostheader
POST /control?WANIPConnection HTTP/1.1\r\n Host: 192.168.99.1:1780\r\n User-Agent: Ubuntu/12.04, UPnP/1.0, MiniUPnPc/1.9\r\n Content-Length: 271\r\n Content-Type: text/xml\r\n SOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetStatusInfo\"\r\n Connection: Close\r\n Cache-Control: no-cache\r\n Pragma: no-cache\r\n\r\n SOAP Response: 
\r\n
\r\n
\r\n
Connected
\r\n
ERROR_NONE
\r\n
451042
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
192.168.110.83
\r\n
\r\n
\r\n
\r\n (gdb) p *urls $20 = {controlURL = 0x8113830 "http://192.168.99.1:1780/control?WANIPConnection",   ipcondescURL = 0x81137e0 "http://192.168.99.1:1780/x_wanipconnection.xml",   controlURL_CIF = 0x8113880 "http://192.168.99.1:1780/control?WANCommonInterfaceConfig",   controlURL_6FC = 0x8113718 "http://192.168.99.1:1780/", rootdescURL = 0x81138e0 "http://192.168.99.1:1780/InternetGatewayDevice.xml"} AddPortMapping
\r\n
4678
UDP
4678
192.168.99.48
1
libminiupnpc
0
\r\n 重复添加错误的相应:
s:Client
UPnPError
402
Invalid Argument
GetSpecificPortMappingEntry:
\r\n
4678
UDP
\r\n
\r\n
\r\n
4678
\r\n
192.168.99.40
\r\n
1
\r\n
libminiupnpc
\r\n
0
\r\n
\r\n
\r\n
可以在谷歌上这样搜索关键字:upnp port forwarding c miniupnp官网 http://miniupnp.tuxfamily.org/files/ java版本的upnp端口映射: http://upnp-portmapper.sourceforge.net/
java -jar PortMapper-1.9.6.jar -husage: java -jar PortMapper.jar [-a 
| -d
| -g | -h | -l | -r
| -s] [-i
] [-u
] -a
Add port forwarding -d
Delete port forwarding -g Start graphical user interface (default) -h print this message -i
Router index (if more than one is found) -l List forwardings -r
Add all forwardings to the current host -s Get Connection status -u
UPnP libraryProtocol is UDP or TCPUPnP library class names:- org.chris.portmapper.router.sbbi.SBBIRouterFactory (default)- org.chris.portmapper.router.weupnp.WeUPnPRouterFactory- org.chris.portmapper.router.dummy.DummyRouterFactory
你可能感兴趣的文章
fedora 25 Linux 上使用 backup-manager 进行系统备份
查看>>
我的友情链接
查看>>
读书笔记之顺序循环队列
查看>>
转型为一名数据科学家的正确打开方式
查看>>
SHELL中的for流程控制
查看>>
如何快速打造一款高清又极速的短视频APP?
查看>>
Cesium入门4 - 创建Cesium Viewer
查看>>
svn结合apache实现web也访问SVN
查看>>
我的友情链接
查看>>
MPLS 原理及配置思路
查看>>
实现 从“c:\\test.txt”这个文件中查找 "mobent"字符串出现的次数,并且记录出现的位置...
查看>>
HTML5 canvas 在线画笔绘图工具(一) 功能介绍
查看>>
我的友情链接
查看>>
lnmp环境下php7 安装redis扩展
查看>>
PPT实例教程第一篇:封面页改造
查看>>
Linux安全机制之文件加密解密
查看>>
快捷键
查看>>
linux 添加路由,让不同网络环境过来的访问按原线路回去
查看>>
oracle service 的创建、使用-基础分析
查看>>
我的友情链接
查看>>