RTFW_IPV4_CONFIGURATION Structure
RTFW_IPV4_CONFIGURATION represents an IPv4 address and a corresponding network mask for use in configuring real-time network interfaces.
Syntax
typedef struct _RTFW_IPV4_CONFIGURATION( TCHAR IPv4Address[RTFW_IPV4ADDRESS_LENGTH]; TCHAR Netmask[RTFW_IPV4ADDRESS_LENGTH]; } RTFW_IPV4_CONFIGURATION, * PRTFW_IPV4_CONFIGURATION;
Members
IPv4Address
Holds an IPv4 address in dotted-quad notation.
Netmask
Holds a network mask in dotted-quad notation.
Remarks
The IPv4Address and Netmask strings must adhere to some specific rules to be considered valid and accepted:
- Both the IPv4Address and the Netmask must match the A.B.C.D pattern, where A, B, C and D are decimal numbers comprised between 0 and 255 inclusive
- Examples violating this rule: 10.0.8.5.9, 192.168.3, 10.300.2.3
- The leftmost number of the IPv4Address (A) must be comprised between 1 and 223 inclusive, and must not be equal to 127
- Examples violating this rule: 0.1.2.3, 127.0.0.1, 224.0.0.1
- The binary representation of the Netmask must be a series of 1's followed by a series of 0's
- Examples violating this rule: 192.168.100.50, 255.254.255.0
- The binary representation of the Network ID must not be all 0's
- Example of an (IPv4Address, Netmask) pair violating this rule: (10.1.2.3, 240.0.0.0)
- If the Netmask is not equal to 255.255.255.255, then the binary representation of the Host ID must be neither all 0's nor all 1's
- Examples of (IPv4Address, Netmask) pairs violating this rule: (192.168.100.0, 255.255.255.0), (192.168.100.255, 255.255.255.0)
- The binary representation of an IPv4Address or a Netmask whose dotted-quad notation is A.B.C.D, is a 32-bit number equal to (A<<24) | (B<<16) | (C<<8) | D
- Example: the binary representation of 192.168.0.1 is 0b11000000101010000110010000110010 (or 0xC0A86432)
- Example: the binary representation of 255.255.255.0 is 0b11111111111111111111111100000000 (or 0xFFFFFF00)
- The Network ID is the result of the bitwise AND operation between the IPv4Address and the Netmask; the Network ID is coded on 32 bits and it must be accompanied by the Netmask in order to be interpreted correctly
- Example: if the IPv4Address is 192.168.100.50 and the Netmask is 255.255.255.0, then the Network ID is 192.168.100.0
- The Host ID is the result of the bitwise AND operation between the IPv4Address and the bitwise invert of the Netmask; the Host ID is coded on 32-N bits, where N is the count of 1's in the Netmask
- Example: if the IPv4Address is 192.168.100.50 and the Netmask is 255.255.255.0, then the Host ID is coded on 8 bits and is equal to 50
Requirements
Minimum Required Version | RTX64 3.4 |
Header | RtfwAPI.h |
Library | RtfwAPI.lib |
See Also: