summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjmc <>2005-01-06 10:50:40 +0000
committerjmc <>2005-01-06 10:50:40 +0000
commitd6b9d99ff5795be0a1a1073b97e3e4a2a876ca69 (patch)
tree9211cd28f6b1a5f18853998b7e1a6e84c3468667 /src/lib
parent5603b5fa6e9c081716146498df798f7ec82f606e (diff)
downloadopenbsd-d6b9d99ff5795be0a1a1073b97e3e4a2a876ca69.tar.gz
openbsd-d6b9d99ff5795be0a1a1073b97e3e4a2a876ca69.tar.bz2
openbsd-d6b9d99ff5795be0a1a1073b97e3e4a2a876ca69.zip
tweaks;
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/inet6_option_space.363
1 files changed, 31 insertions, 32 deletions
diff --git a/src/lib/libc/net/inet6_option_space.3 b/src/lib/libc/net/inet6_option_space.3
index 9b5cac95e8..d41112167d 100644
--- a/src/lib/libc/net/inet6_option_space.3
+++ b/src/lib/libc/net/inet6_option_space.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: inet6_option_space.3,v 1.15 2005/01/06 03:50:46 itojun Exp $ 1.\" $OpenBSD: inet6_option_space.3,v 1.16 2005/01/06 10:50:40 jmc Exp $
2.\" $KAME: inet6_option_space.3,v 1.11 2005/01/05 03:00:44 itojun Exp $ 2.\" $KAME: inet6_option_space.3,v 1.11 2005/01/05 03:00:44 itojun Exp $
3.\" 3.\"
4.\" Copyright (C) 2004 WIDE Project. 4.\" Copyright (C) 2004 WIDE Project.
@@ -41,8 +41,6 @@
41.Nm inet6_option_find 41.Nm inet6_option_find
42.Nd IPv6 Hop-by-Hop and Destination Option Manipulation 42.Nd IPv6 Hop-by-Hop and Destination Option Manipulation
43.\" 43.\"
44.Sh LIBRARY
45.Lb libc
46.Sh SYNOPSIS 44.Sh SYNOPSIS
47.In sys/types.h 45.In sys/types.h
48.In netinet/in.h 46.In netinet/in.h
@@ -65,12 +63,12 @@ Manipulating and parsing IPv6's Hop-by-Hop and Destination options is
65complicated by the need to properly align and pad data as well as the 63complicated by the need to properly align and pad data as well as the
66need to manipulate ancillary information that is not part of the data 64need to manipulate ancillary information that is not part of the data
67stream. 65stream.
68RFC2292 defines a set of functions, which are implemented as 66RFC 2292 defines a set of functions, which are implemented as
69part of the Kame libraries, to support help developers create, change, 67part of the Kame libraries, to help developers create, change,
70and parse Hop-by-Hope and Destination options. 68and parse Hop-by-Hop and Destination options.
71All of the prototypes 69All of the prototypes
72for the option functions are defined in the 70for the option functions are defined in the
73.In netinet/in.h 71.Aq Pa netinet/in.h
74header file. 72header file.
75.\" 73.\"
76.Ss inet6_option_space 74.Ss inet6_option_space
@@ -102,7 +100,7 @@ structures, where
102is the number of options to be stored in the object. 100is the number of options to be stored in the object.
103Usually this has 101Usually this has
104no impact because it is assumed that most Hop-by-Hop and Destination 102no impact because it is assumed that most Hop-by-Hop and Destination
105option headers carry only one option as indicated in appendix B of RFC2460. 103option headers carry only one option as indicated in appendix B of RFC 2460.
106.\" 104.\"
107.Ss inet6_option_init 105.Ss inet6_option_init
108The 106The
@@ -112,13 +110,13 @@ a Hop-by-Hop or Destination option.
112It returns 110It returns
113.Li 0 111.Li 0
114on success and 112on success and
115.Li -1 113.Li \-1
116when an error occurs. 114when an error occurs.
117.Pp 115.Pp
118The 116The
119.Fa bp 117.Fa bp
120argument points to a previously allocated area of memory which must be 118argument points to a previously allocated area of memory which must be
121large enough to contain all the arguments that the application indents 119large enough to contain all the arguments that the application intends
122to add later via 120to add later via
123.Fn inet6_option_append 121.Fn inet6_option_append
124and 122and
@@ -156,10 +154,11 @@ This function appends a Hop-by-Hop option or a Destination option into
156an ancillary data object previously initialized by a call to 154an ancillary data object previously initialized by a call to
157.Fn inet6_option_init . 155.Fn inet6_option_init .
158The 156The
159.Fn inet6_option_append function returns 157.Fn inet6_option_append
158function returns
160.Li 0 159.Li 0
161if it succeeds or 160if it succeeds or
162.Li -1 161.Li \-1
163when an error occurs. 162when an error occurs.
164.Pp 163.Pp
165The 164The
@@ -214,7 +213,7 @@ Alignments may be specified as
214.Li 4 , 213.Li 4 ,
215or 214or
216.Li 8 215.Li 8
217bytes, which is no alignment, 16 bit, 32 bit and 64 bit alignments 216bytes, which is no alignment, 16-bit, 32-bit and 64-bit alignments
218respectively. 217respectively.
219.Pp 218.Pp
220The 219The
@@ -268,7 +267,7 @@ determine if padding must be appended at the end of the option.
268(The 267(The
269.Fn inet6_option_append 268.Fn inet6_option_append
270function does not need a data length argument 269function does not need a data length argument
271since the option data length must already be stored by the caller) 270since the option data length must already be stored by the caller.)
272.Pp 271.Pp
273The 272The
274.Fa multx 273.Fa multx
@@ -295,13 +294,13 @@ argument points to the 8-bit option type field, which is followed by
295the 8-bit option data length, and then the option data. 294the 8-bit option data length, and then the option data.
296When no more 295When no more
297options remain to be processed, the return value is 296options remain to be processed, the return value is
298.Li -1 297.Li \-1
299and 298and
300.Fa *tptrp 299.Fa *tptrp
301is 300is
302.Dv NULL 301.Dv NULL
303and when an error occurs, the return value is 302and when an error occurs, the return value is
304.Li -1 303.Li \-1
305but the 304but the
306.Fa *tptrp 305.Fa *tptrp
307argument is not 306argument is not
@@ -310,7 +309,7 @@ This set of return values allows a program to easily loop through all
310the options in an ancillary data object, checking for the error and 309the options in an ancillary data object, checking for the error and
311end of stream conditions along the way. 310end of stream conditions along the way.
312.Pp 311.Pp
313When a valid option is returned the 312When a valid option is returned, the
314.Fa cmsg 313.Fa cmsg
315argument points to a 314argument points to a
316.Li cmsghdr 315.Li cmsghdr
@@ -351,7 +350,7 @@ function allows an application to search for a particular option type
351in an ancillary data object. 350in an ancillary data object.
352The 351The
353.Fa cmsg 352.Fa cmsg
354argument is a pointer to 353argument is a pointer to a
355.Li cmsghdr 354.Li cmsghdr
356structure in which the 355structure in which the
357.Li cmsg_level 356.Li cmsg_level
@@ -369,13 +368,16 @@ The
369argument is handled exactly as in the 368argument is handled exactly as in the
370.Fn inet6_option_next 369.Fn inet6_option_next
371function described above. 370function described above.
372.Pa 371.Pp
373The 372The
374.fn inet6_option_find 373.Fn inet6_option_find
375function starts searching for an option of the specified type 374function starts searching for an option of the specified type
376beginning after the value of 375beginning after the value of
377.Fa *tptrp . 376.Fa *tptrp .
378.\" 377.\"
378.Sh EXAMPLES
379RFC 2292 gives comprehensive examples in chapter 6.
380.\"
379.Sh DIAGNOSTICS 381.Sh DIAGNOSTICS
380The 382The
381.Fn inet6_option_init 383.Fn inet6_option_init
@@ -384,7 +386,7 @@ and
384functions return 386functions return
385.Li 0 387.Li 0
386on success or 388on success or
387.Li -1 389.Li \-1
388on an error. 390on an error.
389.Pp 391.Pp
390The 392The
@@ -398,37 +400,34 @@ When
398or 400or
399.Fn inet6_option_find 401.Fn inet6_option_find
400detect an error they return 402detect an error they return
401.Li -1 403.Li \-1
402setting 404setting
403.Fa *tptrp 405.Fa *tptrp
404to non 406to a non
405.Dv NULL 407.Dv NULL
406value. 408value.
407.\" 409.\"
408.Sh EXAMPLES
409RFC2292 gives comprehensive examples in chapter 6.
410.\"
411.Sh SEE ALSO 410.Sh SEE ALSO
412.Rs 411.Rs
413.%A W. Stevens 412.%A W. Stevens
414.%A M. Thomas 413.%A M. Thomas
415.%T "Advanced Sockets API for IPv6" 414.%T "Advanced Sockets API for IPv6"
416.%N RFC2292 415.%N RFC 2292
417.%D February 1998 416.%D February 1998
418.Re 417.Re
419.Rs 418.Rs
420.%A S. Deering 419.%A S. Deering
421.%A R. Hinden 420.%A R. Hinden
422.%T "Internet Protocol, Version 6 (IPv6) Specification" 421.%T "Internet Protocol, Version 6 (IPv6) Specification"
423.%N RFC2460 422.%N RFC 2460
424.%D December 1998 423.%D December 1998
425.Re 424.Re
426.\" 425.\"
427.Sh HISTORY
428The implementation first appeared in KAME advanced networking kit.
429.\"
430.Sh STANDARDS 426.Sh STANDARDS
431The functions are documented in 427The functions are documented in
432.Dq Advanced Sockets API for IPv6 428.Dq Advanced Sockets API for IPv6
433(RFC2292). 429(RFC 2292).
430.\"
431.Sh HISTORY
432The implementation first appeared in KAME advanced networking kit.
434.\" 433.\"