NetServDB
structure
signature NET_SERV_DB
(* OPTIONAL *)
structure NetServDB
:> NET_SERV_DB (* OPTIONAL *)
This structure accesses the information contained in the network services data base. This data may be retrieved from the file /etc/services
on many Unix systems, or from some other data base.
type entry
val name : entry -> string
val aliases : entry -> string list
val port : entry -> int
val protocol : entry -> string
val getByName : string * string option -> entry option
val getByPort : int * string option -> entry option
type entry
name ent
"ftp"
, "telnet"
, etc.).
aliases ent
port ent
protocol ent
"tcp"
or "udp"
).
getByName (s, prot)
SOME
(protname)
, the protocol of the service must also match protname
; if prot is NONE
, no protocol restriction is imposed. If successful, it returns SOME
(en)
where en
is the corresponding data base entry; otherwise, it returns NONE
.
getByPort (i, prot)
SOME
(protname)
, the protocol of the service must also match protname
; if prot is NONE
, no protocol restriction is imposed. If successful, it returns SOME
(en)
where en
the corresponding data base entry; otherwise, it returns NONE
.
Socket
,NetHostDB
,NetProtDB
Generated April 12, 2004
Last Modified June 5, 1998
Comments to John Reppy.
This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy.
Copyright © 2004 AT&T and Lucent Technologies. All rights reserved.
Permission is granted for internet users to make one paper copy for their
own personal use. Further hardcopy reproduction is strictly prohibited.
Permission to distribute the HTML document electronically on any medium
other than the internet must be requested from the copyright holders by
contacting the editors.
Printed versions of the SML Basis Manual are available from Cambridge
University Press.
To order, please visit
www.cup.org (North America) or
www.cup.cam.ac.uk (outside North America). |