udp廣播設備(支持onvif協議)發現
前言:最近想自己用udp發送組播訊息搜索局域網下的網路設備,發現海康的SADP Tool 和 Onvif Tool 不通,互相抓不到攝像頭,便通過winshark抓包看了下,如下:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:wa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wd="http://schemas.xmlsoap.org/ws/2005/04/discovery"
xmlns:tdn="http://www.onvif.org/ver10/network/wsdl">
<SOAP-ENV:Header><wa:MessageID>uuid:2419d68a-2dd2-21b2-a205-43cff6d9c77</wa:MessageID>
<wa:RelatesTo>uuid:1150b508-1886-4df9-a69d-ba6bcfed3008</wa:RelatesTo>
<wa:To SOAP-ENV:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wa:To>
<wa:Action SOAP-ENV:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches</wa:Action>
</SOAP-ENV:Header><SOAP-ENV:Body><wd:ProbeMatches>
<wd:ProbeMatch xmlns:dn="http://www.onvif.org/ver10/device/wsdl">
<wa:EndpointReference><wa:Address>urn:uuid:2419d68a-2dd2-21b2-a205-001620873b5f</wa:Address></wa:EndpointReference>
<wd:Types>dn:Device</wd:Types><wd:Scopes>onvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/Profile/T onvif://www.onvif.org/type/Network_Video_Transmitter onvif://www.onvif.org/type/ptz onvif://www.onvif.org/hardware/IPC onvif://www.onvif.org/name/ </wd:Scopes>
<wd:XAddrs>http://192.168.1.188:80/onvif/device_service</wd:XAddrs>
<wd:MetadataVersion>1</wd:MetadataVersion>
</wd:ProbeMatch></wd:ProbeMatches></SOAP-ENV:Body></SOAP-ENV:Envelope>
很容易獲得設備ip和service地址,
海康設備搜索協議:
組播地址:239.255.255.250:37020
組播內容:
<?xml version="1.0" encoding="UTF-8"?>
<Probe>
<Uuid>15213211-C74B-4AEC-934E-DAF526FFC12C</Uuid>
<Types>inquiry</Types>
</Probe>
onvif協議:
組播地址:239.255.255:250:3702
組播內容:
<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
xmlns="http://www.w3.org/2003/05/soap-envelope">
<Header>
<wsa:MessageID xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
uuid:1150b508-1886-4df9-a69d-ba6bcfed3008</wsa:MessageID>
<wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To>
<wsa:Action xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</wsa:Action></Header>
<Body><Probe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/ws/2005/04/discovery">
<Types>tds:Device</Types><Scopes /></Probe></Body></Envelope>
備注:如果海康的IPC或其他網路設備想要使用onvif協議,需要開啟,如下:
技術交流(嵌入式Linux、物聯網、人工智能、流媒體等)加群:938993968
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/341971.html
標籤:其他
