NAME

  tst_rexec_af - Return stream to a remote command


PURPOSE

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


SYNOPSIS

  ./tst_rexec_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.3.  rexec_af
    The existing rexec() 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 rexec().  Thus a new function is needed.
      int rexec_af(char **ahost, unsigned short rport, const char *name,
                   const char *pass, const char *cmd, int *fd2p, int af)
    This function behaves the same as the existing rexec() 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.