Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ns_ntoa(3n) [bsd man page]

NS(3N)																	    NS(3N)

NAME
ns_addr, ns_ntoa - Xerox NS(tm) address conversion routines SYNOPSIS
#include <sys/types.h> #include <netns/ns.h> struct ns_addr ns_addr(cp) char *cp; char *ns_ntoa(ns) struct ns_addr ns; DESCRIPTION
The routine ns_addr interprets character strings representing XNS addresses, returning binary information suitable for use in system calls. ns_ntoa takes XNS addresses and returns ASCII strings representing the address in a notation in common use in the Xerox Development Envi- ronment: <network number>.<host number>.<port number> Trailing zero fields are suppressed, and each number is printed in hexadecimal, in a format suitable for input to ns_addr. Any fields lacking super-decimal digits will have a trailing ``H'' appended. Unfortunately, no universal standard exists for representing XNS addresses. An effort has been made to insure that ns_addr be compatible with most formats in common use. It will first separate an address into 1 to 3 fields using a single delimiter chosen from period (``.''), colon (``:'') or pound-sign (``#''). Each field is then examined for byte separators (colon or period). If there are byte separators, each subfield separated is taken to be a small hexadecimal number, and the entirety is taken as a network-byte-ordered quantity to be zero extended in the high-network-order bytes. Next, the field is inspected for hyphens, in which case the field is assumed to be a number in decimal notation with hyphens separating the millenia. Next, the field is assumed to be a number: It is interpreted as hexadecimal if there is a leading ``0x'' (as in C), a trailing ``H'' (as in Mesa), or there are any super-decimal digits present. It is interpreted as octal is there is a leading ``0'' and there are no super-octal digits. Otherwise, it is converted as a decimal number. SEE ALSO
hosts(5), networks(5), DIAGNOSTICS
None (see BUGS). BUGS
The string returned by ns_ntoa resides in a static memory area. ns_addr should diagnose improperly formed input, and there should be an unambiguous way to recognize this. 4.3 Berkeley Distribution May 12, 1986 NS(3N)

Check Out this Related Man Page

NS(4F)																	    NS(4F)

NAME
ns - Xerox Network Systems(tm) protocol family SYNOPSIS
Not currently supported under 2.11BSD DESCRIPTION
The NS protocol family is a collection of protocols layered atop the Internet Datagram Protocol (IDP) transport layer, and using the Xerox NS address formats. The NS family provides protocol support for the SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, and SOCK_RAW socket types; the SOCK_RAW interface is a debugging tool, allowing you to trace all packets entering, (or with toggling kernel variable, additionally leaving) the local host. ADDRESSING
NS addresses are 12 byte quantities, consisting of a 4 byte Network number, a 6 byte Host number and a 2 byte port number, all stored in network standard format. (on the VAX these are word and byte reversed; on the Sun they are not reversed). The include file <netns/ns.h> defines the NS address as a structure containing unions (for quicker comparisons). Sockets in the Internet protocol family use the following addressing structure: struct sockaddr_ns { short sns_family; struct ns_addr sns_addr; char sns_zero[2]; }; where an ns_addr is composed as follows: union ns_host { u_char c_host[6]; u_short s_host[3]; }; union ns_net { u_char c_net[4]; u_short s_net[2]; }; struct ns_addr { union ns_net x_net; union ns_host x_host; u_short x_port; }; Sockets may be created with an address of all zeroes to effect ``wildcard'' matching on incoming messages. The local port address speci- fied in a bind(2) call is restricted to be greater than NSPORT_RESERVED (=3000, in <netns/ns.h>) unless the creating process is running as the super-user, providing a space of protected port numbers. PROTOCOLS
The NS protocol family supported by the operating system is comprised of the Internet Datagram Protocol (IDP) idp(4P), Error Protocol (available through IDP), and Sequenced Packet Protocol (SPP) spp(4P). SPP is used to support the SOCK_STREAM and SOCK_SEQPACKET abstraction, while IDP is used to support the SOCK_DGRAM abstraction. The Error protocol is responded to by the kernel to handle and report errors in protocol processing; it is, however, only accessible to user programs through heroic actions. SEE ALSO
intro(3), byteorder(3N), gethostbyname(3N), getnetent(3N), getprotoent(3N), getservent(3N), ns(3N), intro(4N), spp(4P), idp(4P), nsip(4) Internet Transport Protocols, Xerox Corporation document XSIS-028112 An Advanced 4.3BSD Interprocess Communication Tutorial 3rd Berkeley Distribution January 27, 1996 NS(4F)
Man Page

Featured Tech Videos