UPNP - 设备和服务之间的绑定(miniupnp)

时间:2016-07-12 12:58:59

标签: c linux upnp miniupnpc

我在我的路由器上运行miniupnp SW软件包。为了列出我的LAN网络上的所有可用设备/服务,我使用了' listdevice'应用程序,它基本上查询miniupnpc以发现所有设备/服务,然后将它们打印出来。

有人可以解释我如何理解,哪种服务属于每个设备?

请参阅下面的示例表:

1: urn:schemas-upnp-org:service:Layer3Forwarding:1 
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1cf::urn:schemas-upnp-org:service:Layer3Forwarding:1
2: uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1cf       
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1cf
3: uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c0       
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c0
4: uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c1       
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c1
5: urn:schemas-upnp-org:device:WANConnectionDevice:1
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c1::urn:schemas-upnp-org:device:WANConnectionDevice:1
6: urn:schemas-upnp-org:device:WANDevice:1         
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c0::urn:schemas-upnp-org:device:WANDevice:1
7: urn:schemas-upnp-org:service:WANIPConnection:1  
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c1::urn:schemas-upnp-org:service:WANIPConnection:1
8: urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c0::urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
9: urn:schemas-upnp-org:service:WANPPPConnection:1 
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c1::urn:schemas-upnp-org:service:WANPPPConnection:1
10: upnp:rootdevice                                 
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1cf::upnp:rootdevice
11: urn:schemas-upnp-org:device:InternetGatewayDevice:1
 http://192.168.1.1:5000/rootDesc.xml
 uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1cf::urn:schemas-upnp-org:device:InternetGatewayDevice:1
12: urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1
 http://192.168.1.1:8200/rootDesc.xml
 uuid:4d696e69-444c-164e-9d41-7e1fa325930c::urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1
13: urn:schemas-upnp-org:service:ConnectionManager:1
 http://192.168.1.1:8200/rootDesc.xml
 uuid:4d696e69-444c-164e-9d41-7e1fa325930c::urn:schemas-upnp-org:service:ConnectionManager:1
14: urn:schemas-upnp-org:service:ContentDirectory:1 
 http://192.168.1.1:8200/rootDesc.xml
 uuid:4d696e69-444c-164e-9d41-7e1fa325930c::urn:schemas-upnp-org:service:ContentDirectory:1
15: urn:schemas-upnp-org:device:MediaServer:1       
 http://192.168.1.1:8200/rootDesc.xml
 uuid:4d696e69-444c-164e-9d41-7e1fa325930c::urn:schemas-upnp-org:device:MediaServer:1
16: upnp:rootdevice                                 
 http://192.168.1.1:8200/rootDesc.xml
 uuid:4d696e69-444c-164e-9d41-7e1fa325930c::upnp:rootdevice
17: uuid:4d696e69-444c-164e-9d41-7e1fa325930c       
 http://192.168.1.1:8200/rootDesc.xml
 uuid:4d696e69-444c-164e-9d41-7e1fa325930c

1 个答案:

答案 0 :(得分:2)

对于这种情况,响应实际上会为您解决问题。

每个设备将始终跟随其服务,因此从上表中可以看出,设备可能不提供任何服务,例如:

ToolTip tooltip = new ToolTip { Content = "Password cannot be empty." };

Password_PasswordBox.ToolTip = tooltip;
tooltip.PlacementTarget = Password_PasswordBox;
tooltip.Placement = System.Windows.Controls.Primitives.PlacementMode.Top;
tooltip.IsOpen = true;
tooltip.StaysOpen = false;

ToolTip tooltip2 = new ToolTip { Content = "Username cannot be empty." };

Username_TextBox.ToolTip = tooltip2;               
tooltip2.PlacementTarget = Username_TextBox;
tooltip2.Placement = System.Windows.Controls.Primitives.PlacementMode.Top;
tooltip2.IsOpen = true;
tooltip2.StaysOpen = false;

或者可以提供多种服务,例如:

5: urn:schemas-upnp-org:device:WANConnectionDevice:1
http://192.168.1.1:5000/rootDesc.xml
uuid:63ce4f39-1485-4bd6-ba33-bb1ec09dc1c1::urn:schemas-upnp-org:device:WANConnectionDevice:1