summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc <>2006-12-09 13:29:54 +0000
committerjmc <>2006-12-09 13:29:54 +0000
commitdc480bda7434b3d570830e85fb6e1b39be1c5ee0 (patch)
tree7d682ad5be553802db95c14614581e20fa00a268
parent4a3ae6fed825c2b6e0f6f3e8985a59c12fced6fa (diff)
downloadopenbsd-dc480bda7434b3d570830e85fb6e1b39be1c5ee0.tar.gz
openbsd-dc480bda7434b3d570830e85fb6e1b39be1c5ee0.tar.bz2
openbsd-dc480bda7434b3d570830e85fb6e1b39be1c5ee0.zip
various tweaks; my apologies to itojun for forgetting to
send him feedback for these
-rw-r--r--src/lib/libc/net/inet6_opt_init.354
1 files changed, 28 insertions, 26 deletions
diff --git a/src/lib/libc/net/inet6_opt_init.3 b/src/lib/libc/net/inet6_opt_init.3
index a97eb0f28b..9fad745923 100644
--- a/src/lib/libc/net/inet6_opt_init.3
+++ b/src/lib/libc/net/inet6_opt_init.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: inet6_opt_init.3,v 1.1 2006/12/09 01:12:28 itojun Exp $ 1.\" $OpenBSD: inet6_opt_init.3,v 1.2 2006/12/09 13:29:54 jmc Exp $
2.\" $KAME: inet6_opt_init.3,v 1.7 2004/12/27 05:08:23 itojun Exp $ 2.\" $KAME: inet6_opt_init.3,v 1.7 2004/12/27 05:08:23 itojun Exp $
3.\" 3.\"
4.\" Copyright (C) 2004 WIDE Project. 4.\" Copyright (C) 2004 WIDE Project.
@@ -63,21 +63,21 @@
63Building and parsing the Hop-by-Hop and Destination options is 63Building and parsing the Hop-by-Hop and Destination options is
64complicated. 64complicated.
65The advanced sockets API defines a set of functions to 65The advanced sockets API defines a set of functions to
66help applications create and manipulate Hop-by-Hope and Destination 66help applications create and manipulate Hop-by-Hop and Destination
67options. 67options.
68.\"This man page describes the functions specified in 68.\"This man page describes the functions specified in
69.\"IETF Draft RFC3542 while the 69.\"IETF Draft RFC 3542 while the
70.\".Xr inet6_options_space 3 70.\".Xr inet6_options_space 3
71.\"man page documents the functions defined in RFC 2292. 71.\"man page documents the functions defined in RFC 2292.
72.\"It is expected 72.\"It is expected
73.\"that this set of functions will supersede those in RFC 2292 but for 73.\"that this set of functions will supersede those in RFC 2292 but for
74.\"the time being both APIs are retained. 74.\"the time being both APIs are retained.
75These functions use the 75These functions use the
76formatting rules specified in Appendix B in RFC2460, i.e., that the 76formatting rules specified in Appendix B in RFC 2460, i.e. that the
77largest field is placed last in the option. 77largest field is placed last in the option.
78The function prototypes 78The function prototypes
79for these functions are all contained in the header file 79for these functions are all contained in the header file
80.Aq netinet/in.h . 80.Aq Pa netinet/in.h .
81.\" 81.\"
82.Ss inet6_opt_init 82.Ss inet6_opt_init
83The 83The
@@ -92,7 +92,8 @@ then the
92.Fn inet6_opt_init 92.Fn inet6_opt_init
93function also initializes the extension header's length field. 93function also initializes the extension header's length field.
94When attempting to initialize an extension buffer passed in the 94When attempting to initialize an extension buffer passed in the
95.Va extbuf argument 95.Va extbuf
96argument,
96.Fa extlen 97.Fa extlen
97must be a positive multiple of 8 or else the function fails and 98must be a positive multiple of 8 or else the function fails and
98returns \-1 to the caller. 99returns \-1 to the caller.
@@ -100,7 +101,7 @@ returns \-1 to the caller.
100.Ss inet6_opt_append 101.Ss inet6_opt_append
101The 102The
102.Fn inet6_opt_append 103.Fn inet6_opt_append
103function can perform to different jobs. 104function can perform different jobs.
104When a valid 105When a valid
105.Fa extbuf 106.Fa extbuf
106argument is supplied it appends an option to the extension buffer and 107argument is supplied it appends an option to the extension buffer and
@@ -113,7 +114,8 @@ of
113is 114is
114.Dv NULL 115.Dv NULL
115then the 116then the
116.Fn inet6_opt_append function only reports what the total length would 117.Fn inet6_opt_append
118function only reports what the total length would
117be if the option were actually appended. 119be if the option were actually appended.
118The 120The
119.Fa len 121.Fa len
@@ -159,7 +161,7 @@ The
159parameter must have a value of 1, 2, 4, or 8 and cannot exceed the 161parameter must have a value of 1, 2, 4, or 8 and cannot exceed the
160value of 162value of
161.Fa len . 163.Fa len .
162The alignment values represent no alignment, 16 bit, 32 bit and 64 bit 164The alignment values represent no alignment, 16-bit, 32-bit and 64-bit
163alignments respectively. 165alignments respectively.
164.\" 166.\"
165.Ss inet6_opt_finish 167.Ss inet6_opt_finish
@@ -195,7 +197,8 @@ The
195argument is a pointer to memory that was returned by the 197argument is a pointer to memory that was returned by the
196.Fn inet6_opt_append 198.Fn inet6_opt_append
197call and the 199call and the
198.Fa offset argument specifies where the option should be placed in the 200.Fa offset
201argument specifies where the option should be placed in the
199data buffer. 202data buffer.
200The 203The
201.Fa val 204.Fa val
@@ -205,7 +208,7 @@ inserted into the extension header, and the
205argument indicates how much data to copy. 208argument indicates how much data to copy.
206.Pp 209.Pp
207The caller should ensure that each field is aligned on its natural 210The caller should ensure that each field is aligned on its natural
208boundaries as described in Appendix B of RFC2460. 211boundaries as described in Appendix B of RFC 2460.
209.Pp 212.Pp
210The function returns the offset for the next field which is calculated as 213The function returns the offset for the next field which is calculated as
211.Fa offset 214.Fa offset
@@ -236,7 +239,7 @@ The option is returned in the arguments
236.Fa typep , lenp , 239.Fa typep , lenp ,
237and 240and
238.Fa databufp . 241.Fa databufp .
239.Fa typep, lenp, 242.Fa typep , lenp ,
240and 243and
241.Fa databufp 244.Fa databufp
242point to the 8-bit option type, the 8-bit option length and the option 245point to the 8-bit option type, the 8-bit option length and the option
@@ -280,7 +283,7 @@ or
280functions. 283functions.
281The 284The
282.Fa val 285.Fa val
283argument points where the data will be extracted. 286argument points to where the data will be extracted.
284The 287The
285.Fa offset 288.Fa offset
286argument specifies from where in the data portion of the option the 289argument specifies from where in the data portion of the option the
@@ -288,7 +291,7 @@ value should be extracted; the first byte of option data is specified
288by an offset of zero. 291by an offset of zero.
289.Pp 292.Pp
290It is expected that each field is aligned on its natural boundaries as 293It is expected that each field is aligned on its natural boundaries as
291described in Appendix B of RFC2460. 294described in Appendix B of RFC 2460.
292.Pp 295.Pp
293The function returns the offset for the next field 296The function returns the offset for the next field
294by calculating 297by calculating
@@ -298,18 +301,17 @@ by calculating
298which can be used when extracting option content with multiple fields. 301which can be used when extracting option content with multiple fields.
299Robust receivers must verify alignment before calling this function. 302Robust receivers must verify alignment before calling this function.
300.\" 303.\"
301.Sh DIAGNOSTICS
302All the functions return
303\-1
304on an error.
305.\"
306.Sh EXAMPLES 304.Sh EXAMPLES
307RFC3542 gives comprehensive examples in Section 23. 305RFC 3542 gives comprehensive examples in Section 23.
308.Pp
309KAME also provides examples in the 306KAME also provides examples in the
310.Pa advapitest 307.Pa advapitest
311directory of its kit. 308directory of its kit.
312.\" 309.\"
310.Sh DIAGNOSTICS
311All the functions return
312\-1
313on an error.
314.\"
313.Sh SEE ALSO 315.Sh SEE ALSO
314.Rs 316.Rs
315.%A W. Stevens 317.%A W. Stevens
@@ -317,20 +319,20 @@ directory of its kit.
317.%A E. Nordmark 319.%A E. Nordmark
318.%A T. Jinmei 320.%A T. Jinmei
319.%T "Advanced Sockets API for IPv6" 321.%T "Advanced Sockets API for IPv6"
320.%N RFC3542 322.%N RFC 3542
321.%D October 2002 323.%D October 2002
322.Re 324.Re
323.Rs 325.Rs
324.%A S. Deering 326.%A S. Deering
325.%A R. Hinden 327.%A R. Hinden
326.%T "Internet Protocol, Version 6 (IPv6) Specification" 328.%T "Internet Protocol, Version 6 (IPv6) Specification"
327.%N RFC2460 329.%N RFC 2460
328.%D December 1998 330.%D December 1998
329.Re 331.Re
330.Sh HISTORY
331The implementation first appeared in KAME advanced networking kit.
332.Sh STANDARDS 332.Sh STANDARDS
333The functions are documented in 333The functions are documented in
334.Dq Advanced Sockets API for IPv6 334.Dq Advanced Sockets API for IPv6
335.Pq RFC3542 . 335.Pq RFC 3542 .
336.Sh HISTORY
337The implementation first appeared in KAME advanced networking kit.
336.\" 338.\"