Charles.Forsyth20060303-partialeea662d19 years agoHistory
66 lines · 1.5 KB · Text
RawDownload
.TH SRV 2.SH NAMEsrv \- network name and address translation when hosted.SH SYNOPSIS.EXinclude "srv.m"srv := load Srv Srv->PATH;Srv: module{  init:  fn();  iph2a: fn(host: string): list of string;  ipa2h: fn(addr: string): list of string;  ipn2p: fn(protocol, service: string): string;};.EE.SH DESCRIPTION.B Srvprovides access to the host operating system'sname and address translation when Inferno is running hosted.The module's implementation is usually built-in to.IR emu (1),and then only on some platforms.It uses the Internet name resolution services of the host operating system(eg,.B gethostbynameon Unix systems).Its services are normally only used internally by.IR cs (8)and.IR dns (8),and even they give priority to data in.IR services (6)and.IR dns (6)if available.Other Inferno applications normally give network addresses to the functions of.IR sys-dial (2),and they are then translated automatically, using the services of.IR cs (8)..PP.B Initmust be called before any other function is used..PPGiven a host name,.B iph2areturns a list of its Internet addresses (if any).Given an Internet address,.B ipa2hreturns a list of host names (if any) that have that address.The results are only as accurate as the host system's name service..PP.B Ipn2preturns the port number (as a string) for the given.I servicewhen accessed using a particular protocol.I protocol(typically.B tcpor.BR udp )..SH SOURCE.B /emu/port/srv.c.SH SEE ALSO.IR sys-file2chan (2),.IR cs (8),.IR dns (8)