Example |
U16 tnet_process_cmd (U8 *cmd, U8 *buf, U16 buflen, U32 *pvar) {
REMOTEM rm;
U16 len;
/* Simple Command line parser */
len = strlen (cmd);
if (tnet_ccmp (cmd, "RINFO") == __TRUE) {
/* Display Remote Machine IP and MAC address. */
tnet_get_info (&rm);
len = sprintf (buf, "\r\n Remote IP : %d.%d.%d.%d",
rm.IpAdr[0],rm.IpAdr[1],
rm.IpAdr[2],rm.IpAdr[3]);
len += sprintf (buf+len, "\r\n Remote MAC: %02X-%02X-%02X-%02X-%02X-%02X",
rm.HwAdr[0],rm.HwAdr[1],
rm.HwAdr[2],rm.HwAdr[3],
rm.HwAdr[4],rm.HwAdr[5]);
return (len);
}
..
return (len);
}
|