|
Zen API
|
Represents an IP address.
Inheritance diagram for kIpAddress:Public Member Functions | |
| kIpAddress | kIpAddress_Any (kIpVersion version) |
| Gets an address representing an automatically-assigned address. More... | |
| kIpAddress | kIpAddress_AnyV4 () |
| Gets an address representing an automatically-assigned IPv4 address. More... | |
| kIpAddress | kIpAddress_BroadcastV4 () |
| Gets an address suitable for broadcasting IPv4 datagrams. More... | |
| kBool | kIpAddress_Equals (kIpAddress a, kIpAddress b) |
| Compares two addresses for equality. More... | |
| kStatus | kIpAddress_Format (kIpAddress address, kChar *text, kSize capacity) |
| Formats an IP address as a string. More... | |
| kIpAddress | kIpAddress_FromHost32u (k32u address) |
| Converts a host-endian 32-bit integer to an IPv4 address. More... | |
| kIpAddress | kIpAddress_FromNet32u (k32u address) |
| Converts a network-endian 32-bit integer to an IPv4 address. More... | |
| kBool | kIpAddress_IsLoopback (kIpAddress address) |
| Reports whether the given address is a loopback address. More... | |
| kIpAddress | kIpAddress_Loopback (kIpVersion version) |
| Gets the loopback address. More... | |
| kIpAddress | kIpAddress_LoopbackV4 () |
| Gets the IpV4 loopback address. More... | |
| kStatus | kIpAddress_Parse (kIpAddress *address, const kChar *text) |
| Parses a text-formatted IP address. More... | |
| k32u | kIpAddress_ToHost32u (kIpAddress address) |
| Converts an IPv4 address to a host-endian 32-bit integer. More... | |
| k32u | kIpAddress_ToNet32u (kIpAddress address) |
| Converts an IPv4 address to a network-endian 32-bit integer. More... | |
| kBool | kValue_Equals (kType type, const void *value, const void *other) |
| Determines whether a value is equal to another value. More... | |
| kSize | kValue_HashCode (kType type, const void *value) |
| Gets a hash code representing the state of this value. More... | |
| void | kValue_Import (kType type, void *value, const void *source) |
| Imports the content of another value into this value. More... | |
Public Attributes | |
| kByte | address [16] |
| Address bytes (most significant byte first). | |
| kIpVersion | version |
| Address version. | |
| kIpAddress kIpAddress_Any | ( | kIpVersion | version | ) |
Gets an address representing an automatically-assigned address.
| version | IP version. |
| kIpAddress kIpAddress_AnyV4 | ( | ) |
Gets an address representing an automatically-assigned IPv4 address.
| kIpAddress kIpAddress_BroadcastV4 | ( | ) |
Gets an address suitable for broadcasting IPv4 datagrams.
| kBool kIpAddress_Equals | ( | kIpAddress | a, |
| kIpAddress | b | ||
| ) |
Compares two addresses for equality.
| a | First address. |
| b | Second address. |
| kStatus kIpAddress_Format | ( | kIpAddress | address, |
| kChar * | text, | ||
| kSize | capacity | ||
| ) |
Formats an IP address as a string.
| address | IP address. |
| text | Receives formatted string. |
| capacity | Capacity of the string buffer. |
| kIpAddress kIpAddress_FromHost32u | ( | k32u | address | ) |
Converts a host-endian 32-bit integer to an IPv4 address.
| address | Host-endian integer. |
| kIpAddress kIpAddress_FromNet32u | ( | k32u | address | ) |
Converts a network-endian 32-bit integer to an IPv4 address.
| address | Network-endian integer. |
| kBool kIpAddress_IsLoopback | ( | kIpAddress | address | ) |
Reports whether the given address is a loopback address.
| address | IP address. |
| kIpAddress kIpAddress_Loopback | ( | kIpVersion | version | ) |
Gets the loopback address.
| version | IP version. |
| kIpAddress kIpAddress_LoopbackV4 | ( | ) |
Gets the IpV4 loopback address.
| kStatus kIpAddress_Parse | ( | kIpAddress * | address, |
| const kChar * | text | ||
| ) |
Parses a text-formatted IP address.
Supports dotted-quad (IPv4) format (e.g. "192.168.1.10").
| address | Receives the IP address. |
| text | Text-formatted IP address. |
| k32u kIpAddress_ToHost32u | ( | kIpAddress | address | ) |
Converts an IPv4 address to a host-endian 32-bit integer.
| address | IP address. |
| k32u kIpAddress_ToNet32u | ( | kIpAddress | address | ) |
Converts an IPv4 address to a network-endian 32-bit integer.
| address | IP address. |
Determines whether a value is equal to another value.
The default implementation of this method uses type reflection to compare the values field by field. This approach is not efficient, and in some cases may not produce the desired result. Value types should override this method if it is likely that equality comparisons will be required.
| type | Value type. |
| value | Pointer to value. |
| other | Pointer to other value. |
Gets a hash code representing the state of this value.
The default implementation of this method uses type reflection to generate a hash code that combines the hash codes from individual fields. This approach is not efficient, and may not produce an optimal hash code. Value types should override this method if it is likely that hash codes will be required.
| type | Value type. |
| value | Pointer to value. |
|
inherited |
Imports the content of another value into this value.
This method supports importing content from an external source, which may have a different size. In particular, "array value" types such as kText32 can import from a null-terminated source array of a differnt length.
| type | Value type. |
| value | Pointer to value. |
| source | Source for import. |