📄 remlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/remLib.html - generated by refgen from remLib.c --> <title> remLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>remLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>remLib</strong> - remote command library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./remLib.html#rcmd">rcmd</a>( )</b> - execute a shell command on a remote machine<br><b><a href="./remLib.html#rresvport">rresvport</a>( )</b> - open a socket with a privileged port bound to it<br><b><a href="./remLib.html#remCurIdGet">remCurIdGet</a>( )</b> - get the current user name and password<br><b><a href="./remLib.html#remCurIdSet">remCurIdSet</a>( )</b> - set the remote user name and password<br><b><a href="./remLib.html#iam">iam</a>( )</b> - set the remote user name and password<br><b><a href="./remLib.html#whoami">whoami</a>( )</b> - display the current remote identity<br><b><a href="./remLib.html#bindresvport">bindresvport</a>( )</b> - bind a socket to a privileged IP port<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides routines that support remote command functions. The <b><a href="./remLib.html#rcmd">rcmd</a>( )</b> and <b><a href="./remLib.html#rresvport">rresvport</a>( )</b> routines use protocols implemented in BSD 4.3; they support remote command execution, and the opening of a socket with a bound privileged port, respectively. For more information, see <i>Unix Network Programming</i> by W. Richard Stevens. This library also includes routines that authorize network file access via <b><a href="./netDrv.html#top">netDrv</a></b>.<p>To include <b><a href="./remLib.html#top">remLib</a></b> in a VxWorks image, include the <b>NETWRS_REMLIB</b> configuration component. This component contains one parameter, <b>RSH_STDERR_SETUP_TIMEOUT</b>. Use this parameter to specify how long an <b><a href="./remLib.html#rcmd">rcmd</a>( )</b> call should wait for a return from its internal call to <b><a href="./selectLib.html#select">select</a>( )</b>. Valid values for <b>RSH_STDERR_SETUP_TIMEOUT</b> are 0 (<b>NO_WAIT</b>), -1 (<b>WAIT_FOREVER</b>), or a positive integer from 1 to 2147483647 inclusive. This positive integer specifies the wait in seconds. The default value for <b>RSH_STDERR_SETUP_TIMEOUT</b> is -1 (<b>WAIT_FOREVER</b>).<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>remLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./inetLib.html#top">inetLib</a></b><hr><a name="rcmd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rcmd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rcmd( )</strong> - execute a shell command on a remote machine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int rcmd ( char * host, /* host name or inet address */ int remotePort, /* remote port to connect to (rshd) */ char * localUser, /* local user name */ char * remoteUser, /* remote user name */ char * cmd, /* command */ int * fd2p /* if this pointer is non-zero, stderr */ /* socket is opened and socket descriptor is */ /* filled in */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine uses a remote shell daemon, <b>rshd</b>, to execute a command on a remote system. It is analogous to the BSD <b><a href="./remLib.html#rcmd">rcmd</a>( )</b> routine.<p>Internally, this <b><a href="./remLib.html#rcmd">rcmd</a>( )</b> implementation uses a <b><a href="./selectLib.html#select">select</a>( )</b> call to wait for a response from the <b>rshd</b> daemon. If <b><a href="./remLib.html#rcmd">rcmd</a>( )</b> receives a response within its timeout, <b><a href="./remLib.html#rcmd">rcmd</a>( )</b> calls <b><a href="./sockLib.html#accept">accept</a>( )</b> and completes by returning a socket descriptor for the data generated on the remote machine.<p>The default timeout lets the <b><a href="./remLib.html#rcmd">rcmd</a>( )</b> call wait forever. However, you can change the timeout value using the <b>RSH_STDERR_SETUP_TIMEOUT</b> parameter associated with the <b>NETWRS_REMLIB</b> configuration component.<p></blockquote><h4>RETURNS</h4><blockquote><p>A socket descriptor if the remote shell daemon accepts, orERROR if the remote command fails.<p><b>S_remLib_RSH_ERROR</b>, <b>S_remLib_RSH_STDERR_SETUP_FAILED</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./remLib.html#top">remLib</a></b>, BSD reference entry for <b><a href="./remLib.html#rcmd">rcmd</a>( )</b><hr><a name="rresvport"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rresvport( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rresvport( )</strong> - open a socket with a privileged port bound to it</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int rresvport ( int * alport /* port number to initially try */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine opens a socket with a privileged port bound to it.It is analogous to the UNIX routine <b><a href="./remLib.html#rresvport">rresvport</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>A socket descriptor, or ERROR if either the socket cannot be opened or allports are in use.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./remLib.html#top">remLib</a></b>, UNIX BSD 4.3 manual entry for <b><a href="./remLib.html#rresvport">rresvport</a>( )</b><hr><a name="remCurIdGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>remCurIdGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>remCurIdGet( )</strong> - get the current user name and password</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void remCurIdGet ( char * user, /* where to return current user name */ char * passwd /* where to return current password */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the user name and password currently used for remote host access privileges and copies them to <i>user</i> and <i>passwd</i>. Eitherparameter can be initialized to NULL, and the corresponding item will notbe passed.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./remLib.html#top">remLib</a></b>, <b><a href="./remLib.html#iam">iam</a>( )</b>, <b><a href="./remLib.html#whoami">whoami</a>( )</b><hr><a name="remCurIdSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>remCurIdSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>remCurIdSet( )</strong> - set the remote user name and password</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS remCurIdSet ( char * newUser, /* user name to use on remote */ char * newPasswd /* password to use on remote (NULL = none) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine specifies the user name that will have access privilegeson the remote machine. The user name must exist in the remotemachine's <b>/etc/passwd</b>, and if it has been assigned a password,the password must be specified in <i>newPasswd</i>.<p>Either parameter can be NULL, and the corresponding item will not be set.<p>The maximum length of the user name and the password is <b>MAX_IDENTITY_LEN</b>(defined in <b>remLib.h</b>).<p></blockquote><h4>NOTE</h4><blockquote><p>A more convenient version of this routine is <b><a href="./remLib.html#iam">iam</a>( )</b>, which is intendedto be used from the shell.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the name or password is too long.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./remLib.html#top">remLib</a></b>, <b><a href="./remLib.html#iam">iam</a>( )</b>, <b><a href="./remLib.html#whoami">whoami</a>( )</b><hr><a name="iam"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iam( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iam( )</strong> - set the remote user name and password</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS iam ( char * newUser, /* user name to use on remote */ char * newPasswd /* password to use on remote (NULL = none) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine specifies the user name that will have access privilegeson the remote machine. The user name must exist in the remotemachine's <b>/etc/passwd</b>, and if it has been assigned a password,the password must be specified in <i>newPasswd</i>.<p>Either parameter can be NULL, and the corresponding item will not be set.<p>The maximum length of the user name and the password is <b>MAX_IDENTITY_LEN</b>(defined in <b>remLib.h</b>).<p></blockquote><h4>NOTE</h4><blockquote><p>This routine is a more convenient version of <b><a href="./remLib.html#remCurIdSet">remCurIdSet</a>( )</b> and isintended to be used from the shell.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the call fails.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./remLib.html#top">remLib</a></b>, <b><a href="./remLib.html#whoami">whoami</a>( )</b>, <b><a href="./remLib.html#remCurIdGet">remCurIdGet</a>( )</b>, <b><a href="./remLib.html#remCurIdSet">remCurIdSet</a>( )</b><hr><a name="whoami"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>whoami( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>whoami( )</strong> - display the current remote identity</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void whoami (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays the user name currently used for remote machineaccess. The user name is set with <b><a href="./remLib.html#iam">iam</a>( )</b> or <b><a href="./remLib.html#remCurIdSet">remCurIdSet</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./remLib.html#top">remLib</a></b>, <b><a href="./remLib.html#iam">iam</a>( )</b>, <b><a href="./remLib.html#remCurIdGet">remCurIdGet</a>( )</b>, <b><a href="./remLib.html#remCurIdSet">remCurIdSet</a>( )</b><hr><a name="bindresvport"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>bindresvport( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>bindresvport( )</strong> - bind a socket to a privileged IP port</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS bindresvport ( int sd, /* socket to be bound */ struct sockaddr_in * sin /* socket address -- value/result */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine picks a port number between 600 and 1023 that is not beingused by any other programs and binds the socket passed as <i>sd</i> to thatport. Privileged IP ports (numbers between and including 0 and 1023) arereserved for privileged programs.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the address family specified in <i>sin</i> is not supported orthe call fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./remLib.html#top">remLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -