Site Tools


iptolong

# $EPIC: iptolong.txt,v 1.2 2006/08/01 03:40:36 sthalik Exp $

Synopsis:

$iptolong(<dotted-quad>)

Technical:

  • If the <dotted-quad> value is omitted the empty string is returned.
  • The <dotted-quad> value is taken to be a dotted-quad ipv4 internet address of the form “A.B.C.D” where A,B,C,D are integers less than 256.
  • The return value is the NETWORK ORDER integer equivalent of <dotted-quad>.

Practical:

This function does the reverse of $longtoip(). The DCC handshake uses 'long's to swap ip addresses. You could use $convert() to convert your hostname to a dotted-quad and then use this function to convert it to a “long” value which would be suitable for use in a DCC handshake. Why you would do such a thing is not certain but this function is included for completeness sake.

Returns:

The “long” integer IPv4 address equivalent of <dotted-quad>

Examples:

$iptolong(127.8.4.3) returns “2131231747”

iptolong.txt · Last modified: 2006/08/01 03:45 by 127.0.0.1