Public feed #959343

aton

public cpp v1 · immutable
Raw Edit
·published 2008-03-27 11:03 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,		ch;	while ((ch = ip[pos++]) && ch != '.') {}	ipv += strval(ip[pos]) << 16;	while ((ch = ip[pos++]) && ch != '.') {}	ipv += strval(ip[pos]) << 8;	while ((ch = ip[pos++]) && ch != '.') {}	ipv += strval(ip[pos]);	return ipv;}