Hi I've been trying to figure out the format for this field in the CDR origIpAddr. The documentation just says Integer but represents an IP v4 address. Example values include
352737802 and -1759442934
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An IP address by definition is a 32-bit value, and a 32-bit integer can represent. If you want to convert this integer representation into something else, like the more familiar 'dotted octet' xxx.xxx.xxx.xxx, that will depend on what language you are using. For example Java:
int ip = ... ;
String ipStr =
String.format("%d.%d.%d.%d",
(ip & 0xff),
(ip >> 8 & 0xff),
(ip >> 16 & 0xff),
(ip >> 24 & 0xff));
From this thread: Java: convert int to InetAddress - Stack Overflow
This is an online decimal to dotted notation converter:
IP Converter: IP Conversion | IP Converters Hex, Binary, Decimal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
0 comments
Please sign in to leave a comment.