Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
28
Issues
28
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
637a499a
Commit
637a499a
authored
Jul 03, 2012
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a new shell command "ip" to report IP address.
parent
214284b4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
cmd_ip.c
shell/cmd_ip.c
+13
-0
shell.c
shell/shell.c
+1
-0
shell.h
shell/shell.h
+1
-0
shell.mk
shell/shell.mk
+2
-1
No files found.
shell/cmd_ip.c
0 → 100644
View file @
637a499a
#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
]);
}
shell/shell.c
View file @
637a499a
...
...
@@ -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
}
};
...
...
shell/shell.h
View file @
637a499a
...
...
@@ -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
[]);
...
...
shell/shell.mk
View file @
637a499a
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment