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
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
2930499d
Commit
2930499d
authored
Nov 14, 2018
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/netconsole: rename state off into wait
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
1726274e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
23 deletions
+24
-23
wrpc.tex
doc/wrpc.tex
+9
-8
netconsole.h
include/netconsole.h
+1
-1
WR-WRPC-MIB.txt
lib/WR-WRPC-MIB.txt
+5
-5
netconsole.c
lib/netconsole.c
+1
-1
snmp.c
lib/snmp.c
+3
-3
cmd_netconsole.c
shell/cmd_netconsole.c
+5
-5
No files found.
doc/wrpc.tex
View file @
2930499d
...
...
@@ -897,7 +897,7 @@ To make sure that netconsole is enabled, please execute \texttt{netconsole}
command in the WRPC's shell:
\begin
{
lstlisting
}
wrc# netconsole
netconsole
turned off
netconsole
is waiting for peer
\end
{
lstlisting
}
The above means that netconsole is ready to accept connections from a remote
host. On the remote host, please execute the
\texttt
{
nc
}
...
...
@@ -948,8 +948,8 @@ netconsole disabled
To make netconsole to listen for incoming messages please execute the folling
command:
\begin
{
lstlisting
}
wrc# netconsole
off
netconsole
turned off
wrc# netconsole
wait
netconsole
is waiting for peer
\end
{
lstlisting
}
Alternatively IP, MAC and port number of netconsole's peer can be entered
manually, so netconsole will start sending packets to a given location.
...
...
@@ -1295,12 +1295,12 @@ WR-WRPC-MIB::wrpcNetconsoleGetPeerPort.0 = INTEGER: 53364
\end{lstlisting}
If SNMP sets are enabled with option
\texttt
{
CONFIG
\_
SNMP
\_
SET
}
, it is possible
to change netconsole's mode to
\texttt
{
disable
}
and
\texttt
{
off
}
via SNMP.
to change netconsole's mode to
\texttt
{
disable
}
and
\texttt
{
wait
}
via SNMP.
For more details please check section~
\ref
{
Netconsole
}
.
Set netconsole's mode to
\texttt
{
off
}
:
Set netconsole's mode to
\texttt
{
wait
}
:
\begin{lstlisting}
$
snmpset
$
SNMP
_
OPT wrpcNetconsoleSetApply.0 =
off
$
snmpset
$
SNMP
_
OPT wrpcNetconsoleSetApply.0 =
wait
WR-WRPC-MIB::wrpcNetconsoleSetApply.0 = INTEGER: applySuccessful(100)
\end{lstlisting}
...
...
@@ -2105,8 +2105,9 @@ tools used to build and run it, you can write to our mailing list
\code
{
netconsole <MAC> <IP> <PORT>
}
&
sets peer's MAC, IP and port number for
the netconsole
\\
\code
{
netconsole off
}
&
turn off the netconsole, will be turned on again when
next netconsole's packet arrives to WRPC
\\
\code
{
netconsole wait
}
&
let the netconsole to wait for communication from
peer; netconsole will transmit when the next netconsole's packet arrives to
WRPC
\\
\code
{
netconsole disable
}
&
disable netconsole until enabled manually
\\
...
...
include/netconsole.h
View file @
2930499d
...
...
@@ -8,7 +8,7 @@
#define NETCONSOLE_ENABLED 1
#define NETCONSOLE_DISABLED 2
#define NETCONSOLE_
OFF
3
#define NETCONSOLE_
WAIT
3
#define NETCONSOLE_PORT 55
...
...
lib/WR-WRPC-MIB.txt
View file @
2930499d
...
...
@@ -839,15 +839,15 @@ wrpcNetconsoleGetStatus OBJECT-TYPE
na(0),
enabled(1),
disable(2),
off
(3)
wait
(3)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Status of netconsole
enabled - serial console is copied to a host in the network
disabled - netconsole is not working, to resume it, please set it to _
off
_
off
- node is listening for commands to arrive from host, but nothing
disabled - netconsole is not working, to resume it, please set it to _
wait
_
wait
- node is listening for commands to arrive from host, but nothing
is send; when netconsole packet arrives all further messages
from serial console will be copied to netconsole
"
...
...
@@ -882,7 +882,7 @@ wrpcNetconsoleSetApply OBJECT-TYPE
SYNTAX INTEGER {
na(0),
disable(2),
off
(3),
wait
(3),
applySuccessful(100),
applyFailed(200),
}
...
...
@@ -891,7 +891,7 @@ wrpcNetconsoleSetApply OBJECT-TYPE
DESCRIPTION
"Make a change to a netconsole setting:
disable - don't send anything via netconsole nor wait for any input
off
- don't send anything via netconsole, but wait for any input to start sending
wait
- don't send anything via netconsole, but wait for any input to start sending
applySuccessful - successful to change state of netconsole
applyFailed - failed to change state of netconsole
"
...
...
lib/netconsole.c
View file @
2930499d
...
...
@@ -27,7 +27,7 @@ static unsigned char *cmd_rx_p = NULL;
static
uint8_t
tx_buf
[
UDP_END
+
SH_MAX_LINE_LEN
+
1
];
static
uint8_t
rx_buf
[
UDP_END
+
SH_MAX_LINE_LEN
+
1
];
struct
wr_sockaddr
netconsole_sock_addr
;
int
netconsole_status
=
NETCONSOLE_
OFF
;
int
netconsole_status
=
NETCONSOLE_
WAIT
;
struct
wr_udp_addr
netconsole_udp_addr
;
...
...
lib/snmp.c
View file @
2930499d
...
...
@@ -1618,9 +1618,9 @@ static int set_netconsole(uint8_t *buf, struct snmp_oid *obj)
*
apply_mode
=
applySuccessful
;
break
;
case
NETCONSOLE_
OFF
:
snmp_verbose
(
"%s
off
netconsole
\n
"
,
__func__
);
netconsole_status
=
NETCONSOLE_
OFF
;
case
NETCONSOLE_
WAIT
:
snmp_verbose
(
"%s
wait
netconsole
\n
"
,
__func__
);
netconsole_status
=
NETCONSOLE_
WAIT
;
*
apply_mode
=
applySuccessful
;
break
;
...
...
shell/cmd_netconsole.c
View file @
2930499d
...
...
@@ -29,8 +29,8 @@ static void print_netconsole_status(void) {
pp_printf
(
"IP: %s "
,
buf
);
pp_printf
(
"port: %d
\n
"
,
netconsole_udp_addr
.
dport
);
break
;
case
NETCONSOLE_
OFF
:
pp_printf
(
"netconsole
turned off
\n
"
);
case
NETCONSOLE_
WAIT
:
pp_printf
(
"netconsole
is waiting for peer
\n
"
);
break
;
case
NETCONSOLE_DISABLED
:
pp_printf
(
"netconsole disabled
\n
"
);
...
...
@@ -44,9 +44,9 @@ static int cmd_netconsole(const char *args[])
{
if
(
!
args
[
0
])
{
/* do nothing here, later print status */
}
else
if
(
!
strcasecmp
(
args
[
0
],
"
off
"
))
{
}
else
if
(
!
strcasecmp
(
args
[
0
],
"
wait
"
))
{
/* Disable netconsole */
netconsole_status
=
NETCONSOLE_
OFF
;
netconsole_status
=
NETCONSOLE_
WAIT
;
}
else
if
(
!
strcasecmp
(
args
[
0
],
"disable"
))
{
/* Disable permanently netconsole */
netconsole_status
=
NETCONSOLE_DISABLED
;
...
...
@@ -57,7 +57,7 @@ static int cmd_netconsole(const char *args[])
netconsole_udp_addr
.
dport
=
atoi
(
args
[
2
]);
netconsole_status
=
NETCONSOLE_ENABLED
;
}
else
{
pp_printf
(
"uage: netconsole
off
| disable | "
pp_printf
(
"uage: netconsole
wait
| disable | "
"<MAC> <IP> <port>
\n
"
);
return
-
EINVAL
;
}
...
...
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