Get default pcap interface.
@param errbuf error buffer.
@return returns PcapIf.
@throws DeviceNotFoundException device not found exception.
480141
public static PcapIf pcapIf(StringBuilder errbuf) throws DeviceNotFoundException {
        String source = Application.source;
        List<PcapIf> alldevsp = new ArrayList<PcapIf>();
        if (PcapFindAllDevs(alldevsp, errbuf) != OK && LOGGER.isLoggable(Level.WARNING)) {
            LOGGER.warning("Error: {}" + errbuf.toString());
        }
        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)) {
                            return dev;
                        }
                    }
                }
            }
        } else {
            for (PcapIf dev : alldevsp) {
                if (dev.getName().equals(source)) {
                    return dev;
                }
            }
        }
        throw new DeviceNotFoundException("No device connected to the network.");
    }
101874
public ArrayList<OvhDefaultSipDomains> availableDefaultSipDomains_GET(OvhSipDomainProductTypeEnum type) throws IOException {
		String qPath = "/telephony/availableDefaultSipDomains";
		StringBuilder sb = path(qPath);
		query(sb, "type", type);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t1);
	}
259884
def get(cls, device_server_id, custom_headers=None):
        

        if custom_headers is None:
            custom_headers = {}

        api_client = client.ApiClient(cls._get_api_context())
        endpoint_url = cls._ENDPOINT_URL_READ.format(device_server_id)
        response_raw = api_client.get(endpoint_url, {}, custom_headers)

        return BunqResponseDeviceServer.cast_from_bunq_response(
            cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
        )
21869
static public CommPortIdentifier getPortIdentifier(CommPort p) throws NoSuchPortException {
        LOGGER.fine("CommPortIdentifier:getPortIdentifier(CommPort)");

        CommPortIdentifier c;
        synchronized (Sync) {
            c = CommPortIndex;
            while (c != null && c.commPort != p) {
                c = c.next;
            }
        }
        if (c != null) {
            return (c);
        }

        LOGGER.fine("not found!" + p.getName());
        throw new NoSuchPortException();
    }
947145
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.mcm.AccountLabelServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.mcm.AccountLabelServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.mcm.AccountLabelServiceSoapBindingStub(new java.net.URL(AccountLabelServiceInterfacePort_address), this);
                _stub.setPortName(getAccountLabelServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
395468
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201805.CreativeWrapperServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201805.CreativeWrapperServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201805.CreativeWrapperServiceSoapBindingStub(new java.net.URL(CreativeWrapperServiceInterfacePort_address), this);
                _stub.setPortName(getCreativeWrapperServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
97746
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201902.PlacementServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201902.PlacementServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201902.PlacementServiceSoapBindingStub(new java.net.URL(PlacementServiceInterfacePort_address), this);
                _stub.setPortName(getPlacementServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1110174
public static ns_device_profile[] get(nitro_service client) throws Exception
	{
		ns_device_profile resource = new ns_device_profile();
		resource.validate("get");
		return (ns_device_profile[]) resource.get_resources(client);
	}
942214
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.AdGroupBidModifierServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.AdGroupBidModifierServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.AdGroupBidModifierServiceSoapBindingStub(new java.net.URL(AdGroupBidModifierServiceInterfacePort_address), this);
                _stub.setPortName(getAdGroupBidModifierServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1167959
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201902.AdjustmentServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201902.AdjustmentServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201902.AdjustmentServiceSoapBindingStub(new java.net.URL(AdjustmentServiceInterfacePort_address), this);
                _stub.setPortName(getAdjustmentServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
935756
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201808.ProposalLineItemServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201808.ProposalLineItemServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201808.ProposalLineItemServiceSoapBindingStub(new java.net.URL(ProposalLineItemServiceInterfacePort_address), this);
                _stub.setPortName(getProposalLineItemServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
442763
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201808.ContentBundleServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201808.ContentBundleServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201808.ContentBundleServiceSoapBindingStub(new java.net.URL(ContentBundleServiceInterfacePort_address), this);
                _stub.setPortName(getContentBundleServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
55758
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201811.CreativeServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201811.CreativeServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201811.CreativeServiceSoapBindingStub(new java.net.URL(CreativeServiceInterfacePort_address), this);
                _stub.setPortName(getCreativeServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
831348
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201811.ReconciliationReportRowServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201811.ReconciliationReportRowServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201811.ReconciliationReportRowServiceSoapBindingStub(new java.net.URL(ReconciliationReportRowServiceInterfacePort_address), this);
                _stub.setPortName(getReconciliationReportRowServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1235799
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201808.DaiAuthenticationKeyServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201808.DaiAuthenticationKeyServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201808.DaiAuthenticationKeyServiceSoapBindingStub(new java.net.URL(DaiAuthenticationKeyServiceInterfacePort_address), this);
                _stub.setPortName(getDaiAuthenticationKeyServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1365411
def get_default_net_device():
    
    with open('/proc/net/route') as fh:
        for line in fh:
            iface, dest, _ = line.split(None, 2)
            if dest == '00000000':
                return iface
    return None
161007
def DefaultAdapter(self):
    '''
    '''
    default_adapter = None

    for obj in mockobject.objects.keys():
        if obj.startswith('/org/bluez/') and 'dev_' not in obj:
            default_adapter = obj

    if default_adapter:
        return dbus.ObjectPath(default_adapter, variant_level=1)
    else:
        raise dbus.exceptions.DBusException(
            'No such adapter.', name='org.bluez.Error.NoSuchAdapter')