The NetHostDB 구조
The NetHostDB 구조
이 구조는 넷(네트워크) 호스트 이름과 주소에 대한 데이터베이스를 조회하는 연산을 제공해요.
출처: 문서
본문
시놉시스 (Synopsis)
signature NET_HOST_DB (* OPTIONAL *)
structure NetHostDB :> NET_HOST_DB (* OPTIONAL *)
인터페이스 (Interface)
eqtype in_addr
eqtype addr_family
type entry
val name : entry -> string
val aliases : entry -> string list
val addrType : entry -> addr_family
val addr : entry -> in_addr
val addrs : entry -> in_addr list
val getByName : string -> entry option
val getByAddr : in_addr -> entry option
val getHostName : unit -> string
val toString : in_addr -> string
val scan : (char, 'a) StringCvt.reader
-> (in_addr, 'a) StringCvt.reader
val fromString : string -> in_addr option
설명 (Description)
eqtype in_addr
호스트 데이터베이스의 엔트리 타입이에요. addr는 호스트 주소, name은 호스트의 정식 이름, aliases는 호스트의 별칭 목록이에요.
eqtype addr_family
name을 getHostByName에 전달해 SOME 호스트 엔트리를 얻고, 찾지 못하면 NONE을 돌려줘요.
type entry
IP 주소 (ia)를 getHostByAddr에 전달해 SOME 호스트 엔트리를 얻고, 찾지 못하면 NONE을 돌려줘요.
name en
엔트리 en으로 설명되는 호스트의 정식 이름을 돌려줘요.
aliases en
엔트리 en으로 설명되는 호스트의 별칭 목록을 돌려줘요.
addrType en
엔트리 en으로 설명되는 호스트의 주소 패밀리를 돌려줘요.
addr en
엔트리 en으로 설명되는 호스트의 기본 인터넷 주소를 돌려줘요. addrs가 돌려주는 리스트의 첫 번째 주소예요.
addrs en
엔트리 en으로 설명되는 호스트의 인터넷 주소 리스트를 돌려줘요. 리스트는 비어 있지 않음이 보장돼요.
getByName s
네트워크 호스트 데이터베이스에서 이름이 s인 호스트를 찾아요. 찾으면 해당 데이터베이스 엔트리 en에 대해 SOME(en)을, 그렇지 않으면 NONE을 돌려줘요.
getByAddr ia
네트워크 호스트 데이터베이스에서 인터넷 주소가 ia인 호스트를 찾아요. 찾으면 해당 데이터베이스 엔트리 en에 대해 SOME(en)을, 그렇지 않으면 NONE을 돌려줘요.
val getHostName : unit -> string
현재 프로세서의 표준 호스트 이름이에요.
toString ia
인터넷 주소 ia를 "a.b.c.d" 형태의 문자열 표현으로 돌려줘요.
scan getc strm
fromString s
이 함수들은 문자 소스에서 인터넷 주소를 스캔해요. 첫 번째는 초기 공백을 건너뛴 뒤 문자 스트림 strm의 접두부에서 인터넷 주소를 파싱할 수 있으면 SOME(ia,rest)를 돌려줘요. ia는 결과 주소, rest는 문자 스트림 나머지예요. 그렇지 않으면 NONE을 돌려줘요. 두 번째 형태는 문자열 s의 접두부에서 인터넷 주소 ia를 파싱할 수 있으면 SOME(ia)를 돌려줘요. 그렇지 않으면 NONE을 돌려줘요. StringCvt.scanString scan과 동등해요. 이 표기의 주소는 다음 형태 중 하나예요:
a
여기서 a는 32비트 부호 없는 정수 상수예요.
a.b
여기서 a는 8비트 부호 없는 정수 상수이고, b는 24비트 정수 상수예요.
a.b.c
여기서 a와 b는 8비트 부호 없는 정수 상수이고, c는 16비트 정수 상수예요.
a.b.c.d
여기서 a, b, c, d는 8비트 정수 상수예요. 정수 상수들은 C 언어에서와 같이 십진, 8진, 16진일 수 있어요.## 더 알아보기 (Learn more)
- [ Top | Parent | Contents | Index | Root ] 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).