Site Tools


# $EPIC: longtoip.txt,v 1.2 2006/08/01 04:07:08 sthalik Exp $




  • If the <integer> value is omitted the empty string is returned.
  • The <integer> value is taken to be a 32 bit unsigned integer.
  • The <integer> value is taken to be in NETWORK ORDER.
  • The return value is the dotted-quad IP address of <integer>


This function does the reverse of $iptolong(). The DCC handshake uses 'long's to swap ip addresses. You can use this function to convert the 'long' into a dotted-quad IP address which can then be converted into a hostname by the $convert() function. This can be used to look up the hostname of someone offering you a DCC connection.


The dotted-quad IP address equivalent of <integer>


$longtoip(2131231747)                                returns ""
$longtoip(${(127 << 24) + (8 << 16) + (4 << 8) + 3}) returns ""
longtoip.txt · Last modified: 2006/08/01 04:13 by