How do I convert IP addresses from internal format to dot notation?
The system stores IP addresses as unsigned integers. The database displays them as signed integers. To convert the signed decimal value to an IP address, first convert the value to a hex number, taking into consideration that it is really an unsigned number. The 32-bit hex value represents four bytes in reverse order (Intel standard). To determine the IP address, reverse the order of the bytes and convert each byte to a decimal number. The resulting four bytes represent the four byte fields of the IP address in dotted notation. Note: The database displays a negative number when the low byte of the IP address has the most significant bit set. For example, the IP address 192.168.18.188 displays as -1139627840. To convert this IP address, perform the following procedure: Step 1 Convert the database display (-1139627840) to a hex value. 0xBC12A8C0. Step 2 Reverse the hex bytes, as shown below: CO A8 12 BC Step 3 Convert the bytes from hex to decimal, as shown below: 192 168 18 188 Step 4 T