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
前置字串的長度。
注意:這個欄位是公開的,為此類別的不相同,其中 IPAddr 的類型為 kIPAddressType_IPv4 和 Length <= 128,其中 IPAddr 的類型為 kIPAddressType_IPv6。Length <= 32
公開的靜態屬性
公開函式
IsZero
bool IsZero( void ) const
比較前置字串與辨別的 Zero 值。
請注意:如果 IPAddr 的類型不是 kIPAddressType_Any,則前置字串不等於 Zero。
| 詳細資料 | |
|---|---|
| 傳回 |
如果等於
Zero,則為 true,否則為 false。 |
MatchAddress
bool MatchAddress( const IPAddress & addr ) const
測試地址是否與前置字元相符。
| 詳細資料 | |||
|---|---|---|---|
| 參數 |
|
||
| 傳回 |
如果
addr 有前置字串,則為 true,否則為 false。 |
||
operator!=
bool operator!=( const IPPrefix & other ) const
比較前置字串與另一個前置字串,以瞭解不等式。
請注意,除非 IPAddr 欄位完全相等,否則兩個前置字元不相等,也就是說所有 128 位元都必須相同。
| 詳細資料 | |
|---|---|
| 傳回 |
如果等於,則為
false,否則為 false。 |
operator=
IPPrefix & operator=( const IPPrefix & other )
傳統指派運算子。
| 詳細資料 | |||
|---|---|---|---|
| 參數 |
|
||
| 傳回 |
這個物件的參照。
|
||
運算子==
bool operator==( const IPPrefix & other ) const
比較前置字串與另一個前置字串,以求等同。
請注意,除非 IPAddr 欄位完全相等,否則兩個前置字元不相等,也就是說所有 128 位元都必須相同。
| 詳細資料 | |
|---|---|
| 傳回 |
如果等於,則為
true,否則為 false。 |