Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/net move pitfall example to downwards. wording fix...



details:   https://anonhg.NetBSD.org/src/rev/105c80d87c9b
branches:  trunk
changeset: 495259:105c80d87c9b
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Jul 25 04:39:54 2000 +0000

description:
move pitfall example to downwards.  wording fixes.  sync with kame.

diffstat:

 lib/libc/net/getaddrinfo.3 |  132 +++++++++++++++++++++-----------------------
 1 files changed, 63 insertions(+), 69 deletions(-)

diffs (153 lines):

diff -r 8fd9f4413ba5 -r 105c80d87c9b lib/libc/net/getaddrinfo.3
--- a/lib/libc/net/getaddrinfo.3        Tue Jul 25 04:26:12 2000 +0000
+++ b/lib/libc/net/getaddrinfo.3        Tue Jul 25 04:39:54 2000 +0000
@@ -1,5 +1,5 @@
-.\"    $NetBSD: getaddrinfo.3,v 1.13 2000/07/25 02:33:30 itojun Exp $
-.\"    $KAME: getaddrinfo.3,v 1.19 2000/07/25 02:27:44 itojun Exp $
+.\"    $NetBSD: getaddrinfo.3,v 1.14 2000/07/25 04:39:54 itojun Exp $
+.\"    $KAME: getaddrinfo.3,v 1.20 2000/07/25 04:36:52 itojun Exp $
 .\"
 .\" Copyright (c) 1983, 1987, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -169,73 +169,6 @@
 set to
 .Dv PF_UNSPEC .
 .Pp
-Though the
-.Fa hints
-argument allows you to leave
-.Fa ai_socktype
-or
-.Fa ai_protocol
-unspecified
-.Pq by setting those members to zero ,
-the arguments must sufficiently be consistent and unambiguous.
-Here are pitfall cases you may encounter:
-.Bl -bullet
-.It
-.Fn getaddrinfo
-will raise error if members in 
-.Fa hints
-structure is not consistent.
-For example, for internet address families,
-.Fn getaddrinfo
-will raise error if you specify
-.Dv SOCK_STREAM
-to
-.Fa ai_socktype
-while you specify
-.Dv IPPROTO_UDP
-to
-.Fa ai_protocol .
-.It
-If you specify a
-.Fa servname
-which is defined only for certain
-.Fa ai_socktype ,
-.Fn getaddrinfo
-will raise error because the arguments are not consistent.
-For example,
-.Fn getaddrinfo
-will raise error if you ask for
-.Dq Li tftp
-service on
-.Dv SOCK_STREAM .
-.It
-For internet address families, if you specify
-.Fa servname
-while you set
-.Fa ai_socktype
-to
-.Dv SOCK_RAW ,
-.Fa getaddrinfo
-will raise error, because service names are not defined for the internet
-.Dv SOCK_RAW
-space.
-.It
-If you specify numeric
-.Fa servname ,
-while leaving
-.Fa ai_socktype
-and
-.Fa ai_protocol
-unspecified,
-.Fn getaddrinfo
-will raise error.
-This is because the numeric
-.Fa servname
-does not identify any socket type, and
-.Fn getaddrinfo
-is not allowed to glob the argument in such case.
-.El
-.Pp
 Upon successful return a pointer to a linked list of one or more
 .Li addrinfo
 structures is returned through the final argument.
@@ -338,6 +271,67 @@
 This flag prevents any type of name resolution service (e.g., the DNS)
 from being called.
 .Pp
+The arguments to
+.Fn getaddrinfo
+must sufficiently be consistent and unambiguous.
+Here are pitfall cases you may encounter:
+.Bl -bullet
+.It
+.Fn getaddrinfo
+will raise error if members in 
+.Fa hints
+structure is not consistent.
+For example, for internet address families,
+.Fn getaddrinfo
+will raise error if you specify
+.Dv SOCK_STREAM
+to
+.Fa ai_socktype
+while you specify
+.Dv IPPROTO_UDP
+to
+.Fa ai_protocol .
+.It
+If you specify a
+.Fa servname
+which is defined only for certain
+.Fa ai_socktype ,
+.Fn getaddrinfo
+will raise error because the arguments are not consistent.
+For example,
+.Fn getaddrinfo
+will raise error if you ask for
+.Dq Li tftp
+service on
+.Dv SOCK_STREAM .
+.It
+For internet address families, if you specify
+.Fa servname
+while you set
+.Fa ai_socktype
+to
+.Dv SOCK_RAW ,
+.Fa getaddrinfo
+will raise error, because service names are not defined for the internet
+.Dv SOCK_RAW
+space.
+.It
+If you specify numeric
+.Fa servname ,
+while leaving
+.Fa ai_socktype
+and
+.Fa ai_protocol
+unspecified,
+.Fn getaddrinfo
+will raise error.
+This is because the numeric
+.Fa servname
+does not identify any socket type, and
+.Fn getaddrinfo
+is not allowed to glob the argument in such case.
+.El
+.Pp
 All of the information returned by
 .Fn getaddrinfo
 is dynamically allocated:



Home | Main Index | Thread Index | Old Index