Commit 2930499d authored by Adam Wujek's avatar Adam Wujek 💬

lib/netconsole: rename state off into wait

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 1726274e
......@@ -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 \\
......
......@@ -8,7 +8,7 @@
#define NETCONSOLE_ENABLED 1
#define NETCONSOLE_DISABLED 2
#define NETCONSOLE_OFF 3
#define NETCONSOLE_WAIT 3
#define NETCONSOLE_PORT 55
......
......@@ -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
"
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
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