All pastes #959342 Raw Edit

aton

public cpp v1 · immutable
#959342 ·published 2008-03-27 11:02 UTC
rendered paste body
/*----------------------------------------------------------------------------*-Function:	atonParams:	ip[] - String representation of an IP.Return:	IP as a 32bit int.Notes:	--*----------------------------------------------------------------------------*/stock aton(ip[]){	new		ipv = strval(ip) << 24,		pos = 0;	while (pos < 15 && ip[pos] && ip[pos++] != '.') {}	ipv += strval(ip[pos]) << 16;	while (pos < 15 && ip[pos] && ip[pos++] != '.') {}	ipv += strval(ip[pos]) << 8;	while (pos < 15 && ip[pos] && ip[pos++] != '.') {}	ipv += strval(ip[pos]);	return ipv;}