code: @ConditionalOnClass(value = {PcapIf.class, PcapAddr.class, SockAddr.class, DeviceNotFoundException.class})
      //@ConditionalOnBean(StringBuilder.class)
      @Bean(PCAP_IF_BEAN_NAME)
      public PcapIf pcapIf(@Qualifier(ERRBUF_BEAN_NAME) StringBuilder errbuf) throws DeviceNotFoundException {
          List<PcapIf> alldevsp = new ArrayList<PcapIf>();
          if (PcapFindAllDevs(alldevsp, errbuf) != OK) {
              throw new NativeException(errbuf.toString());
          }
          String source = properties.getSource();
          if (source == null || source.isEmpty()) {
              for (PcapIf dev : alldevsp) {
                  for (PcapAddr addr : dev.getAddresses()) {
                      if (addr.getAddr().getSaFamily() == SockAddr.Family.AF_INET && addr.getAddr().getData() != null) {
                          Inet4Address d = Inet4Address.valueOf(addr.getAddr().getData());
                          if (!d.equals(Inet4Address.LOCALHOST) && !d.equals(Inet4Address.ZERO)) {
                              if (LOGGER.isDebugEnabled()) {
                                  LOGGER.debug("Device: {}.", dev);
                              }
                              return dev;
                          }
                      }
                  }
              }
          } else {
              for (PcapIf dev : alldevsp) {
                  if (dev.getName().equals(source)) {
                      if (LOGGER.isDebugEnabled()) {
                          LOGGER.debug("Device: {}.", dev);
                      }
                      return dev;
                  }
              }
          }
          for (PcapIf dev : alldevsp) {
              if (dev.isLoopback()) {
                  if (LOGGER.isWarnEnabled()) {
                      LOGGER.warn("No device connected to the network. Auto selected {}.", dev.getName());
                  }
                  return dev;
              }
          }
          throw new DeviceNotFoundException();
      }
docs: Pcap if (source).
  @param errbuf error buffer.
  @return pcap_if.
  @throws DeviceNotFoundException device not found exception.