nl:: Inet:: IPPrefix
#include <src/inet/IPPrefix.h>
網際網路通訊協定位址前置字串。
摘要
使用 IPPrefix
類別的物件來表示 IPv4 和 IPv6 位址系列的網際網路通訊協定位址前置字串。
公開屬性 |
|
---|---|
IPAddr
|
IPv6 或 IPv4 位址。
|
Length
|
uint8_t
前置字元長度。
|
公開靜態屬性 |
|
---|---|
Zero
|
不同的物件,其中
IPAddr 的類型為 kIPAddressType_Any 和 Length == 0 。 |
公用函式 |
|
---|---|
IsZero(void) const
|
bool
比較前置字串與辨別的
Zero 值。 |
MatchAddress(const IPAddress & addr) const
|
bool
測試地址是否符合前置字串。
|
operator!=(const IPPrefix & other) const
|
bool
將前置字串與其他前置字串相等。
|
operator=(const IPPrefix & other)
|
IPPrefix &
傳統指派運算子。
|
operator==(const IPPrefix & other) const
|
bool
將前置字串與其他前置字串進行比較。
|
公開屬性
長度
uint8_t Length
前置字元長度。
注意:這個欄位為公開欄位,且是這個類別的不變性,Length <= 32
其中 IPAddr
的類型為 kIPAddressType_IPv4
和 Length <= 128
,其中 IPAddr
的類型為 kIPAddressType_IPv6
。
公開靜態屬性
公用函式
IsZero
bool IsZero( void ) const
比較前置字串與辨別的 Zero
值。
注意事項:如果 IPAddr
的類型不是 kIPAddressType_Any
,則前置字串與 Zero
不同。
詳細說明 | |
---|---|
傳回 |
如果等於
Zero ,則為 true ,否則為 false 。 |
MatchAddress
bool MatchAddress( const IPAddress & addr ) const
測試地址是否符合前置字串。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
如果
addr 有前置字元,則傳回 true ,否則為 false 。 |
運算子!=
bool operator!=( const IPPrefix & other ) const
將前置字串與其他前置字串相等。
注意:除非 IPAddr
欄位完全相等 (即所有的 128 位元必須相同),否則兩個前置字元不相等。
詳細說明 | |
---|---|
傳回 |
false (如果相等),否則為 false 。 |
運算子=
IPPrefix & operator=( const IPPrefix & other )
傳統指派運算子。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
對這個物件的參照。
|
運算子==
bool operator==( const IPPrefix & other ) const
將前置字串與其他前置字串進行比較。
注意:除非 IPAddr
欄位完全相等 (即所有的 128 位元必須相同),否則兩個前置字元不相等。
詳細說明 | |
---|---|
傳回 |
true 如果相等值,則傳回 false 。 |