Skip Navigation Links | |
Exit Print View | |
man pages section 3: Networking Library Functions Oracle Solaris 11.1 Information Library |
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)
- generic transport name-to-address translation
cc [ flag... ] file... -lnsl [ library...] #include <netdir.h> int netdir_getbyname(struct netconfig *config, struct nd_hostserv *service, struct nd_addrlist **addrs);
int netdir_getbyaddr(struct netconfig *config, struct nd_hostservlist **service, struct netbuf *netaddr);
void netdir_free(void *ptr, int struct_type);
int netdir_options(struct netconfig *config, int option, int fildes, char *point_to_args);
char *taddr2uaddr(struct netconfig *config, struct netbuf *addr);
struct netbuf *uaddr2taddr(struct netconfig *config, char *uaddr);
void netdir_perror(char *s);
char *netdir_sperror(void);
The netdir functions provide a generic interface for name-to-address mapping that will work with all transport protocols. This interface provides a generic way for programs to convert transport specific addresses into common structures and back again. The netconfig structure, described on the netconfig(4) manual page, identifies the transport.
The netdir_getbyname() function maps the machine name and service name in the nd_hostserv structure to a collection of addresses of the type understood by the transport identified in the netconfig structure. This function returns all addresses that are valid for that transport in the nd_addrlist structure. The nd_hostserv structure contains the following members:
char *h_host; /* host name */ char *h_serv; /* service name */
The nd_addrlist structure contains the following members:
int n_cnt; /* number of addresses */ struct netbuf *n_addrs;
The netdir_getbyname() function accepts some special-case host names. The host names are defined in <netdir.h>. The currently defined host names are:
Represents the address to which local programs will bind their endpoints. HOST_SELF differs from the host name provided by gethostname(3C), which represents the address to which remote programs will bind their endpoints.
Represents any host accessible by this transport provider. HOST_ANY allows applications to specify a required service without specifying a particular host name.
Represents the host address that can be used to connect to the local host.
Represents the address for all hosts accessible by this transport provider. Network requests to this address are received by all machines.
All fields of the nd_hostserv structure must be initialized.
To find the address of a given host and service on all available transports, call the netdir_getbyname() function with each struct netconfig structure returned by getnetconfig(3NSL).
The netdir_getbyaddr() function maps addresses specified in the netbuf structure pointed to by netaddr to service names. The function returns service, a list of host and service pairs that yield these addresses. If more than one tuple of host and service name is returned, the first tuple contains the preferred host and service names:
struct nd_hostservlist { int *h_cnt; /* number of hostservs found */ struct hostserv *h_hostservs; }
The netdir_free() structure is used to free the structures allocated by the name to address translation functions. The ptr parameter points to the structure that has to be freed. The parameter struct_type identifies the structure:
struct netbuf ND_ADDR struct nd_addrlist ND_ADDRLIST struct hostserv ND_HOSTSERV struct nd_hostservlist ND_HOSTSERVLIST
The free() function is used to free the universal address returned by the taddr2uaddr() function.
The netdir_options() function is used to do all transport-specific setups and option management. fildes is the associated file descriptor. option, fildes, and pointer_to_args are passed to the netdir_options() function for the transport specified in config. Currently four values are defined for option:
|
The taddr2uaddr() and uaddr2taddr() functions support translation between universal addresses and TLI type netbufs. The taddr2uaddr() function takes a struct netbuf data structure and returns a pointer to a string that contains the universal address. It returns NULL if the conversion is not possible. This is not a fatal condition as some transports do not support a universal address form.
The uaddr2taddr() function is the reverse of the taddr2uaddr() function. It returns the struct netbuf data structure for the given universal address.
If a transport provider does not support an option, netdir_options returns -1 and the error message can be printed through netdir_perror() or netdir_sperror().
The specific actions of each option follow.
Sets the transport provider up to allow broadcast if the transport supports broadcast. fildes is a file descriptor into the transport, that is, the result of a t_open of /dev/udp. pointer_to_args is not used. If this completes, broadcast operations can be performed on file descriptor fildes.
Allows the application to bind to a reserved port if that concept exists for the transport provider. fildes is an unbound file descriptor into the transport. If pointer_to_args is NULL, fildes is bound to a reserved port. If pointer_to_args is a pointer to a netbuf structure, an attempt is made to bind to any reserved port on the specified address.
Used to verify that the address corresponds to a reserved port if that concept exists for the transport provider. fildes is not used. pointer_to_args is a pointer to a netbuf structure that contains the address. This option returns 0 only if the address specified in pointer_to_args is reserved.
Used to take a ``local address'' such as a 0.0.0.0 TCP address and return a ``real address'' to which client machines can connect. fildes is not used. pointer_to_args is a pointer to a struct nd_mergearg which has the following members:
char s_uaddr; /* server's universal address */ char c_uaddr; /* client's universal address */ char m_uaddr; /* the result */
If s_uaddr is an address such as 0.0.0.0.1.12, and the call is successful m_uaddr is set to an address such as 192.11.109.89.1.12. For most transports, m_uaddr is identical to s_uaddr.
The netdir_perror() function prints an error message in standard output that states the cause of a name-to-address mapping failure. The error message is preceded by the string given as an argument.
The netdir_sperror() function returns a string with an error message that states the cause of a name-to-address mapping failure.
The netdir_sperror() function returns a pointer to a buffer which contains the error message string. The buffer is overwritten on each call. In multithreaded applications, thise buffer is implemented as thread-specific data.
The netdir_getbyaddr() function returns 0 on success and a non-zero value on failure.
See attributes(5) for descriptions of the following attributes:
|
gethostname(3C), getnetconfig(3NSL), getnetpath(3NSL), netconfig(4), attributes(5)