mscdex / cap

A cross-platform binding for performing packet capturing with node.js
MIT License
361 stars 45 forks source link

Output of Cap.devicelist() on Windows 10 Node.js #65

Closed ohmtrivedi closed 6 years ago

ohmtrivedi commented 6 years ago

Hi, As per your example, if I run Cap.devicelist(), I was expecting output like this: // example output on Linux: // [ { name: 'eth0', // addresses: // [ { addr: '192.168.0.10', // netmask: '255.255.255.0', // broadaddr: '192.168.0.255' } ] }, // { name: 'nflog', // description: 'Linux netfilter log (NFLOG) interface', // addresses: [] }, // { name: 'any', // description: 'Pseudo-device that captures on all interfaces', // addresses: [] }, // { name: 'lo', // addresses: // [ { addr: '127.0.0.1', netmask: '255.0.0.0' }, // { addr: '::1', // netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' } ], // flags: 'PCAP_IF_LOOPBACK' } ] But I am getting output as follows: C:\Users\Ohm\Desktop\My Stuff\FAU Stuff\MS Thesis\Programming\PacketCapturing>node packetcapturing.js [ { name: '\\Device\\NPF_{867D7BA2-467D-4B56-8662-35C97A7A5FAC}', description: 'MS NDIS 6.0 LoopBack Driver', addresses: [ [Object], [Object] ] }, { name: '\\Device\\NPF_{C225F9C7-C4D3-4CC9-B53F-0EDE64F40E7C}', description: 'NdisWan Adapter', addresses: [] }, { name: '\\Device\\NPF_{DCE24018-B236-445A-8ED4-0CDB7043F63C}', description: 'Microsoft', addresses: [ [Object], [Object] ] }, { name: '\\Device\\NPF_{64835CED-670C-414E-870A-DC236990254B}', description: 'Anchorfree HSS VPN Adapter', addresses: [ [Object], [Object] ] }, { name: '\\Device\\NPF_{3AD470D7-1C5F-4DAE-B5C9-0869DC8807E1}', description: 'NdisWan Adapter', addresses: [] }, { name: '\\Device\\NPF_{484156A9-01A7-4DE3-808E-9E281B4528B4}', description: 'Microsoft', addresses: [ [Object], [Object], [Object], [Object], [Object] ] }, { name: '\\Device\\NPF_{275286C9-6E80-41FF-8E36-09A5412A25C5}', description: 'Microsoft Corporation', addresses: [ [Object], [Object] ] }, { name: '\\Device\\NPF_{8A8BA126-C998-4C6B-B3C2-C114136DAA93}', description: 'Oracle', addresses: [ [Object], [Object] ] }, { name: '\\Device\\NPF_{ABB2D272-9056-4710-8D7B-9435E9594783}', description: 'Microsoft Corporation', addresses: [ [Object], [Object] ] }, { name: '\\Device\\NPF_{E9C9E37A-4934-4DD3-8DD2-108089352735}', description: 'NdisWan Adapter', addresses: [] } ]

Can you help me how do I access the Object inside addresses to identify the adaptor I want to use?

jerbear2008 commented 3 years ago

The expected output was an // example output on Linux:, but you are on Windows.