/***********************************************************************************
Convert ip address from string to hex.
Assumed the string is valid.
u_pIpAdrsChar ----- IP address stored in string.
v_pIpAdrsInt ----- Output parameter.
************************************************************************************/
STATUS ipAdrsConverToHex(char* u_pIpAdrsChar, UINT32 *v_pIpAdrsInt)
{
char *pDot[4];
unsigned int temp;
int i;
pDot[0] = u_pIpAdrsChar;
pDot[1] = strchr(pDot[0],'.') + 1;
pDot[2] = strchr(pDot[1],'.') + 1;
pDot[3] = strchr(pDot[2],'.') + 1;
*v_pIpAdrsInt = 0;
for(i=0;i<4;i++)
{
temp = atoi(pDot[i]);
*v_pIpAdrsInt |= (temp & 0xff)<<(8*(3 - i));
}
return OK;
} /* end of ipAdrsConverToHex() */