Commit 637a499a authored by Wesley W. Terpstra's avatar Wesley W. Terpstra

Added a new shell command "ip" to report IP address.

parent 214284b4
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "softpll_ng.h"
#include "shell.h"
#include "../lib/ipv4.h"
int cmd_ip(const char *args[])
{
mprintf("My IP-address: %d.%d.%d.%d\n",
myIP[0], myIP[1], myIP[2], myIP[3]);
}
......@@ -45,6 +45,7 @@ static const struct shell_cmd cmds_list[] = {
{ "saveenv", cmd_saveenv },
{ "time", cmd_time },
{ "sfp", cmd_sfp },
{ "ip", cmd_ip },
{ NULL, NULL }
};
......
......@@ -11,6 +11,7 @@ int cmd_sfp(const char *args[]);
int cmd_mode(const char *args[]);
int cmd_measure_t24p(const char *args[]);
int cmd_time(const char *args[]);
int cmd_ip(const char *args[]);
int cmd_env(const char *args[]);
int cmd_saveenv(const char *args[]);
......
......@@ -8,4 +8,5 @@ OBJS_SHELL = shell/shell.o \
shell/cmd_mode.o \
shell/cmd_measure_t24p.o \
shell/cmd_time.o \
shell/cmd_gui.o
\ No newline at end of file
shell/cmd_gui.o \
shell/cmd_ip.o
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment