ndd is used to set parameters for network protocols, including TCP, IP, UDP, and ARP. It can be used to modify the parameters associated with IP forwarding and routing. For example, let's look at the set of configurable parameters for TCP transmission:
server# ndd /dev/tcp \? ? (read only) tcp_close_wait_interval (read and write) tcp_conn_req_max_q (read and write) tcp_conn_req_max_q0 (read and write) tcp_conn_req_min (read and write) tcp_conn_grace_period (read and write) tcp_cwnd_max (read and write) tcp_debug (read and write) tcp_smallest_nonpriv_port (read and write) tcp_ip_abort_cinterval (read and write) tcp_ip_abort_linterval (read and write) tcp_ip_abort_interval (read and write) tcp_ip_notify_cinterval (read and write) tcp_ip_notify_interval (read and write) tcp_ip_ttl (read and write) tcp_keepalive_interval (read and write) tcp_maxpsz_multiplier (read and write) tcp_mss_def (read and write) tcp_mss_max (read and write) tcp_mss_min (read and write) tcp_naglim_def (read and write) tcp_rexmit_interval_initial (read and write) tcp_rexmit_interval_max (read and write) tcp_rexmit_interval_min (read and write) tcp_wroff_xtra (read and write) tcp_deferred_ack_interval (read and write) tcp_snd_lowat_fraction (read and write) tcp_sth_rcv_hiwat (read and write) tcp_sth_rcv_lowat (read and write) tcp_dupack_fast_retransmit (read and write) tcp_ignore_path_mtu (read and write) tcp_rcv_push_wait (read and write) tcp_smallest_anon_port (read and write) tcp_largest_anon_port (read and write) tcp_xmit_hiwat (read and write) tcp_xmit_lowat (read and write) tcp_recv_hiwat (read and write) tcp_recv_hiwat_minmss (read and write) tcp_fin_wait_2_flush_interval (read and write) tcp_co_min (read and write) tcp_max_buf (read and write) tcp_zero_win_probesize (read and write) tcp_strong_iss (read and write) tcp_rtt_updates (read and write) tcp_wscale_always (read and write) tcp_tstamp_always (read and write) tcp_tstamp_if_wscale (read and write) tcp_rexmit_interval_extra (read and write) tcp_deferred_acks_max (read and write) tcp_slow_start_after_idle (read and write) tcp_slow_start_initial (read and write) tcp_co_timer_interval (read and write) tcp_extra_priv_ports (read only) tcp_extra_priv_ports_add (write only) tcp_extra_priv_ports_del (write only) tcp_status (read only) tcp_bind_hash (read only) tcp_listen_hash (read only) tcp_conn_hash (read only) tcp_queue_hash (read only) tcp_host_param (read and write) tcp_1948_phrase (write only)
Parameters can also be set for IP, as well as TCP. For example, if the parameter ip_forwarding has a value of 2 (the default), it will only perform routing when two or more interfaces are active. However, if this parameter is set to zero, then ip_forwarding will never be performed (that is, to ensure that multihoming is enabled rather than routing). This can be set by using the following command:
server# ndd -set /dev/ip ip_forwarding 0
As we mentioned in the previous section, FTP commands are associated with specific operations that are to be performed on the server. Most FTP clients and the Solaris FTP server support the following case-insensitive commands:
! Escape to the default shell.
$ Execute a predefined macro.
account Send account information to the remote server.
append Append server output to a file.
ascii Set ASCII transfer type. ASCII mode is the default transfer mode and is used for transferring text files.
bell Beep when the specified command is completed.
binary Set binary transfer type. Typically used for transferring binary files like .ZIP files, .gif giles, and .Z files.
bye Terminate the ftp session and exit from the client.
case Toggle get uppercase/lowercase mapping.
cd Change remote working directory. Changes the directory to the one named. If the directory named is not a subdirectory of the current directory, the path (for example, cd /pub/library) must be specified.
cdup Change remote working directory to parent directory.
close Terminate ftp session, but do not exit from the client.
cd Change remote working directory.
delete Delete the remote file specified.
debug Toggle/set debugging mode on server.
dir List the contents of a remote directory.
disconnect Terminate the current ftp session.
form Set file transfer format to be binary or ASCII.
get Download file from the server to the local client.
glob Toggle metacharacter expansion of local filenames.
hash Toggle printing '#' for each buffer transferred. Prints a hash '#' on the screen for every 1024 bytes transferred. This is useful for keeping track of a FTP transfer interactively.
help Gives local help on the use of commands within the ftp client.
lcd Change local working directory to that specified.
ls List contents of current remote directory.
macdef Define a macro interactively.
mdelete Delete multiple files as determined by a file specification (for example, MDELETE *.txt).
mdir List contents of multiple remote directories in one request.
mget Download multiple files, as specified by using a wildcard character * in the file specification.
mkdir Create a directory on the remote machine as a subdirectory relative to the current directory.
mls List contents of multiple remote directories in a single request.
mode Set file transfer mode to be ASCII or binary.
mput Upload multiple files from your local file system to the remote server.
nmap Set templates for default filename mapping.
ntrans Set translation table for default filename mapping.
open Connect to remote server.
prompt Force interactive prompting on multiple commands.
proxy Issue command on alternate connection.
sendport Toggle use of PORT cmd for each data connection.
put Upload one file at a time.
pwd Print working directory on remote machine.
quit Terminate ftp session and exit.
quote Send arbitrary ftp command.
recv Receive file.
remotehelp Get help from remote server.
rename Rename file.
reset Clear queued command replies.
rmdir Remove directory on the remote machine.
runique Toggle store unique for local files.
send Upload a single file.
status Show current status.
struct Set file transfer structure.
sunique Toggle store unique on remote machine.
tenex Set tenex file transfer type.
trace Toggle packet tracing.
type Set file transfer type.
user Send new user information.
verbose Toggle verbose mode.
? Print local help information.
The following is a list of possible response codes, which the server generates in response to each command issued from the client:
110 Restart marker reply.
120 Service ready in nnn minutes.
125 Data connection already open; transfer starting.
150 File status okay; about to open data connection.
200 Command okay.
202 Command not implemented, superfluous at this site.
211 System status, or system help reply.
212 Directory status.
213 File status.
214 Help message.
215 NAME system type.
220 Service ready for new user.
221 Service closing control connection.
225 Data connection open; no transfer in progress.
226 Closing data connection.
227 Entering passive mode (h1,h2,h3,h4,p1,p2).
230 User logged in, proceed.
250 Requested file action okay, completed.
257 'PATHNAME' created.
331 Username okay, need password.
332 Need account for login.
350 Requested file action pending further information.
421 Service not available, closing control connection.
425 Can't open data connection.
426 Connection closed; transfer aborted.
450 Requested file action not taken.
451 Requested action aborted: local error in processing.
452 Requested action not taken.
500 Syntax error, command unrecognized.
501 Syntax error in parameters or arguments.
502 Command not implemented.
503 Bad sequence of commands.
504 Command not implemented for that parameter.
530 Not logged in.
532 Need account for storing files.
550 Requested action not taken.
551 Requested action aborted: page type unknown.
552 Requested file action aborted.
553 Requested action not taken.