SAVEABLE(0);
default_protocol = cfg->protocol = PROT_RAW;
}
+ if (!strcmp(p, "-serial")) {
+ RETURN(1);
+ /* Serial is not NONNETWORK in an odd sense of the word */
+ UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
+ SAVEABLE(0);
+ default_protocol = cfg->protocol = PROT_SERIAL;
+ /* The host parameter will already be loaded into cfg->host, so copy it across */
+ strncpy(cfg->serline, cfg->host, sizeof(cfg->serline) - 1);
+ cfg->serline[sizeof(cfg->serline) - 1] = '\0';
+ }
if (!strcmp(p, "-v")) {
RETURN(1);
flags |= FLAG_VERBOSE;
SAVEABLE(1);
cfg->addressfamily = ADDRTYPE_IPV6;
}
-
+ if (!strcmp(p, "-sercfg")) {
+ char* nextitem;
+ RETURN(2);
+ UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
+ SAVEABLE(1);
+ if (cfg->protocol != PROT_SERIAL)
+ cmdline_error("the -sercfg option can only be used with the "
+ "serial protocol");
+ /* Value[0] contains one or more , separated values, like 19200,8,n,1,X */
+ nextitem = value;
+ while (nextitem[0] != '\0') {
+ int length, skip;
+ char *end = strchr(nextitem, ',');
+ if (!end) {
+ length = strlen(nextitem);
+ skip = 0;
+ } else {
+ length = end - nextitem;
+ nextitem[length] = '\0';
+ skip = 1;
+ }
+ if (length == 1) {
+ switch (*nextitem) {
+ case '1':
+ cfg->serstopbits = 2;
+ break;
+ case '2':
+ cfg->serstopbits = 4;
+ break;
+
+ case '5':
+ cfg->serdatabits = 5;
+ break;
+ case '6':
+ cfg->serdatabits = 6;
+ break;
+ case '7':
+ cfg->serdatabits = 7;
+ break;
+ case '8':
+ cfg->serdatabits = 8;
+ break;
+ case '9':
+ cfg->serdatabits = 9;
+ break;
+
+ case 'n':
+ cfg->serparity = SER_PAR_NONE;
+ break;
+ case 'o':
+ cfg->serparity = SER_PAR_ODD;
+ break;
+ case 'e':
+ cfg->serparity = SER_PAR_EVEN;
+ break;
+ case 'm':
+ cfg->serparity = SER_PAR_MARK;
+ break;
+ case 's':
+ cfg->serparity = SER_PAR_SPACE;
+ break;
+
+ case 'N':
+ cfg->serflow = SER_FLOW_NONE;
+ break;
+ case 'X':
+ cfg->serflow = SER_FLOW_XONXOFF;
+ break;
+ case 'R':
+ cfg->serflow = SER_FLOW_RTSCTS;
+ break;
+ case 'D':
+ cfg->serflow = SER_FLOW_DSRDTR;
+ break;
+
+ default:
+ cmdline_error("Unrecognised suboption \"-sercfg %c\"",
+ *nextitem);
+ }
+ } else if (length == 3 && !strncmp(nextitem,"1.5",3)) {
+ /* Messy special case */
+ cfg->serstopbits = 3;
+ } else {
+ int serspeed = atoi(nextitem);
+ if (serspeed != 0) {
+ cfg->serspeed = serspeed;
+ } else {
+ cmdline_error("Unrecognised suboption \"-sercfg %s\"",
+ nextitem);
+ }
+ }
+ nextitem += length + skip;
+ }
+ }
return ret; /* unrecognised */
}
\IM{-raw} \c{-raw} command-line option
\IM{-rlogin} \c{-rlogin} command-line option
\IM{-ssh} \c{-ssh} command-line option
+\IM{-serial} \c{-serial} command-line option
\IM{-cleanup} \c{-cleanup} command-line option
\IM{-load} \c{-load} command-line option
\IM{-v} \c{-v} command-line option
\IM{-2} \c{-2} command-line option
\IM{-i} \c{-i} command-line option
\IM{-pgpfp} \c{-pgpfp} command-line option
+\IM{-sercfg} \c{-sercfg} command-line option
\IM{removing registry entries} removing registry entries
\IM{removing registry entries} registry entries, removing
\dd Force raw mode.
+\dt \cw{-serial}
+
+\dd Force serial mode.
+
\dt \cw{-P} \e{port}
\dd Connect to port \e{port}.
\dd Don't start a remote command or shell at all (SSH-2 only).
+\dt \cw{\-sercfg} \e{configuration-string}
+
+\dd Specify the configuration parameters for the serial port, in
+\cw{-serial} mode. \e{configuration-string} should be a
+comma-separated list of configuration parameters as follows:
+
+\lcont{
+
+\b Any single digit from 5 to 9 sets the number of data bits.
+
+\b \cq{1}, \cq{1.5} or \cq{2} sets the number of stop bits.
+
+\b Any other numeric string is interpreted as a baud rate.
+
+\b A single lower-case letter specifies the parity: \cq{n} for none,
+\cq{o} for odd, \cq{e} for even, \cq{m} for mark and \cq{s} for space.
+
+\b A single upper-case letter specifies the flow control: \cq{N} for
+none, \cq{X} for XON/XOFF, \cq{R} for RTS/CTS and \cq{D} for
+DSR/DTR.
+
+}
+
\S{plink-manpage-more-information} MORE INFORMATION
For more information on plink, it's probably best to go and look at
straight from the command line without having to go through the
configuration box first.
-\dt \cw{\-ssh}, \cw{\-telnet}, \cw{\-rlogin}, \cw{\-raw}
+\dt \cw{\-ssh}, \cw{\-telnet}, \cw{\-rlogin}, \cw{\-raw}, \cw{\-serial}
\dd Select the protocol \cw{putty} will use to make the connection.
keys, this key file must be in PuTTY's format, not OpenSSH's or
anyone else's.
+\dt \cw{\-sercfg} \e{configuration-string}
+
+\dd Specify the configuration parameters for the serial port, in
+\cw{-serial} mode. \e{configuration-string} should be a
+comma-separated list of configuration parameters as follows:
+
+\lcont{
+
+\b Any single digit from 5 to 9 sets the number of data bits.
+
+\b \cq{1}, \cq{1.5} or \cq{2} sets the number of stop bits.
+
+\b Any other numeric string is interpreted as a baud rate.
+
+\b A single lower-case letter specifies the parity: \cq{n} for none,
+\cq{o} for odd, \cq{e} for even, \cq{m} for mark and \cq{s} for space.
+
+\b A single upper-case letter specifies the flow control: \cq{N} for
+none, \cq{X} for XON/XOFF, \cq{R} for RTS/CTS and \cq{D} for
+DSR/DTR.
+
+}
+
\S{putty-manpage-saved-sessions} SAVED SESSIONS
Saved sessions are stored in a \cw{.putty/sessions} subdirectory in
\c -pgpfp print PGP key fingerprints and exit
\c -v show verbose messages
\c -load sessname Load settings from saved session
-\c -ssh -telnet -rlogin -raw
+\c -ssh -telnet -rlogin -raw -serial
\c force use of a particular protocol
\c -P port connect to specified port
\c -l user connect with specified username
\c -N don't start a shell/command (SSH-2 only)
\c -nc host:port
\c open tunnel in place of session (SSH-2 only)
+\c -sercfg configuration-string (e.g. 19200,8,n,1,X)
+\c Specify the serial configuration (serial only)
Once this works, you are ready to use Plink.
\S{using-cmdline-session} Starting a session from the command line
-\I\c{-ssh}\I\c{-telnet}\I\c{-rlogin}\I\c{-raw}These options allow
-you to bypass the configuration window and launch straight into a
-session.
+\I\c{-ssh}\I\c{-telnet}\I\c{-rlogin}\I\c{-raw}\I\c{-serial}These
+options allow you to bypass the configuration window and launch
+straight into a session.
To start a connection to a server called \c{host}:
\c putty.exe telnet://host[:port]/
+To start a connection to a serial port, e.g. COM1:
+
+\c putty.exe -serial com1
+
In order to start an existing saved session called \c{sessionname},
use the \c{-load} option (described in \k{using-cmdline-load}).
option is deprecated.)
\S2{using-cmdline-protocol} Selecting a protocol: \c{-ssh},
-\c{-telnet}, \c{-rlogin}, \c{-raw}
+\c{-telnet}, \c{-rlogin}, \c{-raw} \c{-serial}
To choose which protocol you want to connect with, you can use one
of these options:
\b \i\c{-raw} selects the raw protocol.
+\b \i\c{-serial} selects a serial connection.
+
These options are not available in the file transfer tools PSCP and
PSFTP (which only work with the SSH protocol).
This option causes the PuTTY tools not to run as normal, but instead
to display the fingerprints of the PuTTY PGP Master Keys, in order to
aid with \i{verifying new versions}. See \k{pgpkeys} for more information.
+
+\S2{using-cmdline-sercfg} \i\c{-sercfg}: specify serial port
+\i{configuration}
+
+This option specifies the configuration parameters for the serial
+port (baud rate, stop bits etc). Its argument is interpreted as a
+comma-separated list of configuration options, which can be as
+follows:
+
+\b Any single digit from 5 to 9 sets the number of data bits.
+
+\b \cq{1}, \cq{1.5} or \cq{2} sets the number of stop bits.
+
+\b Any other numeric string is interpreted as a baud rate.
+
+\b A single lower-case letter specifies the parity: \cq{n} for none,
+\cq{o} for odd, \cq{e} for even, \cq{m} for mark and \cq{s} for space.
+
+\b A single upper-case letter specifies the flow control: \cq{N} for
+none, \cq{X} for XON/XOFF, \cq{R} for RTS/CTS and \cq{D} for
+DSR/DTR.
+
+For example, \cq{-sercfg 19200,8,n,1,N} denotes a baud rate of
+19200, 8 data bits, no parity, 1 stop bit and no flow control.
printf(" -N don't start a shell/command (SSH-2 only)\n");
printf(" -nc host:port\n");
printf(" open tunnel in place of session (SSH-2 only)\n");
+ printf(" -sercfg configuration-string (e.g. 19200,8,n,1,X)\n");
+ printf(" Specify the serial configuration (serial only)\n");
exit(1);
}
printf(" -N don't start a shell/command (SSH-2 only)\n");
printf(" -nc host:port\n");
printf(" open tunnel in place of session (SSH-2 only)\n");
+ printf(" -sercfg configuration-string (e.g. 19200,8,n,1,X)\n");
+ printf(" Specify the serial configuration (serial only)\n");
exit(1);
}