简体   繁体   English

获取UPnP设备的IP地址

[英]Get IP address of an UPnP device

I'm trying to find out the IP address of an UPnP device connected to my network. 我试图找出连接到我的网络的UPnP设备的IP地址。 On Windows I'm able to get this information by referring to the following question on StackOverflow: 在Windows上,我可以通过在StackOverflow上参考以下问题来获取此信息:

UPnP Multicast: missing answers from M-SEARCH (Discovery) UPnP组播:M-SEARCH(发现)中缺少答案

However, how can I do on Linux? 但是,如何在Linux上进行操作?

Depending on how you identify the correct device you could take a look at gssdp-discover in gupnp-tools package (which is part of the GUPnP project). 根据您识别正确设备的方式,可以查看gupnp-tools软件包(属于GUPnP项目的一部分)中的gssdp -discover。 If that is not what you want but you are prepared to code a bit, take a look at the source: gssdp-discover is only ~100 lines of C so you should be a able to do what you want in a few dozen lines of python... 如果那不是您想要的,但是您准备编写一点代码,请看一下源代码:gssdp-discover仅约100行C,因此您应该能够在几十行中完成所需的工作蟒蛇...

Example: 例:

$ gssdp-discover -t uuid:c013f58f-3072-4c3b-9df8-4f869c03edf2 -n 3
Using network interface wlan0
Scanning for resources matching uuid:c013f58f-3072-4c3b-9df8-4f869c03edf2
resource available
  USN:      uuid:c013f58f-3072-4c3b-9df8-4f869c03edf2
  Location: http://10.10.15.61:49152/description.xml
$ 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM