42 lines · 1.5 KB · Text
RawDownload
= srv: network name and address translation when hosted     include "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;    }; Srv  provides  access to the host operating system's name andaddress translation when Inferno is running hosted.  The mod‐ule's  implementation is usually built-in to emu(1), and thenonly on some platforms.  It uses the Internet name resolutionservices  of  the host operating system (eg, gethostbyname onUnix systems).  Its services are normally  only  used  inter‐nally  by  cs(8)  and  dns(8), and even they give priority todata in services(6) and dns(6) if available.   Other  Infernoapplications normally give network addresses to the functionsof dial(2), and they are then translated automatically, usingthe services of cs(8). Init must be called before any other function is used. Given  a  host  name,  iph2a  returns  a list of its Internetaddresses (if any).  Given an Internet address, ipa2h returnsa  list  of  host names (if any) that have that address.  Theresults are only as accurate as the host system's  name  ser‐vice. Ipn2p  returns  the  port  number (as a string) for the givenservice when accessed using a  particular  protocol  protocol(typically tcp or udp). == source/emu/port/srv.c == see ALSOsys-file2chan(2), cs(8), dns(8) 

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t