title: Appreciation about Pcap devices
body: <p>I'm just trying to get automatically the active device on my System.</p>
  
  <p>For Example:</p>
  
  <p>My PC has two devices.
  1. TAP-Windows Adapter V9
  2. Intel(R) Ethernet Connection</p>
  
  <p>Actually the active device is the Intel Connection.</p>
  
  <p>So I want that my application can automatically use the active device to dump a pcap.</p>
  
  <p>My Idea is to search for the Subnetmask in both devices.
  The active device has an INET4 IP like this mask=[INET4: 255.255.255.0].
  The deactive one gives me this: mask=[0]</p>
  
  <p>Is it the right thinking, that an active device never gets a mask of 0?</p>
  
  <p>This extends also for the broadcast.</p>
  
  <p>Here is my implementation:</p>
  
  <p>static public PcapIf selectActiveDev(List alldevs){ 
      PcapIf device = new PcapIf();</p>
  
  <pre><code>for(int a = 0; a&lt;=alldevs.size()-1; a++){
      if(alldevs.get(a).getAddresses().get(0).getNetmask().toString() != "0"){
          device = alldevs.get(a);        
      }
  }
  return device;  
  </code></pre>
  
  <p>}</p>
  
  <p>I'm using JNetPcap 1.3.0 with eclipse. :)</p>