nl:: Inet:: InterfaceAddressIterator
#include <src/inet/InetInterface.h>
시스템 네트워크 인터페이스 IP 주소 목록의 이터레이터입니다.
요약
이 클래스의 객체를 사용하여 시스템 네트워크 인터페이스 인터페이스 IP 주소 목록을 반복합니다.
이 클래스의 개별 인스턴스에 있는 메서드는 스레드로부터 안전하지 않습니다. 그러나 여러 스레드에서 별도의 인스턴스를 동시에 사용할 수도 있습니다.
다중 스레드 LwIP 시스템에서 인스턴스는 전역 LwIP 상태에 액세스하는 다른 스레드에 비해 스레드로부터 안전합니다. 단, 1) netif 목록을 변형하는 동안 다른 스레드가 LwIP 코어 잠금을 유지하고 2) netif 객체 자체는 소멸되지 않습니다.
소켓 기반 시스템에서는 기본 시스템의 인터페이스 및/또는 주소가 변경되더라도 반복이 항상 안정적으로 이루어집니다.
LwIP 시스템에서는 현재 주소와 연결된 인터페이스가 삭제되는 경우를 제외하고 반복이 안정적이며, 이 경우 반복이 조기 종료될 수 있습니다.
생성자 및 소멸자 |
|
---|---|
InterfaceAddressIterator(void)
InterfaceAddressIterator 객체를 구성합니다.
|
|
~InterfaceAddressIterator(void)
InterfaceAddressIterator 객체를 소멸합니다.
|
공개 함수 |
|
---|---|
GetAddress(void)
|
현재 인터페이스 주소를 가져옵니다.
|
GetAddressWithPrefix(IPPrefix & addrWithPrefix)
|
void
현재 주소의 주소와 프리픽스 길이가 포함된 IPPrefix를 반환합니다.
|
GetIPv6PrefixLength(void)
|
uint8_t
GetPrefixLength(void) 의 지원 중단된 별칭 |
GetInterface(void)
|
InterfaceId
GetInterfaceId(void) 의 지원 중단된 별칭 |
GetInterfaceId(void)
|
InterfaceId
현재 인터페이스 주소와 연결된 네트워크 인터페이스 ID를 반환합니다.
|
GetInterfaceName(char *nameBuf, size_t nameBufSize)
|
현재 인터페이스 주소와 연결된 네트워크 인터페이스의 이름을 가져옵니다.
|
GetPrefixLength(void)
|
uint8_t
현재 인터페이스 주소와 연결된 네트워크 접두사를 가져옵니다.
|
HasBroadcastAddress(void)
|
bool
현재 인터페이스 주소와 연결된 네트워크 인터페이스에 IPv4 브로드캐스트 주소가 있는지 여부를 반환합니다.
|
HasCurrent(void)
|
bool
|
IsUp(void)
|
bool
현재 인터페이스 주소와 연결된 네트워크 인터페이스가 작동 중인지 여부를 반환합니다.
|
Next(void)
|
bool
반복기를 다음 인터페이스 주소로 진행합니다.
|
SupportsMulticast(void)
|
bool
현재 인터페이스 주소와 연결된 네트워크 인터페이스가 멀티캐스트를 지원하는지 여부를 반환합니다.
|
공개 함수
GetAddress
IPAddress GetAddress( void )
GetAddressWithPrefix
void GetAddressWithPrefix( IPPrefix & addrWithPrefix )
현재 주소의 주소와 프리픽스 길이가 포함된 IPPrefix를 반환합니다.
GetInterfaceId
InterfaceId GetInterfaceId( void )
현재 인터페이스 주소와 연결된 네트워크 인터페이스 ID를 반환합니다.
세부정보 | |
---|---|
반환 |
인터페이스 ID 또는
INET_NULL_INTERFACEID (반복자가 주소 목록의 끝을 벗어나는 경우) |
GetInterfaceName
INET_ERROR GetInterfaceName( char *nameBuf, size_t nameBufSize )
현재 인터페이스 주소와 연결된 네트워크 인터페이스의 이름을 가져옵니다.
Writes the name of the network interface as \c NUL terminated text string at \c nameBuf.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
GetPrefixLength
uint8_t GetPrefixLength( void )
현재 인터페이스 주소와 연결된 네트워크 접두사를 가져옵니다.
On LwIP, this method simply returns the hard-coded constant 64. Note Well: the standard subnet prefix on all links other than PPP links is 64 bits. On PPP links and some non-broadcast multipoint access links, the convention is either 127 bits or 128 bits, but it might be something else. On most platforms, the system's interface address structure can represent arbitrary prefix lengths between 0 and 128.
세부정보 | |
---|---|
반환 |
네트워크 접두어 (비트 단위)이거나 이터레이터가 주소 목록의 끝을 벗어나는 경우 0입니다.
|
HasBroadcastAddress
bool HasBroadcastAddress( void )
현재 인터페이스 주소와 연결된 네트워크 인터페이스에 IPv4 브로드캐스트 주소가 있는지 여부를 반환합니다.
세부정보 | |
---|---|
반환 |
인터페이스에 브로드캐스트 주소가 있으면
true 이고, 그렇지 않으면 false 입니다. 또는 반복기가 인터페이스 주소에 배치되지 않은 경우 |
HasCurrent
bool HasCurrent( void )
InterfaceAddressIterator
InterfaceAddressIterator( void )
InterfaceAddressIterator 객체를 구성합니다.
첫 번째 네트워크 주소에서 반복기를 시작합니다. 일부 플랫폼에서는 이 생성자가 소멸자에 의해 재활용된 리소스를 할당할 수 있습니다.
IsUp
bool IsUp( void )
현재 인터페이스 주소와 연결된 네트워크 인터페이스가 작동 중인지 여부를 반환합니다.
세부정보 | |
---|---|
반환 |
현재 네트워크 인터페이스가 작동 중인 경우
true , 작동하지 않는 경우 false 이거나 반복기가 인터페이스 주소에 배치되지 않은 경우 |
다음
bool Next( void )
반복기를 다음 인터페이스 주소로 진행합니다.
Advances the iterator to the next interface address or to a position beyond the end of the address list. On LwIP, this method is thread-safe provided that: 1) other threads hold the LwIP core lock while mutating the netif list; and 2) netif objects themselves are never destroyed. Additionally, iteration on LwIP systems will terminate early if the current interface is removed from the list.
세부정보 | |
---|---|
반환 |
끝을 넘어서면
false 이고 그렇지 않으면 true 입니다. |
SupportsMulticast
bool SupportsMulticast( void )
현재 인터페이스 주소와 연결된 네트워크 인터페이스가 멀티캐스트를 지원하는지 여부를 반환합니다.
세부정보 | |
---|---|
반환 |
멀티캐스트가 지원되는 경우
true , 지원되지 않으면 false 이거나 반복기가 인터페이스 주소에 배치되지 않은 경우 |
~InterfaceAddressIterator
~InterfaceAddressIterator( void )
InterfaceAddressIterator 객체를 소멸합니다.
생성자가 할당한 모든 리소스를 재활용합니다.