23 #ifndef ETCPAL_CPP_NETINT_H_
24 #define ETCPAL_CPP_NETINT_H_
28 #include "etcpal/netint.h"
92 static constexpr
size_t kInitialEstimatedCount = 4u;
96 size_t num_netints = kInitialEstimatedCount;
97 std::vector<EtcPalNetintInfo> c_netints(num_netints);
102 if (resize_count > 10)
105 c_netints.resize(num_netints);
111 std::vector<etcpal::NetintInfo> netints(num_netints);
112 for (
size_t i = 0u; i < num_netints; ++i)
199 unsigned int index = 0u;
220 unsigned int index = 0u;
A wrapper class for the EtcPal error type.
Definition: error.h:94
A type representing either a value or an etcpal_error_t code.
Definition: error.h:477
A wrapper class for the EtcPal IP address type.
Definition: inet.h:59
A wrapper class for the EtcPal netint info type.
Definition: inet.h:810
A strongly-typed ID with arbitrary internal representation.
Definition: opaque_id.h:118
Common definitions used by EtcPal C++ wrappers.
C++ wrapper and utilities for etcpal/error.h.
C++ wrapper and utilities for etcpal/inet.h.
etcpal::OpaqueId< detail::NetintIndexType, unsigned int, 0 > NetintIndex
A handle that represents a network interface index.
Definition: inet.h:805
IpAddrType
Indicates an IP address family, or an invalid IP address.
Definition: inet.h:48
etcpal::Expected< etcpal::NetintInfo > GetInterfaceWithIp(const IpAddr &ip) noexcept
Get the network interface that has the specified IP address.
Definition: netint.h:168
etcpal::Expected< NetintIndex > GetInterfaceForDest(const etcpal::IpAddr &dest) noexcept
Get the network interface that the system will choose when routing an IP packet to the specified dest...
Definition: netint.h:218
bool IsUp(NetintIndex index) noexcept
Determine whether a network interface is currently up and running.
Definition: netint.h:249
etcpal::Expected< std::vector< etcpal::NetintInfo > > GetInterfacesForIndex(NetintIndex index) noexcept
Get a list of network interfaces that have the index specified.
Definition: netint.h:151
etcpal::Error RefreshInterfaces() noexcept
Refresh the list of network interfaces.
Definition: netint.h:236
etcpal::Expected< std::vector< etcpal::NetintInfo > > GetInterfaces() noexcept
Get a list of network interfaces on the system.
Definition: netint.h:137
etcpal::Expected< NetintIndex > GetDefaultInterface(etcpal::IpAddrType type) noexcept
Get information about the default network interface.
Definition: netint.h:197
@ kEtcPalErrInvalid
An invalid argument was provided to an API function.
Definition: error.h:62
@ kEtcPalErrOk
The call was successful, no error occurred.
Definition: error.h:51
@ kEtcPalErrBufSize
A buffer provided to a function was not big enough to hold the data that needed to be packed into it.
Definition: error.h:103
etcpal_iptype_t
Used to identify the type of IP address contained in a EtcPalIpAddr.
Definition: inet.h:53
bool etcpal_netint_is_up(unsigned int netint_index)
Determine whether a network interface is currently up and running.
Definition: netint.c:352
etcpal_error_t etcpal_netint_refresh_interfaces()
Refresh the list of network interfaces.
Definition: netint.c:324
etcpal_error_t etcpal_netint_get_interface_with_ip(const EtcPalIpAddr *ip, EtcPalNetintInfo *netint)
Get the network interface that has the specified IP address.
Definition: netint.c:146
etcpal_error_t etcpal_netint_get_interface_for_dest(const EtcPalIpAddr *dest, unsigned int *netint_index)
Get the network interface that the system will choose when routing an IP packet to the specified dest...
Definition: netint.c:225
etcpal_error_t etcpal_netint_get_default_interface(etcpal_iptype_t type, unsigned int *netint_index)
Get information about the default network interface.
Definition: netint.c:179
etcpal_error_t etcpal_netint_get_interfaces(EtcPalNetintInfo *netints, size_t *num_netints)
Get a list of network interfaces on the system (or just the number of interfaces).
Definition: netint.c:90
etcpal_error_t etcpal_netint_get_interfaces_for_index(unsigned int netint_index, EtcPalNetintInfo *netints, size_t *num_netints)
Get a list of network interfaces (or just the number of interfaces) that have the index specified.
Definition: netint.c:120
A description of a single address assigned to a network interface.
Definition: inet.h:355