VxWorks Reference Manual : Libraries

remLib

NAME

remLib - remote command library

ROUTINES

rcmd( ) - execute a shell command on a remote machine
rresvport( ) - open a socket with a privileged port bound to it
remCurIdGet( ) - get the current user name and password
remCurIdSet( ) - set the remote user name and password
iam( ) - set the remote user name and password
whoami( ) - display the current remote identity
bindresvport( ) - bind a socket to a privileged IP port

DESCRIPTION

This library provides routines to support remote command functions. The rcmd( ) and rresvport( ) routines use protocols implemented in UNIX BSD 4.3; they support remote command execution, and the opening of a socket with a bound privileged port, respectively. Other routines in this library authorize network file access via netDrv.

INCLUDE FILES

remLib.h

SEE ALSO

remLib, inetLib, VxWorks Programmer's Guide: Network


Libraries : Routines

rcmd( )

NAME

rcmd( ) - execute a shell command on a remote machine

SYNOPSIS

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 */
                       /* and socket descriptor is filled in */
    )

DESCRIPTION

This routine executes a command on a remote machine, using the remote shell daemon, rshd, on the remote system. It is analogous to the UNIX routine rcmd( ).

RETURNS

A socket descriptor if the remote shell daemon accepts, or ERROR if the remote command fails.

SEE ALSO

remLib, UNIX BSD 4.3 manual entry for rcmd( )


Libraries : Routines

rresvport( )

NAME

rresvport( ) - open a socket with a privileged port bound to it

SYNOPSIS

int rresvport
    (
    int * alport /* port number to initially try */
    )

DESCRIPTION

This routine opens a socket with a privileged port bound to it. It is analogous to the UNIX routine rresvport( ).

RETURNS

A socket descriptor, or ERROR if either the socket cannot be opened or all ports are in use.

SEE ALSO

remLib, UNIX BSD 4.3 manual entry for rresvport( )


Libraries : Routines

remCurIdGet( )

NAME

remCurIdGet( ) - get the current user name and password

SYNOPSIS

void remCurIdGet
    (
    char * user,  /* where to return current user name */
    char * passwd /* where to return current password */
    )

DESCRIPTION

This routine gets the user name and password currently used for remote host access privileges and copies them to user and passwd. Either parameter can be initialized to NULL, and the corresponding item will not be passed.

RETURNS

N/A

SEE ALSO

remLib, iam( ), whoami( )


Libraries : Routines

remCurIdSet( )

NAME

remCurIdSet( ) - set the remote user name and password

SYNOPSIS

STATUS remCurIdSet
    (
    char * newUser,  /* user name to use on remote */
    char * newPasswd /* password to use on remote (NULL = none) */
    )

DESCRIPTION

This routine specifies the user name that will have access privileges on the remote machine. The user name must exist in the remote machine's /etc/passwd, and if it has been assigned a password, the password must be specified in newPasswd.

Either parameter can be NULL, and the corresponding item will not be set.

The maximum length of the user name and the password is MAX_IDENTITY_LEN (defined in remLib.h).

NOTE

A more convenient version of this routine is iam( ), which is intended to be used from the shell.

RETURNS

OK, or ERROR if the name or password is too long.

SEE ALSO

remLib, iam( ), whoami( )


Libraries : Routines

iam( )

NAME

iam( ) - set the remote user name and password

SYNOPSIS

STATUS iam
    (
    char * newUser,  /* user name to use on remote */
    char * newPasswd /* password to use on remote (NULL = none) */
    )

DESCRIPTION

This routine specifies the user name that will have access privileges on the remote machine. The user name must exist in the remote machine's /etc/passwd, and if it has been assigned a password, the password must be specified in newPasswd.

Either parameter can be NULL, and the corresponding item will not be set.

The maximum length of the user name and the password is MAX_IDENTITY_LEN (defined in remLib.h).

NOTE

This routine is a more convenient version of remCurIdSet( ) and is intended to be used from the shell.

RETURNS

OK, or ERROR if the call fails.

SEE ALSO

remLib, whoami( ), remCurIdGet( ), remCurIdSet( )


Libraries : Routines

whoami( )

NAME

whoami( ) - display the current remote identity

SYNOPSIS


void whoami (void)

DESCRIPTION

This routine displays the user name currently used for remote machine access. The user name is set with iam( ) or remCurIdSet( ).

RETURNS

N/A

SEE ALSO

remLib, iam( ), remCurIdGet( ), remCurIdSet( )


Libraries : Routines

bindresvport( )

NAME

bindresvport( ) - bind a socket to a privileged IP port

SYNOPSIS

STATUS bindresvport
    (
    int                  sd, /* socket to be bound */
    struct sockaddr_in * sin /* socket address -- value/result */
    )

DESCRIPTION

This routine picks a port number between 600 and 1023 that is not being used by any other programs and binds the socket passed as sd to that port. Privileged IP ports (numbers between and including 0 and 1023) are reserved for privileged programs.

RETURNS

OK, or ERROR if the address family specified in sin is not supported or the call fails.

SEE ALSO

remLib