| Example | |
U16 cgi_func (U8 *env, U8 *buf, U16 buflen, U32 *pcgi)
{
REMOTEM info;
U16 len = 0;
.
.
http_get_info (&info);
/* Print a remote IP address. */
len = sprintf(buf,"Your IP: %d.%d.%d.%d",info.IpAdr[0], info.IpAdr[1],
info.IpAdr[2], infn.IpAdr[3]);
/* Print a remote ethernet MAC address. */
len += sprintf(buf+len,"Your MAC: %02x-%02x-%02x-%02x-%02x-%02x",
info.HwAdr[0], info.HwAdr[1],
info.HwAdr[2], info.HwAdr[3],
info.HwAdr[4], info.HwAdr[5]);
.
return (len);
}
|