NAME

  tst_rcmd_af - Execute a command on a remote machine


PURPOSE

  To check that rcmd_af() can be used to execute command on remote
  machine.


SYNOPSIS

  ./tst_rcmd_af [-tooloption ...]
    -tooloption : v6api tool option


TEST PROCEDURE

  1. Execute command on remote system with AF_INET6 addresses
  2. Check A: return stream to a remote command
  3. Execute command on remote system with AF_UNSPEC addresses
  4. Check B: return stream to a remote command
  5. Execute command on remote system with AF_INET addresses
  6. Check C: return stream to a remote command


NOTE

  None


REFERENCE

  RFC 3542
  14.2.  rcmd_af
    The existing rcmd() function can not transparently use AF_INET6
    sockets since an application would not be prepared to handle AF_INET6
    addresses returned by e.g., getpeername() on the file descriptor
    created by rcmd().  Thus a new function is needed.
      int rcmd_af(char **ahost, unsigned short rport,
                  const char *locuser, const char *remuser,
                  const char *cmd, int *fd2p, int af)
    This function behaves the same as the existing rcmd() function, but
    instead of creating an AF_INET TCP socket, it can also create an
    AF_INET6 TCP socket.  The family argument is AF_INET, AF_INET6, or
    AF_UNSPEC.  When either AF_INET or AF_INET6 is specified, this
    function will create a socket of the specified address family.  When
    AF_UNSPEC is specified, it will try all possible address families
    until a connection can be established, and will return the associated
    socket of the connection.  A new error EAFNOSUPPORT will be returned
    if the address family is not supported.