Funzione Networking_GetInterfacesNetworking_GetInterfaces Function
Intestazione: #include <applibs/networking.h>Header: #include <applibs/networking.h>
Ottiene l'elenco di interfacce di rete in un dispositivo Azure Sphere.Gets the list of network interfaces in an Azure Sphere device. Se il valore di outNetworkInterfaces
è troppo piccolo per contenere tutte le interfacce di rete nel sistema, questa funzione riempie la matrice e restituisce il numero di elementi della matrice.If outNetworkInterfaces
is too small to hold all network interfaces in the system, this function fills the array and returns the number of array elements. Il numero di interfacce nel sistema non cambierà all'interno di un ciclo di avvio.The number of interfaces in the system will not change within a boot cycle.
ssize_t Networking_GetInterfaces(Networking_NetworkInterface *outNetworkInterfacesArray, size_t networkInterfacesArrayCount);
ParametriParameters
outNetworkInterfacesArray
Puntatore a una matrice di struct Networking_NetworkInterface da riempire con le proprietà dell'interfaccia di rete.outNetworkInterfacesArray
A pointer to an array of Networking_NetworkInterface structs to fill with network interface properties. Il chiamante deve allocare memoria per la matrice dopo la chiamata di Networking_GetInterfacesCount per recuperare il numero di interfacce nel dispositivo.The caller must allocate memory for the array after calling Networking_GetInterfacesCount to retrieve the number of interfaces on the device.networkInterfacesArrayCount
Il numero di elementioutNetworkInterfacesArray
che può contenere.networkInterfacesArrayCount
The number of elementsoutNetworkInterfacesArray
can hold. La matrice deve avere un elemento per ogni interfaccia di rete nel dispositivo.The array should have one element for each network interface on the device.
ErrorsErrors
Restituisce-1 se viene rilevato un errore e imposta sul errno
valore di errore.Returns -1 if an error is encountered and sets errno
to the error value.
EFAULT: il parametro
outNetworkInterfacesArray
è NULL.EFAULT: theoutNetworkInterfacesArray
parameter is NULL.ERANGE: il parametro
networkInterfacesArrayCount
è 0.ERANGE: thenetworkInterfacesArrayCount
parmaeter is 0.EAGAIN: lo stack di rete non è ancora pronto.EAGAIN: the networking stack isn't ready yet.
errno
È possibile specificare anche qualsiasi altro tipo di errore. tali errori non sono deterministici e lo stesso comportamento potrebbe non essere mantenuto tramite gli aggiornamenti del sistema.Any other errno
may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.
Valore restituitoReturn value
Restituisce il numero di interfacce di rete aggiunte alla outNetworkInterfaces
matrice.Returns the number of network interfaces added to the outNetworkInterfaces
array. In caso contrario,-1 per errore, nel qual caso errno
viene impostato sul valore di errore.Otherwise -1 for failure, in which case errno
is set to the error value.