Visit The New, Modern Unix Linux Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #203
Difficulty: Medium
Perl is not an interpreted language.
True or False?
Linux & Unix Commands - Search Man Pages

socket_from_name(3ncs) [ultrix man page]

socket_from_name(3ncs)													    socket_from_name(3ncs)

Name
       socket_from_name - convert a name and port number to a socket address

Syntax
       #include <idl/c/socket.h>

       void socket_$from_name(family, name, nlength, port, sockaddr, slength,				status)
       unsigned long family;
       socket_$string_t name;
       unsigned long nlength;
       unsigned long port;
       socket_$addr_t *sockaddr;
       unsigned long *slength;
       status_$t *status;

Arguments
       family The  integer  representation  of	an  address  family.   Value  can be socket_$internet or socket_$unspec If the family parameter is
	      socket_$unspec, then the name parameter is scanned for a prefix of family: (for example, ip:).

       name   A string in the format family:host[port], where family:, host, and [port] are all optional.  The family is an address  family.   The
	      only  valid  family  is  ip.   If  you specify a family as part of the name parameter, you must specify socket_$unspec in the family
	      parameter.  The host is a host name.  A leading number sign (#) can be used to indicate that  the  host  name  is  in  the  standard
	      numeric  form (for example, #192.9.8.7).	If host is omitted, the local host name is used.  The port is a port number.  If you spec-
	      ify a port as part of the name parameter, the port parameter is ignored.

       nlength
	      The length, in bytes, of name.

       port   A port number.  If you specify a port number in the name parameter, this parameter is ignored.

       sockaddr
	      A socket address.

       slength
	      The length, in bytes, of sockaddr.

       status The completion status. If the completion status returned in is equal to status_$ok , then the routine that supplied it was  success-
	      ful.

Description
       The  routine converts a textual address family, host name, and port number to a socket address.	The address family and the port number can
       be either specified as separate parameters or included in the name parameter.

Files
See Also
       intro(3ncs), socket_family_from_name(3ncs), socket_to_name(3ncs)

															    socket_from_name(3ncs)

Check Out this Related Man Page

socket_equal(3ncs)														socket_equal(3ncs)

Name
       socket_equal - compare two socket addresses

Syntax
       #include <idl/c/socket.h>

       boolean socket_$equal(sockaddr1, s1length, sockaddr2, s2length, flags,			      status)
       socket_$addr_t *sockaddr1;
       unsigned long s1length;
       socket_$addr_t *sockaddr2;
       unsigned long s2length;
       unsigned long flags;
       status_$t *status;

Arguments
       sockaddr1	   A socket address.  The socket address is the structure returned by either or

       s1length 	   The length, in bytes, of sockaddr1.

       sockaddr2	   A socket address.  The socket address is the structure returned by either or

       s2length 	   The length, in bytes, of sockaddr2.

       flags		   The logical OR of values selected from the following:

			   socket_$eq_hostid   Indicates that the host IDs are to be compared.

			   socket_$eq_netaddr  Indicates that the network addresses are to be compared.

			   socket_$eq_port     Indicates that the port numbers are to be compared.

			   socket_$eq_network  Indicates that the network IDs are to be compared.

       status		   The	completion status. If the completion status returned in is equal to status_$ok , then the routine that supplied it
			   was successful.

Description
       The routine compares two socket addresses.  The flags parameter determines which fields of the socket addresses	are  compared.	 The  call
       returns `true' (not zero) if all of the fields compared are equal, `false' (zero) if not.

Examples
       The following routine compares the network and host IDs in the socket addresses sockaddr1 and sockaddr2:
       if (socket_$equal (&sockaddr1, s1length, &sockaddr2, s2length,
	       socket_$eq_network | socket_$eq_hostid, &status))
       printf ("sockaddrs have equal network and host IDs
");

Files
See Also
       intro(3ncs)

																socket_equal(3ncs)

Featured Tech Videos