Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 3: Networking Library Functions Oracle Solaris 11 Express 11/10 |
DNSServiceConstructFullName(3DNS_SD)
DNSServiceCreateConnection(3DNS_SD)
DNSServiceEnumerateDomains(3DNS_SD)
DNSServiceProcessResult(3DNS_SD)
DNSServiceQueryRecord(3DNS_SD)
DNSServiceReconfirmRecord(3DNS_SD)
DNSServiceRefDeallocate(3DNS_SD)
DNSServiceRegisterRecord(3DNS_SD)
DNSServiceRemoveRecord(3DNS_SD)
DNSServiceUpdateRecord(3DNS_SD)
gss_create_empty_oid_set(3GSS)
gss_inquire_cred_by_mech(3GSS)
gss_inquire_mechs_for_name(3GSS)
gss_inquire_names_for_mech(3GSS)
gss_process_context_token(3GSS)
ldap_enable_translation(3LDAP)
ldap_get_entry_controls(3LDAP)
ldap_get_lang_values_len(3LDAP)
ldap_init_getfilter_buf(3LDAP)
ldap_init_searchprefs_buf(3LDAP)
ldap_init_templates_buf(3LDAP)
ldap_parse_extended_result(3LDAP)
ldap_parse_sasl_bind_result(3LDAP)
ldap_sasl_interactive_bind_s(3LDAP)
ldap_set_string_translators(3LDAP)
ldap_translate_from_t61(3LDAP)
rpc_gss_get_principal_name(3NSL)
rpc_gss_svc_max_data_length(3NSL)
sasl_auxprop_add_plugin(3SASL)
sasl_canonuser_add_plugin(3SASL)
sasl_client_plug_init_t(3SASL)
sasl_server_plug_init_t(3SASL)
sasl_server_userdb_checkpass_t(3SASL)
sasl_server_userdb_setpass_t(3SASL)
sdp_add_connection(3COMMPUTIL)
sdp_add_information(3COMMPUTIL)
sdp_delete_all_field(3COMMPUTIL)
sdp_delete_all_media_field(3COMMPUTIL)
sdp_delete_attribute(3COMMPUTIL)
sdp_find_attribute(3COMMPUTIL)
sdp_find_media_rtpmap(3COMMPUTIL)
sdp_session_to_str(3COMMPUTIL)
sip_create_dialog_req_nocontact(3SIP)
sip_delete_header_by_name(3SIP)
sip_disable_dialog_logging(3SIP)
sip_disable_trans_logging(3SIP)
sip_enable_dialog_logging(3SIP)
sip_enable_trans_logging(3SIP)
sip_get_contact_display_name(3SIP)
sip_get_content_sub_type(3SIP)
sip_get_dialog_local_contact_uri(3SIP)
sip_get_dialog_local_cseq(3SIP)
sip_get_dialog_local_tag(3SIP)
sip_get_dialog_local_uri(3SIP)
sip_get_dialog_remote_cseq(3SIP)
sip_get_dialog_remote_tag(3SIP)
sip_get_dialog_remote_target_uri(3SIP)
sip_get_dialog_remote_uri(3SIP)
sip_get_dialog_route_set(3SIP)
sip_get_from_display_name(3SIP)
sip_get_passertedid_display_name(3SIP)
sip_get_passertedid_uri_str(3SIP)
sip_get_ppreferredid_display_name(3SIP)
sip_get_ppreferredid_uri_str(3SIP)
sip_get_proxy_authen_param(3SIP)
sip_get_proxy_authen_scheme(3SIP)
sip_get_proxy_author_param(3SIP)
sip_get_proxy_author_scheme(3SIP)
sip_get_replyto_display_name(3SIP)
sip_get_retry_after_cmts(3SIP)
sip_get_retry_after_time(3SIP)
sip_get_route_display_name(3SIP)
sip_get_via_sent_by_host(3SIP)
sip_get_via_sent_by_port(3SIP)
sip_get_via_sent_protocol_name(3SIP)
sip_get_via_sent_protocol_version(3SIP)
sip_get_via_sent_transport(3SIP)
sip_get_www_authen_param(3SIP)
sip_get_www_authen_scheme(3SIP)
sip_unregister_all_sent_by(3SIP)
- routines for returning a stream to a remote command
cc [ flag ... ] file... -lsocket -lnsl [ library... ] #include <netdb.h> #include <unistd.h> int rcmd(char **ahost, unsigned short inport, const char *luser, const char *ruser, const char *cmd, int *fd2p);
int rcmd_af(char **ahost, unsigned short inport, const char *luser, const char *ruser, const char *cmd, int *fd2p, int af);
int rresvport(int *port);
int rresvport_af(int *port, int af);
int ruserok(const char *rhost, int suser, const char *ruser, const char *luser);
The rcmd() function is used by the superuser to execute a command on a remote machine with an authentication scheme based on reserved port numbers. An AF_INET socket is returned with rcmd(). The rcmd_af() function supports AF_INET, AF_INET6 or AF_UNSPEC for the address family. An application can choose which type of socket is returned by passing AF_INET or AF_INET6 as the address family. The use of AF_UNSPEC means that the caller will accept any address family. Choosing AF_UNSPEC provides a socket that best suits the connectivity to the remote host.
The rresvport() function returns a descriptor to a socket with an address in the privileged port space. The rresvport_af() function is the equivalent to rresvport(), except that you can choose AF_INET or AF_INET6 as the socket address family to be returned by rresvport_af(). AF_UNSPEC does not apply to the rresvport() function.
The ruserok() function is a routine used by servers to authenticate clients that request as service with rcmd.
All of these functions are present in the same file and are used by the in.rshd(1M) server among others.
The rcmd() and rcmd_af() functions look up the host *ahost using getaddrinfo(3SOCKET) and return -1 if the host does not exist. Otherwise, *ahost is set to the standard name of the host and a connection is established to a server residing at the Internet port inport.
If the connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the caller. The socket is given to the remote command as standard input (file descriptor 0) and standard output (file descriptor 1). If fd2p is non-zero, an auxiliary channel to a control process is set up and a descriptor for it is placed in *fd2p. The control process returns diagnostic output file (descriptor 2) from the command on the auxiliary channel. The control process also accepts bytes on this channel as signal numbers to be forwarded to the process group of the command. If fd2p is 0, the standard error (file descriptor 2) of the remote command is made the same as its standard output. No provision is made for sending arbitrary signals to the remote process, other than possibly sending out-of-band data.
The protocol is described in detail in in.rshd(1M).
The rresvport() and rresvport_af() functions are used to obtain a socket bound to a privileged port number. The socket is suitable for use by rcmd() and rresvport_af() and several other routines. Privileged Internet ports are those in the range 1 to 1023. Only the superuser is allowed to bind a socket to a privileged port number. The application must pass in port, which must be in the range 512 to 1023. The system first tries to bind to that port number. If it fails, the system then tries to bind to another unused privileged port, if one is available.
The ruserok() function takes a remote host name returned by the gethostbyaddr() function with two user names and a flag to indicate whether the local user's name is that of the superuser. See gethostbyname(3NSL). The ruserok() function then checks the files /etc/hosts.equiv and possibly .rhosts in the local user's home directory to see if the request for service is allowed. A 0 value is returned if the machine name is listed in the /etc/hosts.equiv file, or if the host and remote user name are found in the .rhosts file. Otherwise, the ruserok() function returns -1. If the superuser flag is 1, the /etc/hosts.equiv is not checked.
The error code EAGAIN is overloaded to mean “All network ports in use.”
The rcmd() and rcmd_af() functions return a valid socket descriptor upon success. The functions returns -1 upon error and print a diagnostic message to standard error.
The rresvport() and rresvport_af() functions return a valid, bound socket descriptor upon success. The functions return -1 upon error with the global value errno set according to the reason for failure.
system trusted hosts and users
user's trusted hosts and users
See attributes(5) for descriptions of the following attributes:
|
This interface is Unsafe in multithreaded applications. Unsafe interfaces should be called only from the main thread.
rlogin(1), rsh(1), in.rexecd(1M), in.rshd(1M), Intro(2), getaddrinfo(3SOCKET), gethostbyname(3NSL), rexec(3SOCKET), attributes(5)