The Standard ML Basis Library


The NetProtDB structure


Synopsis

signature NET_PROT_DB  (* OPTIONAL *)
structure NetProtDB :> NET_PROT_DB  (* OPTIONAL *)

This structure accesses the information contained in the network protocol data base. The data may be retrieved from a file, such as /etc/protocols on many Unix systems, or via the NIS protocols map.


Interface

type entry
val name : entry -> string
val aliases : entry -> string list
val protocol : entry -> int
val getByName : string -> entry option
val getByNumber : int -> entry option

Description

type entry
The type of a network protocol data base entry.

name en
returns the official name of the protocol described by entry en (e.g., "ip").

aliases en
returns the alias list of the protocol described by entry en.

protocol en
returns the protocol number of the protocol described by entry en.

getByName s
reads the network protocol data base for a protocol with name s. If successful, it returns SOME(en) where en is the corresponding data base entry; otherwise, it returns NONE.

getByNumber i
reads the network protocol data base for a protocol with protocol number i. If successful, it returns SOME(en) where en is the corresponding data base entry; otherwise, it returns NONE.

See Also

NetHostDB

[ Top | Parent | Contents | Index | Root ]

Generated October 02, 2003
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 © 2003 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).