RFC2292 日本語訳

2292 Advanced Sockets API for IPv6. W. Stevens, M. Thomas. February 1998. (Format: TXT=152077 bytes) (Obsoleted by RFC3542) (Status: INFORMATIONAL)
プログラムでの自動翻訳です。
RFC一覧
英語原文

Network Working Group                                        W. Stevens
Request for Comments: 2292                                   Consultant
Category: Informational                                       M. Thomas
                                                              AltaVista
                                                          February 1998

コメントを求めるワーキンググループW.スティーブンス要求をネットワークでつないでください: 2292年のコンサルタントカテゴリ: 情報のM.トーマスAltaVista1998年2月

                     Advanced Sockets API for IPv6

IPv6に、高度なソケットAPI

Status of this Memo

このMemoの状態

   This memo provides information for the Internet community.  It does
   not specify an Internet standard of any kind.  Distribution of this
   memo is unlimited.

このメモはインターネットコミュニティのための情報を提供します。 それはどんな種類のインターネット標準も指定しません。 このメモの分配は無制限です。

Copyright Notice

版権情報

   Copyright (C) The Internet Society (1998).  All Rights Reserved.

Copyright(C)インターネット協会(1998)。 All rights reserved。

Abstract

要約

   Specifications are in progress for changes to the sockets API to
   support IP version 6 [RFC-2133].  These changes are for TCP and UDP-
   based applications and will support most end-user applications in use
   today: Telnet and FTP clients and servers, HTTP clients and servers,
   and the like.

ソケットAPIへの変化が、IPバージョン6が[RFC-2133]であるとサポートするように、仕様は進行しています。 これらの変化がTCPのためのものであり、UDPはアプリケーションを基礎づけて、今日、使用中のほとんどのエンドユーザアプリケーションをサポートするでしょう: telnet、FTPクライアント、サーバ、HTTPクライアント、サーバ、および同様のもの。

   But another class of applications exists that will also be run under
   IPv6.  We call these "advanced" applications and today this includes
   programs such as Ping, Traceroute, routing daemons, multicast routing
   daemons, router discovery daemons, and the like.  The API feature
   typically used by these programs that make them "advanced" is a raw
   socket to access ICMPv4, IGMPv4, or IPv4, along with some knowledge
   of the packet header formats used by these protocols.  To provide
   portability for applications that use raw sockets under IPv6, some
   standardization is needed for the advanced API features.

しかし、また、IPv6の下で実行されるもう1人のクラスのアプリケーションは存在しています。 私たちは、「高度な」アプリケーションにこれらを呼んで、これが含む今日をPingや、Tracerouteや、ルーティングデーモンや、マルチキャストルーティングデーモンや、ルータ発見デーモンや、同様のものなどのプログラムと呼びます。 それらが「進められること」を作るこれらのプログラムで通常使用されるAPIの特徴はICMPv4、IGMPv4、またはIPv4にアクセスする生のソケットです、これらのプロトコルによって使用されるパケットヘッダー形式に関する何らかの知識と共に。 IPv6の下で生のソケットを使用するアプリケーションに移植性を提供するために、何らかの標準化が高度なAPIの特徴に必要です。

   There are other features of IPv6 that some applications will need to
   access: interface identification (specifying the outgoing interface
   and determining the incoming interface) and IPv6 extension headers
   that are not addressed in [RFC-2133]: Hop-by-Hop options, Destination
   options, and the Routing header (source routing).  This document
   provides API access to these features too.

いくつかのアプリケーションがアクセスする必要があるIPv6の他の特徴があります: 識別(外向的なインタフェースを指定して、入って来るインタフェースを決定する)と[RFC-2133]で宛てられないIPv6拡張ヘッダーを連結してください: ホップで、オプション、Destinationオプション、およびルート設定ヘッダー(ソースルーティング)を飛び越してください。 このドキュメントはこれらの特徴にもAPIアクセスを提供します。

Stevens & Thomas             Informational                      [Page 1]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[1ページ]のRFC IPv6 February 1998に、高度なソケットAPI

Table of Contents

目次

    1.  Introduction ................................................3
    2.  Common Structures and Definitions ...........................5
       2.1.  The ip6_hdr Structure ..................................5
            2.1.1.  IPv6 Next Header Values .........................6
            2.1.2.  IPv6 Extension Headers ..........................6
       2.2.  The icmp6_hdr Structure ................................8
            2.2.1.  ICMPv6 Type and Code Values .....................8
            2.2.2.  ICMPv6 Neighbor Discovery Type and Code Values ..9
       2.3.  Address Testing Macros .................................12
       2.4.  Protocols File .........................................12
    3.  IPv6 Raw Sockets ............................................13
       3.1.  Checksums ..............................................14
       3.2.  ICMPv6 Type Filtering ..................................14
    4.  Ancillary Data ..............................................17
       4.1.  The msghdr Structure ...................................18
       4.2.  The cmsghdr Structure ..................................18
       4.3.  Ancillary Data Object Macros ...........................19
            4.3.1.  CMSG_FIRSTHDR ...................................20
            4.3.2.  CMSG_NXTHDR .....................................22
            4.3.3.  CMSG_DATA .......................................22
            4.3.4.  CMSG_SPACE ......................................22
            4.3.5.  CMSG_LEN ........................................22
       4.4.  Summary of Options Described Using Ancillary Data ......23
       4.5.  IPV6_PKTOPTIONS Socket Option ..........................24
            4.5.1.  TCP Sticky Options ..............................25
            4.5.2.  UDP and Raw Socket Sticky Options ...............26
    5.  Packet Information ..........................................26
       5.1.  Specifying/Receiving the Interface .....................27
       5.2.  Specifying/Receiving Source/Destination Address ........27
       5.3.  Specifying/Receiving the Hop Limit .....................28
       5.4.  Specifying the Next Hop Address ........................29
       5.5.  Additional Errors with sendmsg() .......................29
    6.  Hop-By-Hop Options ..........................................30
       6.1.  Receiving Hop-by-Hop Options ...........................31
       6.2.  Sending Hop-by-Hop Options .............................31
       6.3.  Hop-by-Hop and Destination Options Processing ..........32
            6.3.1.  inet6_option_space ..............................32
            6.3.2.  inet6_option_init ...............................32
            6.3.3.  inet6_option_append .............................33
            6.3.4.  inet6_option_alloc ..............................33
            6.3.5.  inet6_option_next ...............................34
            6.3.6.  inet6_option_find ...............................35
            6.3.7.  Options Examples ................................35
    7.  Destination Options .........................................42
       7.1.  Receiving Destination Options ..........................42
       7.2.  Sending Destination Options ............................43

1. 序論…3 2. 一般的な構造と定義…5 2.1. ip6_hdr Structure…5 2.1.1. IPv6ヘッダーの次値…6 2.1.2. IPv6拡張ヘッダー…6 2.2. icmp6_hdr Structure…8 2.2.1. ICMPv6は値をタイプして、コード化します…8 2.2.2. ICMPv6隣人発見タイプとコード値。9 2.3. テストマクロを扱ってください…12 2.4. プロトコルはファイルされます…12 3. IPv6の生のソケット…13 3.1. チェックサム…14 3.2. ICMPv6はフィルタリングをタイプします…14 4. 補助データ…17 4.1. msghdr Structure…18 4.2. cmsghdr Structure…18 4.3. 補助データオブジェクトマクロ…19 4.3.1. CMSG_FIRSTHDR…20 4.3.2. CMSG_NXTHDR…22 4.3.3. CMSG_データ…22 4.3.4. CMSG_スペース…22 4.3.5. CMSG_レン…22 4.4. オプションの概要は、補助データを使用すると説明しました…23 4.5. IPV6_PKTOPTIONSソケットオプション…24 4.5.1. TCPのねばねばするオプション…25 4.5.2. UDPと生のソケットねばねばするオプション…26 5. パケット情報…26 5.1. インタフェースを指定するか、または受けます…27 5.2. 指定/受信ソース/送付先アドレス…27 5.3. ホップ限界を指定するか、または受けます…28 5.4. 次のホップアドレスを指定します…29 5.5. sendmsg()と追加Errors…29 6. ホップごとのオプション…30 6.1. ホップごとのオプションを受け取ります…31 6.2. ホップごとの送付オプション…31 6.3. ホップごとの目的地オプション処理…32 6.3.1inet6_オプション_スペース…32 6.3.2inet6_オプション_イニット…32 _が追加する6.3.3inet6_オプション…33 _6.3.4inet6_オプションalloc…次の33 6.3.5inet6_オプション_…34 6.3.6inet6_オプション_掘り出し物…35 6.3.7. オプションの例…35 7. 目的地オプション…42 7.1. 目的地オプションを受け取ります…42 7.2. 目的地オプションを送ります…43

Stevens & Thomas             Informational                      [Page 2]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[2ページ]のRFC IPv6 February 1998に、高度なソケットAPI

    8.  Routing Header Option .......................................43
       8.1.  inet6_rthdr_space ......................................44
       8.2.  inet6_rthdr_init .......................................45
       8.3.  inet6_rthdr_add ........................................45
       8.4.  inet6_rthdr_lasthop ....................................46
       8.5.  inet6_rthdr_reverse ....................................46
       8.6.  inet6_rthdr_segments ...................................46
       8.7.  inet6_rthdr_getaddr ....................................46
       8.8.  inet6_rthdr_getflags ...................................47
       8.9.  Routing Header Example .................................47
    9.  Ordering of Ancillary Data and IPv6 Extension Headers .......53
   10.  IPv6-Specific Options with IPv4-Mapped IPv6 Addresses .......54
   11.  rresvport_af ................................................55
   12.  Future Items ................................................55
       12.1.  Flow Labels ...........................................55
       12.2.  Path MTU Discovery and UDP ............................56
       12.3.  Neighbor Reachability and UDP .........................56
   13.  Summary of New Definitions ..................................56
   14.  Security Considerations .....................................59
   15.  Change History ..............................................59
   16.  References ..................................................65
   17.  Acknowledgments .............................................65
   18.  Authors' Addresses ..........................................66
   19.  Full Copyright Statement ....................................67

8. ルート設定ヘッダーオプション…43 8.1inet6_rthdr_スペース…44 8.2inet6_rthdr_イニット…45 8.3 inet6_rthdr_は加えます…45 8.4inet6_rthdr_lasthop…46 8.5inet6_rthdr_逆…46 8.6inet6_rthdr_セグメント…46 8.7inet6_rthdr_getaddr…46 8.8inet6_rthdr_getflags…47 8.9. ルート設定ヘッダーの例…47 9. 補助データとIPv6拡張ヘッダーに注文します…53 10. IPv4によって写像されたIPv6アドレスとのIPv6特有のオプション…54 11. rresvport_af…55 12. 将来の項目…55 12.1. 流れラベル…55 12.2. 経路のMTU発見とUDP…56 12.3. 隣人の可到達性とUDP…56 13. 新しい定義の概要…56 14. セキュリティ問題…59 15. 歴史を変えてください…59 16. 参照…65 17. 承認…65 18. 作者のアドレス…66 19. 完全な著作権宣言文…67

1.  Introduction

1. 序論

   Specifications are in progress for changes to the sockets API to
   support IP version 6 [RFC-2133].  These changes are for TCP and UDP-
   based applications.  The current document defines some the "advanced"
   features of the sockets API that are required for applications to
   take advantage of additional features of IPv6.

ソケットAPIへの変化が、IPバージョン6が[RFC-2133]であるとサポートするように、仕様は進行しています。 これらの変化はTCPのためのものでした、そして、UDPはアプリケーションを基礎づけました。 現在のドキュメントはアプリケーションがIPv6の付加的な機能を利用しなければならないソケットAPIのいくつかの「高度」特徴を定義します。

   Today, the portability of applications using IPv4 raw sockets is
   quite high, but this is mainly because most IPv4 implementations
   started from a common base (the Berkeley source code) or at least
   started with the Berkeley headers.  This allows programs such as Ping
   and Traceroute, for example, to compile with minimal effort on many
   hosts that support the sockets API.  With IPv6, however, there is no
   common source code base that implementors are starting from, and the
   possibility for divergence at this level between different
   implementations is high.  To avoid a complete lack of portability
   amongst applications that use raw IPv6 sockets, some standardization
   is necessary.

今日、IPv4の生のソケットを使用するアプリケーションの移植性はかなり高いのですが、主に、ほとんどのIPv4実装が一般的なベース(バークレーソースコード)から始めたか、またはバークレーヘッダーから少なくとも始まったので、これはそうです。 例えば、これは、ソケットAPIをサポートする多くのホストの上に最小量の取り組みがある状態でコンパイルするためにPingやTracerouteなどのプログラムを許容します。 しかしながら、IPv6と共に、作成者が始めている共通ソースコードベースが全くありません、そして、異なった実装の間のこのレベルにおける分岐のための可能性は高いです。 生のIPv6ソケットを使用するアプリケーションの中で移植性の完全な不足を避けるために、何らかの標準化が必要です。

Stevens & Thomas             Informational                      [Page 3]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[3ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   There are also features from the basic IPv6 specification that are
   not addressed in [RFC-2133]: sending and receiving Hop-by-Hop
   options, Destination options, and Routing headers, specifying the
   outgoing interface, and being told of the receiving interface.

基本のIPv6仕様からの[RFC-2133]で扱われない特徴もあります: 外向的なインタフェースを指定して、受信インタフェースについて言われて、ホップによるHopオプション、Destinationオプション、およびルート設定ヘッダーを送って、受け取ります。

   This document can be divided into the following main sections.

このドキュメントを以下の主なセクションに分割できます。

   1.  Definitions of the basic constants and structures required for
       applications to use raw IPv6 sockets.  This includes structure
       definitions for the IPv6 and ICMPv6 headers and all associated
       constants (e.g., values for the Next Header field).

1. 基本的な定数と構造の定義がアプリケーションが生のIPv6ソケットを使用するのが必要です。 これはIPv6、ICMPv6ヘッダー、およびすべての関連定数(例えば、Next Header分野への値)のための構造定義を含んでいます。

   2.  Some basic semantic definitions for IPv6 raw sockets.  For
       example, a raw ICMPv4 socket requires the application to
       calculate and store the ICMPv4 header checksum.  But with IPv6
       this would require the application to choose the source IPv6
       address because the source address is part of the pseudo header
       that ICMPv6 now uses for its checksum computation.  It should be
       defined that with a raw ICMPv6 socket the kernel always
       calculates and stores the ICMPv6 header checksum.

2. IPv6の生のソケットのためのいくつかの基本的な意味定義。 例えば、生のICMPv4ソケットは、ICMPv4ヘッダーチェックサムを計算して、保存するためにアプリケーションを必要とします。 しかし、IPv6と共に、これは、ソースアドレスがICMPv6が現在チェックサム計算に使用する疑似ヘッダーの一部であるのでソースIPv6アドレスを選ぶためにアプリケーションを必要とするでしょう。 それは定義されるべきです。生のICMPv6ソケットによるカーネルは、いつもICMPv6ヘッダーチェックサムを計算して、保存します。

   3.  Packet information: how applications can obtain the received
       interface, destination address, and received hop limit, along
       with specifying these values on a per-packet basis.  There are a
       class of applications that need this capability and the technique
       should be portable.

3. パケット情報: アプリケーションは1パケットあたり1個のベースでこれらの値を指定すると共に容認されたインタフェース、送付先アドレス、および容認されたホップ限界をどう得ることができるか。 この能力を必要とするアプリケーションのクラスがあります、そして、テクニックは携帯用であるべきです。

   4.  Access to the optional Hop-by-Hop, Destination, and Routing
       headers.

4. ホップによる任意のHop、Destination、およびルート設定にヘッダーにアクセスしてください。

   5.  Additional features required for IPv6 application portability.

5. 付加的な機能がIPv6アプリケーションの移植性に必要です。

   The packet information along with access to the extension headers
   (Hop-by-Hop options, Destination options, and Routing header) are
   specified using the "ancillary data" fields that were added to the
   4.3BSD Reno sockets API in 1990.  The reason is that these ancillary
   data fields are part of the Posix.1g standard (which should be
   approved in 1997) and should therefore be adopted by most vendors.

拡張ヘッダー(ホップごとのオプション、Destinationオプション、およびルート設定ヘッダー)へのアクセスに伴うパケット情報は、1990年に4.3BSDリノソケットAPIに加えられた「補助データ」分野を使用することで指定されています。 理由はこれらの補助データ分野がPosix.1g規格(1997年に承認されるべきである)の一部であり、したがって、ほとんどのベンダーが採用されるべきであるということです。

   This document does not address application access to either the
   authentication header or the encapsulating security payload header.

このドキュメントは、アプリケーションが認証ヘッダーか要約のセキュリティペイロードヘッダーのどちらかへのアクセスであると扱いません。

   All examples in this document omit error checking in favor of brevity
   and clarity.

すべての例が本書では簡潔さと明快を支持してチェックする誤りを省略します。

Stevens & Thomas             Informational                      [Page 4]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[4ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   We note that many of the functions and socket options defined in this
   document may have error returns that are not defined in this
   document.  Many of these possible error returns will be recognized
   only as implementations proceed.

私たちは、本書では定義された機能とソケットオプションの多くには本書では定義されない誤りリターンがあるかもしれないことに注意します。 単に実装が続くように可能な誤りが返すこれらの多くが認識されるでしょう。

   Datatypes in this document follow the Posix.1g format: intN_t means a
   signed integer of exactly N bits (e.g., int16_t) and uintN_t means an
   unsigned integer of exactly N bits (e.g., uint32_t).

データ型式は本書ではPosix.1g形式に続きます: intN_tは、_tがちょうどNビット(例えば、uint32_t)の符号のない整数を意味することをちょうどNビット(例えば、int16_t)とuintNの署名している整数に意味します。

   Note that we use the (unofficial) terminology ICMPv4, IGMPv4, and
   ARPv4 to avoid any confusion with the newer ICMPv6 protocol.

私たちが、より新しいICMPv6プロトコルへのどんな混乱も避けるのに(非公式)の用語のICMPv4、IGMPv4、およびARPv4を使用することに注意してください。

2.  Common Structures and Definitions

2. 一般的な構造と定義

   Many advanced applications examine fields in the IPv6 header and set
   and examine fields in the various ICMPv6 headers.  Common structure
   definitions for these headers are required, along with common
   constant definitions for the structure members.

多くの高度なアプリケーションが、様々なICMPv6ヘッダーで分野をIPv6ヘッダーで分野を調べて、設定して、調べます。 これらのヘッダーのための一般的な構造定義が構造メンバーのための一般的な一定の定義と共に必要です。

   Two new headers are defined: <netinet/ip6.h> and <netinet/icmp6.h>.

2個の新しいヘッダーが定義されます: <netinet/ip6.h>と<netinet/icmp6.h>。

   When an include file is specified, that include file is allowed to
   include other files that do the actual declaration or definition.

インクルードファイルが指定されるとき、そのインクルードファイルは実際の宣言か定義をする他のファイルを含むことができます。

2.1.  The ip6_hdr Structure

2.1. ip6_hdr Structure

   The following structure is defined as a result of including
   <netinet/ip6.h>.  Note that this is a new header.

<netinet/ip6.h>を含んでいることの結果、以下の構造は定義されます。 これが新しいヘッダーであることに注意してください。

    struct ip6_hdr {
      union {
        struct ip6_hdrctl {
          uint32_t ip6_un1_flow;   /* 24 bits of flow-ID */
          uint16_t ip6_un1_plen;   /* payload length */
          uint8_t  ip6_un1_nxt;    /* next header */
          uint8_t  ip6_un1_hlim;   /* hop limit */
        } ip6_un1;
        uint8_t ip6_un2_vfc;       /* 4 bits version, 4 bits priority */
      } ip6_ctlun;
      struct in6_addr ip6_src;      /* source address */
      struct in6_addr ip6_dst;      /* destination address */
    };

組合..流れる..ビット..流れる..ID..ペイロード長..次..ヘッダー..ホップ..限界..ビット..バージョン..ビット..優先権..ソースアドレス..目的地..アドレス

    #define ip6_vfc   ip6_ctlun.ip6_un2_vfc
    #define ip6_flow  ip6_ctlun.ip6_un1.ip6_un1_flow
    #define ip6_plen  ip6_ctlun.ip6_un1.ip6_un1_plen
    #define ip6_nxt   ip6_ctlun.ip6_un1.ip6_un1_nxt
    #define ip6_hlim  ip6_ctlun.ip6_un1.ip6_un1_hlim

#ctlun.ip6_un2_vfc#、が定義するip6_vfc ip6_を定義してください、ip6_流れip6_ctlun.ip6_un1.ip6_un1_流動#がctlun.ip6_un1.ip6_un1_plen#、が定義するip6_plen ip6_を定義する、ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt#、は_hlimにip6_hlim ip6_ctlun.ip6_un1.ip6_un1を定義します。

Stevens & Thomas             Informational                      [Page 5]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[5ページ]のRFC IPv6 February 1998に、高度なソケットAPI

    #define ip6_hops  ip6_ctlun.ip6_un1.ip6_un1_hlim

#ip6_ホップip6_ctlun.ip6_un1.ip6_un1_hlimを定義してください。

2.1.1.  IPv6 Next Header Values

2.1.1. IPv6ヘッダーの次値

   IPv6 defines many new values for the Next Header field.  The
   following constants are defined as a result of including
   <netinet/in.h>.

IPv6は多くの新しい値をNext Header分野と定義します。 <netinet/in.h>を含んでいることの結果、以下の定数は定義されます。

   #define IPPROTO_HOPOPTS        0 /* IPv6 Hop-by-Hop options */
   #define IPPROTO_IPV6          41 /* IPv6 header */
   #define IPPROTO_ROUTING       43 /* IPv6 Routing header */
   #define IPPROTO_FRAGMENT      44 /* IPv6 fragmentation header */
   #define IPPROTO_ESP           50 /* encapsulating security payload */
   #define IPPROTO_AH            51 /* authentication header */
   #define IPPROTO_ICMPV6        58 /* ICMPv6 */
   #define IPPROTO_NONE          59 /* IPv6 no next header */
   #define IPPROTO_DSTOPTS       60 /* IPv6 Destination options */

#定義..ホップ..オプション..定義..ヘッダー..定義..ルート設定..ルート設定..ヘッダー..定義..断片化..ヘッダー..定義..超能力..カプセル化する..セキュリティ..ペイロード..定義..認証..ヘッダー..定義..定義..ノー..次..ヘッダー..定義..ゆだねる

   Berkeley-derived IPv4 implementations also define IPPROTO_IP to be 0.
   This should not be a problem since IPPROTO_IP is used only with IPv4
   sockets and IPPROTO_HOPOPTS only with IPv6 sockets.

また、バークレーによって派生させられたIPv4実装は、0になるようにIPPROTO_IPを定義します。 IPPROTO_IPがIPv6ソケットだけがあるIPv4ソケットとIPPROTO_HOPOPTSだけと共に使用されるので、これは問題であるべきではありません。

2.1.2.  IPv6 Extension Headers

2.1.2. IPv6拡張ヘッダー

   Six extension headers are defined for IPv6.  We define structures for
   all except the Authentication header and Encapsulating Security
   Payload header, both of which are beyond the scope of this document.
   The following structures are defined as a result of including
   <netinet/ip6.h>.

6人の拡張ヘッダーがIPv6のために定義されます。 私たちはAuthenticationヘッダーとEncapsulating Security有効搭載量ヘッダーを除いた皆のために構造を定義します。その両方がこのドキュメントの範囲にあります。 <netinet/ip6.h>を含んでいることの結果、以下の構造は定義されます。

   /* Hop-by-Hop options header */
   /* XXX should we pad it to force alignment on an 8-byte boundary? */
   struct ip6_hbh {
     uint8_t  ip6h_nxt;        /* next header */
     uint8_t  ip6h_len;        /* length in units of 8 octets */
       /* followed by options */
   };

私たちが8バイトの境界に整列を押しつけるためにそれを水増しするなら、/*はホップでオプションヘッダー*//*XXXを飛び越しますか? *uint8_t ip6h_nxt; /*次のヘッダー*/uint8_t ip6h_len; ユニットの8つの八重奏*//*の/*長さがオプション*/を続けた/struct ip6_hbh。

   /* Destination options header */
   /* XXX should we pad it to force alignment on an 8-byte boundary? */
   struct ip6_dest {
     uint8_t  ip6d_nxt;        /* next header */
     uint8_t  ip6d_len;        /* length in units of 8 octets */
       /* followed by options */
   };

/* Destination options header */ /* XXX should we pad it to force alignment on an 8-byte boundary? */ struct ip6_dest { uint8_t ip6d_nxt; /* next header */ uint8_t ip6d_len; /* length in units of 8 octets */ /* followed by options */ };

   /* Routing header */
   struct ip6_rthdr {

/* Routing header */ struct ip6_rthdr {

Stevens & Thomas             Informational                      [Page 6]

RFC 2292             Advanced Sockets API for IPv6         February 1998

Stevens & Thomas Informational [Page 6] RFC 2292 Advanced Sockets API for IPv6 February 1998

     uint8_t  ip6r_nxt;        /* next header */
     uint8_t  ip6r_len;        /* length in units of 8 octets */
     uint8_t  ip6r_type;       /* routing type */
     uint8_t  ip6r_segleft;    /* segments left */
       /* followed by routing type specific data */
   };

uint8_t ip6r_nxt; /* next header */ uint8_t ip6r_len; /* length in units of 8 octets */ uint8_t ip6r_type; /* routing type */ uint8_t ip6r_segleft; /* segments left */ /* followed by routing type specific data */ };

   /* Type 0 Routing header */
   struct ip6_rthdr0 {
     uint8_t  ip6r0_nxt;       /* next header */
     uint8_t  ip6r0_len;       /* length in units of 8 octets */
     uint8_t  ip6r0_type;      /* always zero */
     uint8_t  ip6r0_segleft;   /* segments left */
     uint8_t  ip6r0_reserved;  /* reserved field */
     uint8_t  ip6r0_slmap[3];  /* strict/loose bit map */
     struct in6_addr  ip6r0_addr[1];  /* up to 23 addresses */
   };

/* Type 0 Routing header */ struct ip6_rthdr0 { uint8_t ip6r0_nxt; /* next header */ uint8_t ip6r0_len; /* length in units of 8 octets */ uint8_t ip6r0_type; /* always zero */ uint8_t ip6r0_segleft; /* segments left */ uint8_t ip6r0_reserved; /* reserved field */ uint8_t ip6r0_slmap[3]; /* strict/loose bit map */ struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ };

   /* Fragment header */
   struct ip6_frag {
     uint8_t   ip6f_nxt;       /* next header */
     uint8_t   ip6f_reserved;  /* reserved field */
     uint16_t  ip6f_offlg;     /* offset, reserved, and flag */
     uint32_t  ip6f_ident;     /* identification */
   };

/* Fragment header */ struct ip6_frag { uint8_t ip6f_nxt; /* next header */ uint8_t ip6f_reserved; /* reserved field */ uint16_t ip6f_offlg; /* offset, reserved, and flag */ uint32_t ip6f_ident; /* identification */ };

   #if     BYTE_ORDER == BIG_ENDIAN
   #define IP6F_OFF_MASK       0xfff8  /* mask out offset from _offlg */
   #define IP6F_RESERVED_MASK  0x0006  /* reserved bits in ip6f_offlg */
   #define IP6F_MORE_FRAG      0x0001  /* more-fragments flag */
   #else   /* BYTE_ORDER == LITTLE_ENDIAN */
   #define IP6F_OFF_MASK       0xf8ff  /* mask out offset from _offlg */
   #define IP6F_RESERVED_MASK  0x0600  /* reserved bits in ip6f_offlg */
   #define IP6F_MORE_FRAG      0x0100  /* more-fragments flag */
   #endif

#if BYTE_ORDER == BIG_ENDIAN #define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */ #define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ #define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ #else /* BYTE_ORDER == LITTLE_ENDIAN */ #define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */ #define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */ #define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */ #endif

   Defined constants for fields larger than 1 byte depend on the byte
   ordering that is used.  This API assumes that the fields in the
   protocol headers are left in the network byte order, which is big-
   endian for the Internet protocols.  If not, then either these
   constants or the fields being tested must be converted at run-time,
   using something like htons() or htonl().

Defined constants for fields larger than 1 byte depend on the byte ordering that is used. This API assumes that the fields in the protocol headers are left in the network byte order, which is big- endian for the Internet protocols. If not, then either these constants or the fields being tested must be converted at run-time, using something like htons() or htonl().

   (Note: We show an implementation that supports both big-endian and
   little-endian byte ordering, assuming a hypothetical compile-time #if
   test to determine the byte ordering.  The constant that we show,

(Note: We show an implementation that supports both big-endian and little-endian byte ordering, assuming a hypothetical compile-time #if test to determine the byte ordering. The constant that we show,

Stevens & Thomas             Informational                      [Page 7]

RFC 2292             Advanced Sockets API for IPv6         February 1998

Stevens & Thomas Informational [Page 7] RFC 2292 Advanced Sockets API for IPv6 February 1998

   BYTE_ORDER, with values of BIG_ENDIAN and LITTLE_ENDIAN, are for
   example purposes only.  If an implementation runs on only one type of
   hardware it need only define the set of constants for that hardware's
   byte ordering.)

BYTE_ORDER, with values of BIG_ENDIAN and LITTLE_ENDIAN, are for example purposes only. If an implementation runs on only one type of hardware it need only define the set of constants for that hardware's byte ordering.)

2.2.  The icmp6_hdr Structure

2.2. The icmp6_hdr Structure

   The ICMPv6 header is needed by numerous IPv6 applications including
   Ping, Traceroute, router discovery daemons, and neighbor discovery
   daemons.  The following structure is defined as a result of including
   <netinet/icmp6.h>.  Note that this is a new header.

The ICMPv6 header is needed by numerous IPv6 applications including Ping, Traceroute, router discovery daemons, and neighbor discovery daemons. The following structure is defined as a result of including <netinet/icmp6.h>. Note that this is a new header.

   struct icmp6_hdr {
     uint8_t     icmp6_type;   /* type field */
     uint8_t     icmp6_code;   /* code field */
     uint16_t    icmp6_cksum;  /* checksum field */
     union {
       uint32_t  icmp6_un_data32[1]; /* type-specific field */
       uint16_t  icmp6_un_data16[2]; /* type-specific field */
       uint8_t   icmp6_un_data8[4];  /* type-specific field */
     } icmp6_dataun;
   };

struct icmp6_hdr { uint8_t icmp6_type; /* type field */ uint8_t icmp6_code; /* code field */ uint16_t icmp6_cksum; /* checksum field */ union { uint32_t icmp6_un_data32[1]; /* type-specific field */ uint16_t icmp6_un_data16[2]; /* type-specific field */ uint8_t icmp6_un_data8[4]; /* type-specific field */ } icmp6_dataun; };

   #define icmp6_data32    icmp6_dataun.icmp6_un_data32
   #define icmp6_data16    icmp6_dataun.icmp6_un_data16
   #define icmp6_data8     icmp6_dataun.icmp6_un_data8
   #define icmp6_pptr      icmp6_data32[0]  /* parameter prob */
   #define icmp6_mtu       icmp6_data32[0]  /* packet too big */
   #define icmp6_id        icmp6_data16[0]  /* echo request/reply */
   #define icmp6_seq       icmp6_data16[1]  /* echo request/reply */
   #define icmp6_maxdelay  icmp6_data16[0]  /* mcast group membership */

#define icmp6_data32 icmp6_dataun.icmp6_un_data32 #define icmp6_data16 icmp6_dataun.icmp6_un_data16 #define icmp6_data8 icmp6_dataun.icmp6_un_data8 #define icmp6_pptr icmp6_data32[0] /* parameter prob */ #define icmp6_mtu icmp6_data32[0] /* packet too big */ #define icmp6_id icmp6_data16[0] /* echo request/reply */ #define icmp6_seq icmp6_data16[1] /* echo request/reply */ #define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */

2.2.1.  ICMPv6 Type and Code Values

2.2.1. ICMPv6 Type and Code Values

   In addition to a common structure for the ICMPv6 header, common
   definitions are required for the ICMPv6 type and code fields.  The
   following constants are also defined as a result of including
   <netinet/icmp6.h>.

In addition to a common structure for the ICMPv6 header, common definitions are required for the ICMPv6 type and code fields. The following constants are also defined as a result of including <netinet/icmp6.h>.

#define ICMP6_DST_UNREACH             1
#define ICMP6_PACKET_TOO_BIG          2
#define ICMP6_TIME_EXCEEDED           3
#define ICMP6_PARAM_PROB              4

#define ICMP6_DST_UNREACH 1 #define ICMP6_PACKET_TOO_BIG 2 #define ICMP6_TIME_EXCEEDED 3 #define ICMP6_PARAM_PROB 4

#define ICMP6_INFOMSG_MASK  0x80    /* all informational messages */

#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */

#define ICMP6_ECHO_REQUEST          128
#define ICMP6_ECHO_REPLY            129

#define ICMP6_ECHO_REQUEST 128 #define ICMP6_ECHO_REPLY 129

Stevens & Thomas             Informational                      [Page 8]

RFC 2292             Advanced Sockets API for IPv6         February 1998

Stevens & Thomas Informational [Page 8] RFC 2292 Advanced Sockets API for IPv6 February 1998

#define ICMP6_MEMBERSHIP_QUERY      130
#define ICMP6_MEMBERSHIP_REPORT     131
#define ICMP6_MEMBERSHIP_REDUCTION  132

#define ICMP6_MEMBERSHIP_QUERY 130 #define ICMP6_MEMBERSHIP_REPORT 131 #define ICMP6_MEMBERSHIP_REDUCTION 132

#define ICMP6_DST_UNREACH_NOROUTE     0 /* no route to destination */
#define ICMP6_DST_UNREACH_ADMIN       1 /* communication with */
                                        /* destination */
                                        /* administratively */
                                        /* prohibited */
#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor */
#define ICMP6_DST_UNREACH_ADDR        3 /* address unreachable */
#define ICMP6_DST_UNREACH_NOPORT      4 /* bad port */

#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ #define ICMP6_DST_UNREACH_ADMIN 1 /* communication with */ /* destination */ /* administratively */ /* prohibited */ #define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor */ #define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ #define ICMP6_DST_UNREACH_NOPORT 4 /* bad port */

#define ICMP6_TIME_EXCEED_TRANSIT     0 /* Hop Limit == 0 in transit */
#define ICMP6_TIME_EXCEED_REASSEMBLY  1 /* Reassembly time out */

#define ICMP6_TIME_EXCEED_TRANSIT 0 /* Hop Limit == 0 in transit */ #define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* Reassembly time out */

#define ICMP6_PARAMPROB_HEADER        0 /* erroneous header field */
#define ICMP6_PARAMPROB_NEXTHEADER    1 /* unrecognized Next Header */
#define ICMP6_PARAMPROB_OPTION        2 /* unrecognized IPv6 option */

#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */ #define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized Next Header */ #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized IPv6 option */

   The five ICMP message types defined by IPv6 neighbor discovery (133-
   137) are defined in the next section.

The five ICMP message types defined by IPv6 neighbor discovery (133- 137) are defined in the next section.

2.2.2.  ICMPv6 Neighbor Discovery Type and Code Values

2.2.2. ICMPv6 Neighbor Discovery Type and Code Values

   The following structures and definitions are defined as a result of
   including <netinet/icmp6.h>.

The following structures and definitions are defined as a result of including <netinet/icmp6.h>.

   #define ND_ROUTER_SOLICIT           133
   #define ND_ROUTER_ADVERT            134
   #define ND_NEIGHBOR_SOLICIT         135
   #define ND_NEIGHBOR_ADVERT          136
   #define ND_REDIRECT                 137

#define ND_ROUTER_SOLICIT 133 #define ND_ROUTER_ADVERT 134 #define ND_NEIGHBOR_SOLICIT 135 #define ND_NEIGHBOR_ADVERT 136 #define ND_REDIRECT 137

   struct nd_router_solicit {     /* router solicitation */
     struct icmp6_hdr  nd_rs_hdr;
       /* could be followed by options */
   };

struct nd_router_solicit { /* router solicitation */ struct icmp6_hdr nd_rs_hdr; /* could be followed by options */ };

   #define nd_rs_type               nd_rs_hdr.icmp6_type
   #define nd_rs_code               nd_rs_hdr.icmp6_code
   #define nd_rs_cksum              nd_rs_hdr.icmp6_cksum
   #define nd_rs_reserved           nd_rs_hdr.icmp6_data32[0]

#define nd_rs_type nd_rs_hdr.icmp6_type #define nd_rs_code nd_rs_hdr.icmp6_code #define nd_rs_cksum nd_rs_hdr.icmp6_cksum #define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]

   struct nd_router_advert {      /* router advertisement */
     struct icmp6_hdr  nd_ra_hdr;
     uint32_t   nd_ra_reachable;   /* reachable time */
     uint32_t   nd_ra_retransmit;  /* retransmit timer */

struct nd_router_advert { /* router advertisement */ struct icmp6_hdr nd_ra_hdr; uint32_t nd_ra_reachable; /* reachable time */ uint32_t nd_ra_retransmit; /* retransmit timer */

Stevens & Thomas             Informational                      [Page 9]

RFC 2292             Advanced Sockets API for IPv6         February 1998

Stevens & Thomas Informational [Page 9] RFC 2292 Advanced Sockets API for IPv6 February 1998

       /* could be followed by options */
   };

/* could be followed by options */ };

   #define nd_ra_type               nd_ra_hdr.icmp6_type
   #define nd_ra_code               nd_ra_hdr.icmp6_code
   #define nd_ra_cksum              nd_ra_hdr.icmp6_cksum
   #define nd_ra_curhoplimit        nd_ra_hdr.icmp6_data8[0]
   #define nd_ra_flags_reserved     nd_ra_hdr.icmp6_data8[1]
   #define ND_RA_FLAG_MANAGED       0x80
   #define ND_RA_FLAG_OTHER         0x40
   #define nd_ra_router_lifetime    nd_ra_hdr.icmp6_data16[1]

#define nd_ra_type nd_ra_hdr.icmp6_type #define nd_ra_code nd_ra_hdr.icmp6_code #define nd_ra_cksum nd_ra_hdr.icmp6_cksum #define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] #define ND_RA_FLAG_MANAGED 0x80 #define ND_RA_FLAG_OTHER 0x40 #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]

   struct nd_neighbor_solicit {   /* neighbor solicitation */
     struct icmp6_hdr  nd_ns_hdr;
     struct in6_addr   nd_ns_target; /* target address */
       /* could be followed by options */
   };

struct nd_neighbor_solicit { /* neighbor solicitation */ struct icmp6_hdr nd_ns_hdr; struct in6_addr nd_ns_target; /* target address */ /* could be followed by options */ };

   #define nd_ns_type               nd_ns_hdr.icmp6_type
   #define nd_ns_code               nd_ns_hdr.icmp6_code
   #define nd_ns_cksum              nd_ns_hdr.icmp6_cksum
   #define nd_ns_reserved           nd_ns_hdr.icmp6_data32[0]

#define nd_ns_type nd_ns_hdr.icmp6_type #define nd_ns_code nd_ns_hdr.icmp6_code #define nd_ns_cksum nd_ns_hdr.icmp6_cksum #define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]

   struct nd_neighbor_advert {    /* neighbor advertisement */
     struct icmp6_hdr  nd_na_hdr;
     struct in6_addr   nd_na_target; /* target address */
       /* could be followed by options */
   };

struct nd_neighbor_advert { /* neighbor advertisement */ struct icmp6_hdr nd_na_hdr; struct in6_addr nd_na_target; /* target address */ /* could be followed by options */ };

   #define nd_na_type               nd_na_hdr.icmp6_type
   #define nd_na_code               nd_na_hdr.icmp6_code
   #define nd_na_cksum              nd_na_hdr.icmp6_cksum
   #define nd_na_flags_reserved     nd_na_hdr.icmp6_data32[0]
   #if     BYTE_ORDER == BIG_ENDIAN
   #define ND_NA_FLAG_ROUTER        0x80000000
   #define ND_NA_FLAG_SOLICITED     0x40000000
   #define ND_NA_FLAG_OVERRIDE      0x20000000
   #else   /* BYTE_ORDER == LITTLE_ENDIAN */
   #define ND_NA_FLAG_ROUTER        0x00000080
   #define ND_NA_FLAG_SOLICITED     0x00000040
   #define ND_NA_FLAG_OVERRIDE      0x00000020
   #endif

#define nd_na_type nd_na_hdr.icmp6_type #define nd_na_code nd_na_hdr.icmp6_code #define nd_na_cksum nd_na_hdr.icmp6_cksum #define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] #if BYTE_ORDER == BIG_ENDIAN #define ND_NA_FLAG_ROUTER 0x80000000 #define ND_NA_FLAG_SOLICITED 0x40000000 #define ND_NA_FLAG_OVERRIDE 0x20000000 #else /* BYTE_ORDER == LITTLE_ENDIAN */ #define ND_NA_FLAG_ROUTER 0x00000080 #define ND_NA_FLAG_SOLICITED 0x00000040 #define ND_NA_FLAG_OVERRIDE 0x00000020 #endif

   struct nd_redirect {           /* redirect */
     struct icmp6_hdr  nd_rd_hdr;
     struct in6_addr   nd_rd_target; /* target address */
     struct in6_addr   nd_rd_dst;    /* destination address */
       /* could be followed by options */

struct nd_redirect { /* redirect */ struct icmp6_hdr nd_rd_hdr; struct in6_addr nd_rd_target; /* target address */ struct in6_addr nd_rd_dst; /* destination address */ /* could be followed by options */

Stevens & Thomas             Informational                     [Page 10]

RFC 2292             Advanced Sockets API for IPv6         February 1998

Stevens & Thomas Informational [Page 10] RFC 2292 Advanced Sockets API for IPv6 February 1998

   };

};

   #define nd_rd_type               nd_rd_hdr.icmp6_type
   #define nd_rd_code               nd_rd_hdr.icmp6_code
   #define nd_rd_cksum              nd_rd_hdr.icmp6_cksum
   #define nd_rd_reserved           nd_rd_hdr.icmp6_data32[0]

#define nd_rd_type nd_rd_hdr.icmp6_type #define nd_rd_code nd_rd_hdr.icmp6_code #define nd_rd_cksum nd_rd_hdr.icmp6_cksum #define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]

   struct nd_opt_hdr {           /* Neighbor discovery option header */
     uint8_t  nd_opt_type;
     uint8_t  nd_opt_len;        /* in units of 8 octets */
       /* followed by option specific data */
   };

struct nd_opt_hdr { /* Neighbor discovery option header */ uint8_t nd_opt_type; uint8_t nd_opt_len; /* in units of 8 octets */ /* followed by option specific data */ };

   #define  ND_OPT_SOURCE_LINKADDR       1
   #define  ND_OPT_TARGET_LINKADDR       2
   #define  ND_OPT_PREFIX_INFORMATION    3
   #define  ND_OPT_REDIRECTED_HEADER     4
   #define  ND_OPT_MTU                   5

#define ND_OPT_SOURCE_LINKADDR 1 #define ND_OPT_TARGET_LINKADDR 2 #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5

   struct nd_opt_prefix_info {    /* prefix information */
     uint8_t   nd_opt_pi_type;
     uint8_t   nd_opt_pi_len;
     uint8_t   nd_opt_pi_prefix_len;
     uint8_t   nd_opt_pi_flags_reserved;
     uint32_t  nd_opt_pi_valid_time;
     uint32_t  nd_opt_pi_preferred_time;
     uint32_t  nd_opt_pi_reserved2;
     struct in6_addr  nd_opt_pi_prefix;
   };

struct nd_opt_prefix_info { /* prefix information */ uint8_t nd_opt_pi_type; uint8_t nd_opt_pi_len; uint8_t nd_opt_pi_prefix_len; uint8_t nd_opt_pi_flags_reserved; uint32_t nd_opt_pi_valid_time; uint32_t nd_opt_pi_preferred_time; uint32_t nd_opt_pi_reserved2; struct in6_addr nd_opt_pi_prefix; };

   #define ND_OPT_PI_FLAG_ONLINK        0x80
   #define ND_OPT_PI_FLAG_AUTO          0x40

#define ND_OPT_PI_FLAG_ONLINK 0x80 #define ND_OPT_PI_FLAG_AUTO 0x40

   struct nd_opt_rd_hdr {         /* redirected header */
     uint8_t   nd_opt_rh_type;
     uint8_t   nd_opt_rh_len;
     uint16_t  nd_opt_rh_reserved1;
     uint32_t  nd_opt_rh_reserved2;
       /* followed by IP header and data */
   };

struct nd_opt_rd_hdr { /* redirected header */ uint8_t nd_opt_rh_type; uint8_t nd_opt_rh_len; uint16_t nd_opt_rh_reserved1; uint32_t nd_opt_rh_reserved2; /* followed by IP header and data */ };

   struct nd_opt_mtu {            /* MTU option */
     uint8_t   nd_opt_mtu_type;
     uint8_t   nd_opt_mtu_len;
     uint16_t  nd_opt_mtu_reserved;
     uint32_t  nd_opt_mtu_mtu;
   };

struct nd_opt_mtu { /* MTU option */ uint8_t nd_opt_mtu_type; uint8_t nd_opt_mtu_len; uint16_t nd_opt_mtu_reserved; uint32_t nd_opt_mtu_mtu; };

Stevens & Thomas             Informational                     [Page 11]

RFC 2292             Advanced Sockets API for IPv6         February 1998

Stevens & Thomas Informational [Page 11] RFC 2292 Advanced Sockets API for IPv6 February 1998

   We note that the nd_na_flags_reserved flags have the same byte
   ordering problems as we discussed with ip6f_offlg.

We note that the nd_na_flags_reserved flags have the same byte ordering problems as we discussed with ip6f_offlg.

2.3.  Address Testing Macros

2.3. Address Testing Macros

   The basic API ([RFC-2133]) defines some macros for testing an IPv6
   address for certain properties.  This API extends those definitions
   with additional address testing macros, defined as a result of
   including <netinet/in.h>.

The basic API ([RFC-2133]) defines some macros for testing an IPv6 address for certain properties. This API extends those definitions with additional address testing macros, defined as a result of including <netinet/in.h>.

    int  IN6_ARE_ADDR_EQUAL(const struct in6_addr *,
                            const struct in6_addr *);

int IN6_ARE_ADDR_EQUAL(const struct in6_addr *, const struct in6_addr *);

2.4.  Protocols File

2.4. Protocols File

   Many hosts provide the file /etc/protocols that contains the names of
   the various IP protocols and their protocol number (e.g., the value
   of the protocol field in the IPv4 header for that protocol, such as 1
   for ICMP).  Some programs then call the function getprotobyname() to
   obtain the protocol value that is then specified as the third
   argument to the socket() function.  For example, the Ping program
   contains code of the form

Many hosts provide the file /etc/protocols that contains the names of the various IP protocols and their protocol number (e.g., the value of the protocol field in the IPv4 header for that protocol, such as 1 for ICMP). Some programs then call the function getprotobyname() to obtain the protocol value that is then specified as the third argument to the socket() function. For example, the Ping program contains code of the form

       struct protoent  *proto;

struct protoent *proto;

       proto = getprotobyname("icmp");

proto = getprotobyname("icmp");

       s = socket(AF_INET, SOCK_RAW, proto->p_proto);

s = socket(AF_INET, SOCK_RAW, proto->p_proto);

   Common names are required for the new IPv6 protocols in this file, to
   provide portability of applications that call the getprotoXXX()
   functions.

Common names are required for the new IPv6 protocols in this file, to provide portability of applications that call the getprotoXXX() functions.

   We define the following protocol names with the values shown.  These
   are taken from ftp://ftp.isi.edu/in-notes/iana/assignments/protocol-
   numbers.

We define the following protocol names with the values shown. These are taken from ftp://ftp.isi.edu/in-notes/iana/assignments/protocol- numbers.

       hopopt           0    # hop-by-hop options for ipv6
       ipv6            41    # ipv6
       ipv6-route      43    # routing header for ipv6
       ipv6-frag       44    # fragment header for ipv6
       esp             50    # encapsulating security payload for ipv6
       ah              51    # authentication header for ipv6
       ipv6-icmp       58    # icmp for ipv6
       ipv6-nonxt      59    # no next header for ipv6
       ipv6-opts       60    # destination options for ipv6

hopopt 0 # hop-by-hop options for ipv6 ipv6 41 # ipv6 ipv6-route 43 # routing header for ipv6 ipv6-frag 44 # fragment header for ipv6 esp 50 # encapsulating security payload for ipv6 ah 51 # authentication header for ipv6 ipv6-icmp 58 # icmp for ipv6 ipv6-nonxt 59 # no next header for ipv6 ipv6-opts 60 # destination options for ipv6

Stevens & Thomas             Informational                     [Page 12]

RFC 2292             Advanced Sockets API for IPv6         February 1998

Stevens & Thomas Informational [Page 12] RFC 2292 Advanced Sockets API for IPv6 February 1998

3.  IPv6 Raw Sockets

3. IPv6 Raw Sockets

   Raw sockets bypass the transport layer (TCP or UDP).  With IPv4, raw
   sockets are used to access ICMPv4, IGMPv4, and to read and write IPv4
   datagrams containing a protocol field that the kernel does not
   process.  An example of the latter is a routing daemon for OSPF,
   since it uses IPv4 protocol field 89.  With IPv6 raw sockets will be
   used for ICMPv6 and to read and write IPv6 datagrams containing a
   Next Header field that the kernel does not process.  Examples of the
   latter are a routing daemon for OSPF for IPv6 and RSVP (protocol
   field 46).

Raw sockets bypass the transport layer (TCP or UDP). With IPv4, raw sockets are used to access ICMPv4, IGMPv4, and to read and write IPv4 datagrams containing a protocol field that the kernel does not process. An example of the latter is a routing daemon for OSPF, since it uses IPv4 protocol field 89. With IPv6 raw sockets will be used for ICMPv6 and to read and write IPv6 datagrams containing a Next Header field that the kernel does not process. Examples of the latter are a routing daemon for OSPF for IPv6 and RSVP (protocol field 46).

   All data sent via raw sockets MUST be in network byte order and all
   data received via raw sockets will be in network byte order.  This
   differs from the IPv4 raw sockets, which did not specify a byte
   ordering and typically used the host's byte order.

All data sent via raw sockets MUST be in network byte order and all data received via raw sockets will be in network byte order. This differs from the IPv4 raw sockets, which did not specify a byte ordering and typically used the host's byte order.

   Another difference from IPv4 raw sockets is that complete packets
   (that is, IPv6 packets with extension headers) cannot be read or
   written using the IPv6 raw sockets API.  Instead, ancillary data
   objects are used to transfer the extension headers, as described
   later in this document.  Should an application need access to the
   complete IPv6 packet, some other technique, such as the datalink
   interfaces BPF or DLPI, must be used.

Another difference from IPv4 raw sockets is that complete packets (that is, IPv6 packets with extension headers) cannot be read or written using the IPv6 raw sockets API. Instead, ancillary data objects are used to transfer the extension headers, as described later in this document. Should an application need access to the complete IPv6 packet, some other technique, such as the datalink interfaces BPF or DLPI, must be used.

   All fields in the IPv6 header that an application might want to
   change (i.e., everything other than the version number) can be
   modified using ancillary data and/or socket options by the
   application for output.  All fields in a received IPv6 header (other
   than the version number and Next Header fields) and all extension
   headers are also made available to the application as ancillary data
   on input.  Hence there is no need for a socket option similar to the
   IPv4 IP_HDRINCL socket option.

All fields in the IPv6 header that an application might want to change (i.e., everything other than the version number) can be modified using ancillary data and/or socket options by the application for output. All fields in a received IPv6 header (other than the version number and Next Header fields) and all extension headers are also made available to the application as ancillary data on input. Hence there is no need for a socket option similar to the IPv4 IP_HDRINCL socket option.

   When writing to a raw socket the kernel will automatically fragment
   the packet if its size exceeds the path MTU, inserting the required
   fragmentation headers.  On input the kernel reassembles received
   fragments, so the reader of a raw socket never sees any fragment
   headers.

生のソケットに書くとき、サイズが経路MTUを超えていると、カーネルは自動的にパケットを断片化するでしょう、必要な断片化ヘッダーを挿入して。 入力のときにカーネルが容認された断片を組み立て直すので、生のソケットの読者はどんな断片ヘッダーも決して見ません。

   When we say "an ICMPv6 raw socket" we mean a socket created by
   calling the socket function with the three arguments PF_INET6,
   SOCK_RAW, and IPPROTO_ICMPV6.

「ICMPv6の生のソケット」を言うとき、私たちは3つの議論があるソケット機能をPF_INET6、SOCK_RAW、およびIPPROTO_ICMPV6と呼ぶことによって作成されたソケットを言っています。

   Most IPv4 implementations give special treatment to a raw socket
   created with a third argument to socket() of IPPROTO_RAW, whose value
   is normally 255.  We note that this value has no special meaning to
   an IPv6 raw socket (and the IANA currently reserves the value of 255

ほとんどのIPv4実装が3番目の議論で通常、値が255であるIPPROTO_RAWのソケット()に作成された生のソケットに特別な処理を与えます。 私たちが、この値がIPv6の生のソケットにどんな特別な意味も持っていないことに注意する、(IANAは現在、255の値を予約します。

Stevens & Thomas             Informational                     [Page 13]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[13ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   when used as a next-header field).  (Note: This feature was added to
   IPv4 in 1988 by Van Jacobson to support traceroute, allowing a
   complete IP header to be passed by the application, before the
   IP_HDRINCL socket option was added.)

次のヘッダーフィールドとして使用されるいつ) (注意: この特徴は1988年にトレースルートをサポートするためにヴァン・ジェーコブソンによってIPv4に加えられました、完全なIPヘッダーがアプリケーションで渡されるのを許容して、IP_HDRINCLソケットオプションが加えられる前に。)

3.1.  Checksums

3.1. チェックサム

   The kernel will calculate and insert the ICMPv6 checksum for ICMPv6
   raw sockets, since this checksum is mandatory.

このチェックサムが義務的であるので、カーネルは、ICMPv6の生のソケットのためにICMPv6チェックサムを計算して、挿入するでしょう。

   For other raw IPv6 sockets (that is, for raw IPv6 sockets created
   with a third argument other than IPPROTO_ICMPV6), the application
   must set the new IPV6_CHECKSUM socket option to have the kernel (1)
   compute and store a checksum for output, and (2) verify the received
   checksum on input, discarding the packet if the checksum is in error.
   This option prevents applications from having to perform source
   address selection on the packets they send.  The checksum will
   incorporate the IPv6 pseudo-header, defined in Section 8.1 of [RFC-
   1883].  This new socket option also specifies an integer offset into
   the user data of where the checksum is located.

他の生のIPv6ソケット(すなわち、IPPROTO_ICMPV6以外の3番目の議論で作成された生のIPv6ソケットのための)のために、アプリケーションは、新しいIPV6_CHECKSUMソケットオプションに入力のときに容認されたチェックサムについて確かめて、チェックサムが間違っているならパケットを捨てながらカーネル(1)が出力、および(2)のためにチェックサムを計算して、保存するのを持つように設定しなければなりません。 このオプションは、アプリケーションがそれらが送るパケットにソースアドレス選択を実行しなければならないのを防ぎます。 チェックサムは[RFC1883]のセクション8.1で定義されたIPv6疑似ヘッダーを組み込むでしょう。 また、この新しいソケットオプションはチェックサムが位置しているところに関する利用者データに相殺された整数を指定します。

    int  offset = 2;
    setsockopt(fd, IPPROTO_IPV6, IPV6_CHECKSUM, &offset, sizeof(offset));

intは=2を相殺しました。 setsockopt(fd、IPPROTO_IPV6、IPV6_CHECKSUM、およびオフセット、sizeof(相殺します))。

   By default, this socket option is disabled.  Setting the offset to -1
   also disables the option.  By disabled we mean (1) the kernel will
   not calculate and store a checksum for outgoing packets, and (2) the
   kernel will not verify a checksum for received packets.

デフォルトで、このソケットオプションは障害があります。 また、-1にオフセットを設定すると、オプションは無効にされます。 (2) 身体障害者で、私たちは、(1) カーネルが出発しているパケットのためにチェックサムを計算して、保存しないと言っています、そして、カーネルは容認されたパケットのためにチェックサムについて確かめないでしょう。

   (Note: Since the checksum is always calculated by the kernel for an
   ICMPv6 socket, applications are not able to generate ICMPv6 packets
   with incorrect checksums (presumably for testing purposes) using this
   API.)

(注意: チェックサムがICMPv6ソケットのためにいつもカーネルによって計算されるので、アプリケーションは不正確なチェックサム(おそらくテスト目的のための)でこのAPIを使用することでICMPv6にパケットを生成することができません。)

3.2.  ICMPv6 Type Filtering

3.2. ICMPv6タイプフィルタリング

   ICMPv4 raw sockets receive most ICMPv4 messages received by the
   kernel.  (We say "most" and not "all" because Berkeley-derived
   kernels never pass echo requests, timestamp requests, or address mask
   requests to a raw socket.  Instead these three messages are processed
   entirely by the kernel.)  But ICMPv6 is a superset of ICMPv4, also
   including the functionality of IGMPv4 and ARPv4.  This means that an
   ICMPv6 raw socket can potentially receive many more messages than
   would be received with an ICMPv4 raw socket: ICMP messages similar to
   ICMPv4, along with neighbor solicitations, neighbor advertisements,
   and the three group membership messages.

ICMPv4の生のソケットはカーネルによって受け取られたほとんどのICMPv4メッセージを受け取ります。 (バークレーによって派生させられたカーネルがエコー要求、タイムスタンプ要求、またはアドレスマスク要求に生のソケットに決して合格しないので、私たちは「すべて」ではなく“most"を言います。 代わりに、これらの3つのメッセージが完全にカーネルによって処理されます。) しかし、ICMPv6はまた、IGMPv4とARPv4の機能性を含むICMPv4のスーパーセットです。 これは、ICMPv6の生のソケットがICMPv4の生のソケットで受け取るだろうより潜在的にずっと多くのメッセージを受け取ることができることを意味します: 隣人懇願、隣人広告、および3に伴うICMPv4と同様のICMPメッセージは会員資格メッセージを分類します。

Stevens & Thomas             Informational                     [Page 14]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[14ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   Most applications using an ICMPv6 raw socket care about only a small
   subset of the ICMPv6 message types.  To transfer extraneous ICMPv6
   messages from the kernel to user can incur a significant overhead.
   Therefore this API includes a method of filtering ICMPv6 messages by
   the ICMPv6 type field.

ICMPv6の生のソケットを使用するほとんどのアプリケーションがICMPv6メッセージタイプの小さい部分集合だけを心配します。 カーネルからユーザまで異質なICMPv6メッセージを移すのは重要なオーバーヘッドを被ることができます。 したがって、このAPIはICMPv6タイプ分野のそばでICMPv6メッセージをフィルターにかけるメソッドを含んでいます。

   Each ICMPv6 raw socket has an associated filter whose datatype is
   defined as

ICMPv6の生のソケットがデータ型式が定義される関連フィルタを持っているそれぞれ

       struct icmp6_filter;

struct icmp6_フィルタ。

   This structure, along with the macros and constants defined later in
   this section, are defined as a result of including the
   <netinet/icmp6.h> header.

<netinet/icmp6.h>ヘッダーを含んでいることの結果、この構造は後でこのセクションで定義されたマクロと定数と共に定義されます。

   The current filter is fetched and stored using getsockopt() and
   setsockopt() with a level of IPPROTO_ICMPV6 and an option name of
   ICMP6_FILTER.

現在のフィルタは、IPPROTO_ICMPV6のレベルとオプション名(ICMP6_FILTER)があるgetsockopt()とsetsockopt()を使用することでとって来られて、保存されます。

   Six macros operate on an icmp6_filter structure:

6つのマクロがicmp6_フィルタ構造を作動させます:

       void ICMP6_FILTER_SETPASSALL (struct icmp6_filter *);
       void ICMP6_FILTER_SETBLOCKALL(struct icmp6_filter *);

ICMP6_FILTER_SETPASSALL(struct icmp6_フィルタ*)を欠如させてください。 ICMP6_FILTER_SETBLOCKALL(struct icmp6_フィルタ*)を欠如させてください。

       void ICMP6_FILTER_SETPASS ( int, struct icmp6_filter *);
       void ICMP6_FILTER_SETBLOCK( int, struct icmp6_filter *);

ICMP6_FILTER_SETPASS(int、struct icmp6_フィルタ*)を欠如させてください。 ICMP6_FILTER_SETBLOCK(int、struct icmp6_フィルタ*)を欠如させてください。

       int  ICMP6_FILTER_WILLPASS (int, const struct icmp6_filter *);
       int  ICMP6_FILTER_WILLBLOCK(int, const struct icmp6_filter *);

int ICMP6_FILTER_WILLPASS(int、const struct icmp6_フィルタ*)。 int ICMP6_FILTER_WILLBLOCK(int、const struct icmp6_フィルタ*)。

   The first argument to the last four macros (an integer) is an ICMPv6
   message type, between 0 and 255.  The pointer argument to all six
   macros is a pointer to a filter that is modified by the first four
   macros examined by the last two macros.

最後の4つのマクロ(整数)への最初の議論は、0〜255歳のICMPv6メッセージタイプです。 すべての6つのマクロへの指針議論は最後の2つのマクロによって調べられた最初の4つのマクロによって変更されるフィルタへの指針です。

   The first two macros, SETPASSALL and SETBLOCKALL, let us specify that
   all ICMPv6 messages are passed to the application or that all ICMPv6
   messages are blocked from being passed to the application.

最初の2つのマクロ(SETPASSALLとSETBLOCKALL)が、すべてのICMPv6メッセージがアプリケーションに通過されるか、またはすべてのICMPv6メッセージがアプリケーションに通過されるのが妨げられると指定しましょう。

   The next two macros, SETPASS and SETBLOCK, let us specify that
   messages of a given ICMPv6 type should be passed to the application
   or not passed to the application (blocked).

次の2つのマクロ(SETPASSとSETBLOCK)が、与えられたICMPv6タイプに関するメッセージがアプリケーションに通過されるべきではありませんし、アプリケーション(妨げられる)に通過されるべきでないと指定しましょう。

   The final two macros, WILLPASS and WILLBLOCK, return true or false
   depending whether the specified message type is passed to the
   application or blocked from being passed to the application by the
   filter pointed to by the second argument.

指定されたメッセージタイプが2番目の議論で示されたフィルタによってアプリケーションに通過されるか、またはアプリケーションに通過されるのが妨げられるかによりながら、最終的な2つのマクロ(WILLPASSとWILLBLOCK)が、本当にか虚偽で戻ります。

Stevens & Thomas             Informational                     [Page 15]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[15ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   When an ICMPv6 raw socket is created, it will by default pass all
   ICMPv6 message types to the application.

ICMPv6の生のソケットが作成されるとき、それはデフォルトですべてのICMPv6メッセージタイプをアプリケーションに通過するでしょう。

   As an example, a program that wants to receive only router
   advertisements could execute the following:

例として、ルータ通知だけを受け取りたがっているプログラムは以下を実行するかもしれません:

struct icmp6_filter  myfilt;

struct icmp6_フィルタmyfilt。

fd = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6);

fdはソケット(PF_INET6、SOCK_RAW、IPPROTO_ICMPV6)と等しいです。

ICMP6_FILTER_SETBLOCKALL(&myfilt);
ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &myfilt);
setsockopt(fd, IPPROTO_ICMPV6, ICMP6_FILTER, &myfilt, sizeof(myfilt));

ICMP6_フィルタ_SETBLOCKALL(myfilt)。 ICMP6_フィルタ_SETPASS(_が言及するノースダコタ_ルータ、およびmyfilt)。 setsockopt(fd、IPPROTO_ICMPV6、ICMP6_FILTER、およびmyfilt、sizeof(myfilt))。

   The filter structure is declared and then initialized to block all
   messages types.  The filter structure is then changed to allow router
   advertisement messages to be passed to the application and the filter
   is installed using setsockopt().

フィルタ構造は、すべてのメッセージタイプを妨げるために宣言されて、次に、初期化されます。 次に、アプリケーションに通過するべきルータ通知メッセージを許容するためにフィルタ構造を変えます、そして、setsockopt()を使用することでフィルタをインストールします。

   The icmp6_filter structure is similar to the fd_set datatype used
   with the select() function in the sockets API.  The icmp6_filter
   structure is an opaque datatype and the application should not care
   how it is implemented.  All the application does with this datatype
   is allocate a variable of this type, pass a pointer to a variable of
   this type to getsockopt() and setsockopt(), and operate on a variable
   of this type using the six macros that we just defined.

icmp6_フィルタ構造はソケットAPIでの選んだ()機能と共に使用されるfd_セットデータ型式と同様です。 icmp6_フィルタ構造は不透明なデータ型式です、そして、アプリケーションはそれがどのように実装されるかを気にかけるべきではありません。 アプリケーションがこのデータ型式でするのは、このタイプの変数を割り当てて、getsockopt()とsetsockopt()へのこのタイプの変数に指針を通過して、私たちがただ定義した6つのマクロを使用することでこのタイプの変数を作動させることです。

   Nevertheless, it is worth showing a simple implementation of this
   datatype and the six macros.

それにもかかわらず、このデータ型式と6つのマクロの簡単な実装を示している価値があります。

struct icmp6_filter {
  uint32_t  icmp6_filt[8];  /* 8*32 = 256 bits */
};

struct icmp6_はuint32_t icmp6_filt[8]; /*8*32 = 256ビット*/をフィルターにかけます。

#define ICMP6_FILTER_WILLPASS(type, filterp) \
    ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
    ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
#define ICMP6_FILTER_SETPASS(type, filterp) \
    ((((filterp)->icmp6_filt[(type) >> 5]) |=  (1 << ((type) & 31))))
#define ICMP6_FILTER_SETBLOCK(type, filterp) \
    ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))))
#define ICMP6_FILTER_SETPASSALL(filterp) \
    memset((filterp), 0xFF, sizeof(struct icmp6_filter))
#define ICMP6_FILTER_SETBLOCKALL(filterp) \
    memset((filterp), 0, sizeof(struct icmp6_filter))

#定義..タイプ..タイプ..タイプ..定義..タイプ..タイプ..タイプ..定義..タイプ; タイプ..タイプ..定義..タイプ..タイプ..タイプ..定義..フィルタ..定義((filterp)、0、sizeof(struct icmp6_フィルタ))

Stevens & Thomas             Informational                     [Page 16]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[16ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   (Note: These sample definitions have two limitations that an
   implementation may want to change.  The first four macros evaluate
   their first argument two times.  The second two macros require the
   inclusion of the <string.h> header for the memset() function.)

(以下に注意してください。 これらのサンプル定義には、実装が変えたがっているかもしれない2つの制限があります。 最初の4つのマクロが2回彼らの最初の議論を評価します。 2番目の2つのマクロがmemsetのために<string.h>ヘッダーの包含を必要とします。()、機能。)

4.  Ancillary Data

4. 補助データ

   4.2BSD allowed file descriptors to be transferred between separate
   processes across a UNIX domain socket using the sendmsg() and
   recvmsg() functions.  Two members of the msghdr structure,
   msg_accrights and msg_accrightslen, were used to send and receive the
   descriptors.  When the OSI protocols were added to 4.3BSD Reno in
   1990 the names of these two fields in the msghdr structure were
   changed to msg_control and msg_controllen, because they were used by
   the OSI protocols for "control information", although the comments in
   the source code call this "ancillary data".

4.2BSDは、ファイルディスクリプタがUNIXドメインソケットの向こう側に別々のプロセスの間に移されるのをsendmsgを使用することで許容しました。() そして、recvmsg() 機能。 msghdr構造の2個の部材(msg_accrightsとmsg_accrightslen)が、記述子を送って、受け取るのに使用されました。 ソースコードにおけるコメントですが、OSIプロトコルが1990年に4.3BSDリノに加えられて、それらが「制御情報」にOSIプロトコルによって使用されたのでmsghdr構造のこれらの2つの分野の名前がmsg_コントロールとmsg_controllenに変わったということであったときには、「補助データ」にこれに電話をしてください。

   Other than the OSI protocols, the use of ancillary data has been
   rare.  In 4.4BSD, for example, the only use of ancillary data with
   IPv4 is to return the destination address of a received UDP datagram
   if the IP_RECVDSTADDR socket option is set.  With Unix domain sockets
   ancillary data is still used to send and receive descriptors.

OSIプロトコルを除いて、補助データの使用はまれです。 4.4BSDでは、例えば、IPv4との補助データの唯一の使用はIP_RECVDSTADDRソケットオプションが設定されるなら容認されたUDPデータグラムの送付先アドレスを返すことです。 Unixドメインソケットと共に、補助データは、記述子を送って、受け取るのにまだ使用されています。

   Nevertheless the ancillary data fields of the msghdr structure
   provide a clean way to pass information in addition to the data that
   is being read or written.  The inclusion of the msg_control and
   msg_controllen members of the msghdr structure along with the cmsghdr
   structure that is pointed to by the msg_control member is required by
   the Posix.1g sockets API standard (which should be completed during
   1997).

それにもかかわらず、msghdr構造の補助データ分野は読まれるか、または書かれているデータに加えた情報を通過する清潔な方法を提供します。 msg_コントロールメンバーによって指さされるmsg_コントロールの包含とcmsghdr構造に伴うmsghdr構造のmsg_controllen部材はPosix.1gソケットAPI規格(1997の間、完成するべきである)によって必要とされます。

   In this document ancillary data is used to exchange the following
   optional information between the application and the kernel:

本書では補助データはアプリケーションとカーネルの間で以下の任意情報を交換するのに使用されます:

       1.  the send/receive interface and source/destination address,
       2.  the hop limit,
       3.  next hop address,
       4.  Hop-by-Hop options,
       5.  Destination options, and
       6.  Routing header.

1.、2 3 インタフェースとソース/送付先アドレスを送るか、または受け取ってください、そして、ホップ限界でありアドレス、4は次に跳びます。 ホップごとのオプション、5。 目的地オプション、および6。 ヘッダーを発送します。

   Before describing these uses in detail, we review the definition of
   the msghdr structure itself, the cmsghdr structure that defines an
   ancillary data object, and some functions that operate on the
   ancillary data objects.

詳細にこれらの用途について説明する前に、私たちはmsghdr構造自体、補助データオブジェクトを定義するcmsghdr構造、および補助データオブジェクトを作動させるいくつかの機能の定義を見直します。

Stevens & Thomas             Informational                     [Page 17]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[17ページ]のRFC IPv6 February 1998に、高度なソケットAPI

4.1.  The msghdr Structure

4.1. msghdr Structure

   The msghdr structure is used by the recvmsg() and sendmsg()
   functions.  Its Posix.1g definition is:

msghdr構造はrecvmsg()とsendmsg()機能によって使用されます。 Posix.1g定義は以下の通りです。

    struct msghdr {
      void      *msg_name;        /* ptr to socket address structure */
      socklen_t  msg_namelen;     /* size of socket address structure */
      struct iovec  *msg_iov;     /* scatter/gather array */
      size_t     msg_iovlen;      /* # elements in msg_iov */
      void      *msg_control;     /* ancillary data */
      socklen_t  msg_controllen;  /* ancillary data buffer length */
      int        msg_flags;       /* flags on received message */
    };

struct msghdrは*msg_名; _ソケットアドレス構造*/socklen t msg_namelenへの/*ptr; /*は、_配列*/サイズt msg_iovlenを点在するか、または集めます; msg_iov*/空間*msg_コントロールにおける/*#要素; _/*補助データ*/socklen t msg_controllen; /*補助データバッファ長*/int msg_が弛むという/*が容認されたメッセージ*/で旗を揚げさせるソケットアドレス構造*/struct iovec*msg_iovの/*サイズを欠如させます。

   The structure is declared as a result of including <sys/socket.h>.

<sys/socket.h>を含んでいることの結果、構造は申告されます。

   (Note: Before Posix.1g the two "void *" pointers were typically "char
   *", and the two socklen_t members and the size_t member were
   typically integers.  Earlier drafts of Posix.1g had the two socklen_t
   members as size_t, but Draft 6.6 of Posix.1g, apparently the final
   draft, changed these to socklen_t to simplify binary portability for
   64-bit implementations and to align Posix.1g with X/Open's Networking
   Services, Issue 5.  The change in msg_control to a "void *" pointer
   affects any code that increments this pointer.)

(以下に注意してください。 Posix.1gの前では、通常、2「空間*」指針は「炭*」でした、そして、通常、2人のsocklen_tメンバーとサイズ_tメンバーは整数でした。 Posix.1gの以前の草稿には、サイズ_tとして2人のsocklen_tメンバーがいましたが、Posix.1gのDraft6.6(明らかに最終的な草稿)は64ビットの実装のために2進の移植性を簡素化して、X/OpenのNetworking ServicesにPosix.1gを一直線にするために_tをsocklenするようにこれらを変えました、Issue5。 「空間*」指針へのmsg_コントロールにおける変化はこの指針を増加するどんなコードにも影響します。)

   Most Berkeley-derived implementations limit the amount of ancillary
   data in a call to sendmsg() to no more than 108 bytes (an mbuf).
   This API requires a minimum of 10240 bytes of ancillary data, but it
   is recommended that the amount be limited only by the buffer space
   reserved by the socket (which can be modified by the SO_SNDBUF socket
   option).  (Note: This magic number 10240 was picked as a value that
   should always be large enough.  108 bytes is clearly too small as the
   maximum size of a Type 0 Routing header is 376 bytes.)

ほとんどのバークレーによって派生させられた実装が呼び出しにおける、補助データの量をsendmsgに制限します。() 108バイト(mbuf)未満に。 このAPIは最低10240バイトの補助データを必要としますが、量がソケット(SO_SNDBUFソケットオプションで変更できる)によって予約されたバッファ領域だけによって制限されるのは、お勧めです。 (以下に注意してください。 このマジックナンバー10240は十分いつも大きいはずである値として選ばれました。 108バイトは、Type0ルート設定ヘッダーの最大サイズが376バイトであるので、明確にわずか過ぎます。)

4.2.  The cmsghdr Structure

4.2. cmsghdr Structure

   The cmsghdr structure describes ancillary data objects transferred by
   recvmsg() and sendmsg().  Its Posix.1g definition is:

cmsghdr構造はrecvmsgによって移された補助データオブジェクトについて説明します。() そして、sendmsg(). Posix.1g定義は以下の通りです。

    struct cmsghdr {
      socklen_t  cmsg_len;   /* #bytes, including this header */
      int        cmsg_level; /* originating protocol */
      int        cmsg_type;  /* protocol-specific type */
                 /* followed by unsigned char cmsg_data[]; */
    };

struct cmsghdr socklen_t cmsg_len; このヘッダー*/int cmsg_レベルを含んでいます; プロトコル*/int cmsg_タイプを溯源する/*; /*#バイト、未署名の炭のcmsg_データ[]があとに続いた/*プロトコル特有のタイプ*//*;*/。

   This structure is declared as a result of including <sys/socket.h>.

<sys/socket.h>を含んでいることの結果、この構造は申告されます。

Stevens & Thomas             Informational                     [Page 18]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[18ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   As shown in this definition, normally there is no member with the
   name cmsg_data[].  Instead, the data portion is accessed using the
   CMSG_xxx() macros, as described shortly.  Nevertheless, it is common
   to refer to the cmsg_data[] member.

この定義で示されるように、通常、メンバーは全く名前cmsg_データ[]と共にいません。 代わりに、データ部は、まもなく説明されるようにCMSG_xxx()マクロを使用することでアクセスされています。 それにもかかわらず、cmsg_データ[]メンバーについて言及するのは一般的です。

   (Note: Before Posix.1g the cmsg_len member was an integer, and not a
   socklen_t.  See the Note in the previous section for why socklen_t is
   used here.)

(以下に注意してください。 Posix.1gの前では、cmsg_lenメンバーはsocklen_tではなく、整数でした。 socklen_tがここで使用される理由のために前項のNoteを見てください。)

   When ancillary data is sent or received, any number of ancillary data
   objects can be specified by the msg_control and msg_controllen
   members of the msghdr structure, because each object is preceded by a
   cmsghdr structure defining the object's length (the cmsg_len member).
   Historically Berkeley-derived implementations have passed only one
   object at a time, but this API allows multiple objects to be passed
   in a single call to sendmsg() or recvmsg().  The following example
   shows two ancillary data objects in a control buffer.

補助データを送るか、または受け取るとき、補助データオブジェクトのどんな数もmsgによって指定されて、_コントロールとmsg_はmsghdr構造の部材をcontrollenします、オブジェクトの長さ(cmsg_lenメンバー)を定義するcmsghdr構造が各オブジェクトに先行するのでことであるかもしれません。 歴史的にバークレーによって派生させられた実装は一度に1個のオブジェクトだけを渡しましたが、このAPIは、複数のオブジェクトがただ一つの呼び出しでsendmsg()かrecvmsg()に渡されるのを許容します。 以下の例はコントロールバッファの2個の補助データオブジェクトを示しています。

|<--------------------------- msg_controllen -------------------------->|
|                                                                       |
|<----- ancillary data object ----->|<----- ancillary data object ----->|
|<---------- CMSG_SPACE() --------->|<---------- CMSG_SPACE() --------->|
|                                   |                                   |
|<---------- cmsg_len ---------->|  |<--------- cmsg_len ----------->|  |
|<--------- CMSG_LEN() --------->|  |<-------- CMSG_LEN() ---------->|  |
|                                |  |                                |  |
+-----+-----+-----+--+-----------+--+-----+-----+-----+--+-----------+--+
|cmsg_|cmsg_|cmsg_|XX|           |XX|cmsg_|cmsg_|cmsg_|XX|           |XX|
|len  |level|type |XX|cmsg_data[]|XX|len  |level|type |XX|cmsg_data[]|XX|
+-----+-----+-----+--+-----------+--+-----+-----+-----+--+-----------+--+
 ^
 |
msg_control
points here

| <、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-、-- msg_controllen-------------------------->|、|、| | <、-、-、-、-- 補助データオブジェクト----->| <、-、-、-、-- 補助データオブジェクト----->| | <、-、-、-、-、-、-、-、-、-- CMSG_スペース()--------->| <、-、-、-、-、-、-、-、-、-- CMSG_スペース()--------->|、|、|、| | <、-、-、-、-、-、-、-、-、-- cmsg_len---------->| | <、-、-、-、-、-、-、-、-- cmsg_len----------->|、| | <、-、-、-、-、-、-、-、-- CMSG_レン()--------->| | <、-、-、-、-、-、-、-- CMSG_レン()---------->|、|、|、|、|、|、| +-----+-----+-----+--+-----------+--+-----+-----+-----+--+-----------+--+ |cmsg_|cmsg_|cmsg_|XX| |XX|cmsg_|cmsg_|cmsg_|XX| |XX| |len|レベル|タイプ|XX|cmsg_データ[]|XX|len|レベル|タイプ|XX|cmsg_データ[]|XX| +-----+-----+-----+--+-----------+--+-----+-----+-----+--+-----------+--+ ^ | ここのmsg_制御点

   The fields shown as "XX" are possible padding, between the cmsghdr
   structure and the data, and between the data and the next cmsghdr
   structure, if required by the implementation.

"XX"として示された分野は必要なら実装によるcmsghdr構造とデータと、データと隣のcmsghdr構造の間の可能な詰め物です。

4.3.  Ancillary Data Object Macros

4.3. 補助データオブジェクトマクロ

   To aid in the manipulation of ancillary data objects, three macros
   from 4.4BSD are defined by Posix.1g: CMSG_DATA(), CMSG_NXTHDR(), and
   CMSG_FIRSTHDR().  Before describing these macros, we show the
   following example of how they might be used with a call to recvmsg().

補助データオブジェクトの操作で支援するために、4.4BSDからの3つのマクロがPosix.1gによって定義されます: CMSG_データ()、CMSG_NXTHDR()、およびCMSG_FIRSTHDR()。 これらのマクロについて説明する前に、私たちはそれらが呼び出しと共にrecvmsg()にどう使用されるかもしれないかに関する以下の例を示しています。

    struct msghdr   msg;
    struct cmsghdr  *cmsgptr;

struct msghdr msg。 struct cmsghdr*cmsgptr。

Stevens & Thomas             Informational                     [Page 19]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[19ページ]のRFC IPv6 February 1998に、高度なソケットAPI

    /* fill in msg */

msg*/での/*中詰め

    /* call recvmsg() */

/*呼び出しrecvmsg()*/

    for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
         cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
        if (cmsgptr->cmsg_level == ... && cmsgptr->cmsg_type == ... ) {
            u_char  *ptr;

(cmsgptr=CMSG_FIRSTHDR(msg); cmsgptr!=NULL; cmsgptr=CMSG_NXTHDR(msg、cmsgptr))、(cmsgptr>のcmsg_レベル= … cmsgptr>のcmsg_タイプ=…)、u_炭*のptr。

            ptr = CMSG_DATA(cmsgptr);
            /* process data pointed to by ptr */
        }
    }

ptrはCMSG_DATAと等しいです(cmsgptr)。 /*プロセスデータはptr*/を示しました。 }

   We now describe the three Posix.1g macros, followed by two more that
   are new with this API: CMSG_SPACE() and CMSG_LEN().  All these macros
   are defined as a result of including <sys/socket.h>.

私たちは現在、3つのPosix.1gマクロについて説明して、続いてもうこのAPIで新しい2について説明します: CMSG_スペース()とCMSG_LEN()。 <sys/socket.h>を含んでいることの結果、これらのすべてのマクロが定義されます。

4.3.1.  CMSG_FIRSTHDR

4.3.1. CMSG_FIRSTHDR

       struct cmsghdr *CMSG_FIRSTHDR(const struct msghdr *mhdr);

struct cmsghdr*CMSG_FIRSTHDR(const struct msghdr*mhdr)。

   CMSG_FIRSTHDR() returns a pointer to the first cmsghdr structure in
   the msghdr structure pointed to by mhdr.  The macro returns NULL if
   there is no ancillary data pointed to the by msghdr structure (that
   is, if either msg_control is NULL or if msg_controllen is less than
   the size of a cmsghdr structure).

CMSG_FIRSTHDR()はmhdrによって示されたmsghdr構造における最初のcmsghdr構造に指針を返します。 示された補助データが全くなければマクロがNULLを返す、msghdrに、構造化します(すなわち、msg_コントロールはNULLであるかどうかかmsg_controllenはcmsghdr構造のサイズより少ないかどうか)。

   One possible implementation could be

1つの可能な実装がそうであるかもしれません。

       #define CMSG_FIRSTHDR(mhdr) \
           ( (mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
             (struct cmsghdr *)(mhdr)->msg_control : \
             (struct cmsghdr *)NULL )

#CMSG_FIRSTHDR(mhdr)\を定義してください。((mhdr) ->msg_controllen>はsizeof(struct cmsghdr)?\(struct cmsghdr*)(mhdr)->msg_コントロールと等しいです: \(struct cmsghdr*)NULL)

   (Note: Most existing implementations do not test the value of
   msg_controllen, and just return the value of msg_control.  The value
   of msg_controllen must be tested, because if the application asks
   recvmsg() to return ancillary data, by setting msg_control to point
   to the application's buffer and setting msg_controllen to the length
   of this buffer, the kernel indicates that no ancillary data is
   available by setting msg_controllen to 0 on return.  It is also
   easier to put this test into this macro, than making the application
   perform the test.)

(以下に注意してください。 ほとんどの既存の実装は、msg_controllenの値をテストして、ただmsg_コントロールの値を返しません。 msg_controllenの値をテストしなければならない、アプリケーションはrecvmsgに尋ねます。()、msg_コントロールにアプリケーションのバッファを示すように設定して、このバッファの長さにmsg_controllenを設定することによって補助データを返すには、カーネルは、どんな補助データも0へのmsg_controllenをリターンにけしかけることによって利用可能でないことを示します。 また、このマクロにこのテストを入れるのもアプリケーションにテストを実行させるより簡単です。)

Stevens & Thomas             Informational                     [Page 20]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[20ページ]のRFC IPv6 February 1998に、高度なソケットAPI

4.3.2.  CMSG_NXTHDR

4.3.2. CMSG_NXTHDR

       struct cmsghdr *CMSG_NXTHDR(const struct msghdr *mhdr,
                                   const struct cmsghdr *cmsg);

struct cmsghdr*CMSG_NXTHDR(const struct msghdr*mhdr、const struct cmsghdr*cmsg)。

   CMSG_NXTHDR() returns a pointer to the cmsghdr structure describing
   the next ancillary data object.  mhdr is a pointer to a msghdr
   structure and cmsg is a pointer to a cmsghdr structure.  If there is
   not another ancillary data object, the return value is NULL.

CMSG_NXTHDR()は次の補助データオブジェクトについて説明するcmsghdr構造に指針を返します。mhdrはmsghdr構造への指針です、そして、cmsgはcmsghdr構造への指針です。 別の補助データオブジェクトがなければ、リターン値はNULLです。

   The following behavior of this macro is new to this API: if the value
   of the cmsg pointer is NULL, a pointer to the cmsghdr structure
   describing the first ancillary data object is returned.  That is,
   CMSG_NXTHDR(mhdr, NULL) is equivalent to CMSG_FIRSTHDR(mhdr).  If
   there are no ancillary data objects, the return value is NULL.  This
   provides an alternative way of coding the processing loop shown
   earlier:

このマクロの以下の振舞いはこのAPIに新しいです: cmsg指針の値がNULLであるなら、最初の補助データオブジェクトについて説明するcmsghdr構造への指針を返します。 すなわち、CMSG_NXTHDR(mhdr、NULL)はCMSG_FIRSTHDR(mhdr)に同等です。 補助データオブジェクトが全くなければ、リターン値はNULLです。 これは、より早く示された処理ループをコード化する代替の方法で提供されます:

struct msghdr  msg;
struct cmsghdr  *cmsgptr = NULL;

struct msghdr msg。 struct cmsghdr*cmsgptrはNULLと等しいです。

/* fill in msg */

msg*/での/*中詰め

/* call recvmsg() */

/*呼び出しrecvmsg()*/

while ((cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) != NULL) {
    if (cmsgptr->cmsg_level == ... && cmsgptr->cmsg_type == ... ) {
        u_char  *ptr;

(cmsgptr=CMSG_NXTHDR(msg、cmsgptr)!=NULL)である、(cmsgptr>のcmsg_レベル= … cmsgptr>のcmsg_タイプ=…)、u_炭*のptr。

        ptr = CMSG_DATA(cmsgptr);
        /* process data pointed to by ptr */
    }
}

ptrはCMSG_DATAと等しいです(cmsgptr)。 /*プロセスデータはptr*/を示しました。 }

   One possible implementation could be:

1つの可能な実装は以下の通りであるかもしれません。

    #define CMSG_NXTHDR(mhdr, cmsg) \
        ( ((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \
          (((u_char *)(cmsg) + ALIGN((cmsg)->cmsg_len) \
                             + ALIGN(sizeof(struct cmsghdr)) > \
            (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ? \
           (struct cmsghdr *)NULL : \
           (struct cmsghdr *)((u_char *)(cmsg) + ALIGN((cmsg)->cmsg_len))) )

#CMSG_NXTHDR(mhdr、cmsg)\を定義してください。炭..炭..コントロール..炭

   The macro ALIGN(), which is implementation dependent, rounds its
   argument up to the next even multiple of whatever alignment is
   required (probably a multiple of 4 or 8 bytes).

マクロALIGN()(実装に依存している)は議論を必要であるどんな整列(たぶん4バイトか8バイトの倍数)の次の同等の倍数までも一周させます。

Stevens & Thomas             Informational                     [Page 21]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[21ページ]のRFC IPv6 February 1998に、高度なソケットAPI

4.3.3.  CMSG_DATA

4.3.3. CMSG_データ

       unsigned char *CMSG_DATA(const struct cmsghdr *cmsg);

未署名の炭*のCMSG_DATA(const struct cmsghdr*cmsg)。

   CMSG_DATA() returns a pointer to the data (what is called the
   cmsg_data[] member, even though such a member is not defined in the
   structure) following a cmsghdr structure.

CMSG_DATA()が指針をデータに返す、(そのようなメンバーは構造) 次のa cmsghdr構造で定義されませんが、何がcmsg_データ[]メンバーと呼ばれますか?

   One possible implementation could be:

1つの可能な実装は以下の通りであるかもしれません。

       #define CMSG_DATA(cmsg) ( (u_char *)(cmsg) + \
                                 ALIGN(sizeof(struct cmsghdr)) )

#CMSG_DATA(cmsg)を定義してください。((u_炭*)(cmsg)+\ALIGN(sizeof(struct cmsghdr)))

4.3.4.  CMSG_SPACE

4.3.4. CMSG_スペース

       unsigned int CMSG_SPACE(unsigned int length);

未署名のint CMSG_SPACE(未署名のintの長さ)。

   This macro is new with this API.  Given the length of an ancillary
   data object, CMSG_SPACE() returns the space required by the object
   and its cmsghdr structure, including any padding needed to satisfy
   alignment requirements.  This macro can be used, for example, to
   allocate space dynamically for the ancillary data.  This macro should
   not be used to initialize the cmsg_len member of a cmsghdr structure;
   instead use the CMSG_LEN() macro.

このマクロはこのAPIで新しいです。 補助データオブジェクトの長さを考えて、CMSG_SPACE()は目的とそのcmsghdr構造によって必要とされたスペースを返します、整列要求を満たすのに必要であるどんな詰め物も含んでいて。 例えば、補助データのためにダイナミックにスペースを割り当てるのにこのマクロを使用できます。 cmsghdr構造のcmsg_len部材を初期化するのにこのマクロを使用するべきではありません。 代わりにCMSG_LEN()マクロを使用してください。

   One possible implementation could be:

1つの可能な実装は以下の通りであるかもしれません。

       #define CMSG_SPACE(length) ( ALIGN(sizeof(struct cmsghdr)) + \
                                    ALIGN(length) )

#CMSG_SPACE(長さ)を定義してください。(ALIGN(sizeof(struct cmsghdr))+\ALIGN(長さ))

4.3.5.  CMSG_LEN

4.3.5. CMSG_レン

       unsigned int CMSG_LEN(unsigned int length);

未署名のint CMSG_LEN(未署名のintの長さ)。

   This macro is new with this API.  Given the length of an ancillary
   data object, CMSG_LEN() returns the value to store in the cmsg_len
   member of the cmsghdr structure, taking into account any padding
   needed to satisfy alignment requirements.

このマクロはこのAPIで新しいです。 補助データオブジェクトの長さを考えて、CMSG_LEN()はcmsghdr構造のcmsg_len部材に保存する値を返します、整列要求を満たすのに必要であるどんな詰め物も考慮に入れて。

   One possible implementation could be:

1つの可能な実装は以下の通りであるかもしれません。

       #define CMSG_LEN(length) ( ALIGN(sizeof(struct cmsghdr)) + length
       )

#CMSG_LEN(長さ)を定義してください。(ALIGN(sizeof(struct cmsghdr))+長さ)

Stevens & Thomas             Informational                     [Page 22]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[22ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   Note the difference between CMSG_SPACE() and CMSG_LEN(), shown also
   in the figure in Section 4.2: the former accounts for any required
   padding at the end of the ancillary data object and the latter is the
   actual length to store in the cmsg_len member of the ancillary data
   object.

また、セクション4.2の図に示されて、CMSG_SPACE()とCMSG_LEN()の違いに注意してください: 前者は補助データオブジェクトの端のどんな必要な詰め物も説明します、そして、後者は補助データオブジェクトのcmsg_lenメンバーに保存する実際の長さです。

4.4.  Summary of Options Described Using Ancillary Data

4.4. オプションの概要は、補助データを使用すると説明しました。

   There are six types of optional information described in this
   document that are passed between the application and the kernel using
   ancillary data:

アプリケーションと補助データを使用するカーネルの間で通過される本書では説明された任意の情報の6つのタイプがあります:

       1.  the send/receive interface and source/destination address,
       2.  the hop limit,
       3.  next hop address,
       4.  Hop-by-Hop options,
       5.  Destination options, and
       6.  Routing header.

1.、2 3 インタフェースとソース/送付先アドレスを送るか、または受け取ってください、そして、ホップ限界でありアドレス、4は次に跳びます。 ホップごとのオプション、5。 目的地オプション、および6。 ヘッダーを発送します。

   First, to receive any of this optional information (other than the
   next hop address, which can only be set), the application must call
   setsockopt() to turn on the corresponding flag:

まず最初に、この任意情報(設定できるだけである次のホップアドレスを除いた)のどれかを受け取るなら、アプリケーションは、対応する旗をつけるためにsetsockopt()と呼ばなければなりません:

       int  on = 1;

=1のint。

       setsockopt(fd, IPPROTO_IPV6, IPV6_PKTINFO,  &on, sizeof(on));
       setsockopt(fd, IPPROTO_IPV6, IPV6_HOPLIMIT, &on, sizeof(on));
       setsockopt(fd, IPPROTO_IPV6, IPV6_HOPOPTS,  &on, sizeof(on));
       setsockopt(fd, IPPROTO_IPV6, IPV6_DSTOPTS,  &on, sizeof(on));
       setsockopt(fd, IPPROTO_IPV6, IPV6_RTHDR,    &on, sizeof(on));

setsockopt、(fd、IPV6_PKTINFOの、そして、オンなIPPROTO_IPV6、sizeof(on))。 setsockopt、(fd、IPV6_HOPLIMITの、そして、オンなIPPROTO_IPV6、sizeof(on))。 setsockopt、(fd、IPV6_HOPOPTSの、そして、オンなIPPROTO_IPV6、sizeof(on))。 setsockopt、(fd、IPV6_DSTOPTSの、そして、オンなIPPROTO_IPV6、sizeof(on))。 setsockopt、(fd、IPV6_RTHDRの、そして、オンなIPPROTO_IPV6、sizeof(on))。

   When any of these options are enabled, the corresponding data is
   returned as control information by recvmsg(), as one or more
   ancillary data objects.

これらのオプションのどれかが可能にされるとき、対応するデータは制御情報としてrecvmsg()によって返されます、1個以上の補助データオブジェクトとして。

   Nothing special need be done to send any of this optional
   information; the application just calls sendmsg() and specifies one
   or more ancillary data objects as control information.

この任意情報のどれかを送るために何も特別なことをする必要はありません。 アプリケーションは、制御情報としてただsendmsg()と呼んで、1個以上の補助データオブジェクトを指定します。

   We also summarize the three cmsghdr fields that describe the
   ancillary data objects:

また、私たちは補助データオブジェクトについて説明する3つのcmsghdr分野をまとめます:

       cmsg_level    cmsg_type      cmsg_data[]               #times
       ------------  ------------   ------------------------  ------
       IPPROTO_IPV6  IPV6_PKTINFO   in6_pktinfo structure     once
       IPPROTO_IPV6  IPV6_HOPLIMIT  int                       once
       IPPROTO_IPV6  IPV6_NEXTHOP   socket address structure  once
       IPPROTO_IPV6  IPV6_HOPOPTS   implementation dependent  mult.

cmsg_レベルcmsg_タイプcmsg_データ[]#回数------------ ------------ ------------------------ ------ いったんIPPROTO_IPV6 IPV6_HOPOPTS実装に依存しているとIPPROTO_IPV6 IPV6_NEXTHOPソケットがいったん構造を扱うと、かつてのIPPROTO_IPV6 IPV6_PKTINFO in6_pktinfo構造IPPROTO_IPV6 IPV6_HOPLIMIT intはmultします。

Stevens & Thomas             Informational                     [Page 23]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[23ページ]のRFC IPv6 February 1998に、高度なソケットAPI

       IPPROTO_IPV6  IPV6_DSTOPTS   implementation dependent  mult.
       IPPROTO_IPV6  IPV6_RTHDR     implementation dependent  once

_のDSTOPTSの実装に依存するIPPROTO_IPV6 IPV6mult。 かつてIPPROTO_IPV6 IPV6_RTHDR実装に依存しています。

   The final column indicates how many times an ancillary data object of
   that type can appear as control information.  The Hop-by-Hop and
   Destination options can appear multiple times, while all the others
   can appear only one time.

最終的なコラムは、そのタイプの補助データオブジェクトが何回制御情報として現れることができるかを示します。 ホップによるHopとDestinationオプションは複数の回現れることができますが、すべての他のものがあるときだけ、現れることができます。

   All these options are described in detail in following sections.  All
   the constants beginning with IPV6_ are defined as a result of
   including the <netinet/in.h> header.

これらのすべてのオプションが以下の章で詳細に説明されます。 <netinet/in.h>ヘッダーを含んでいることの結果、IPV6_で始まるすべての定数が定義されます。

   (Note: We intentionally use the same constant for the cmsg_level
   member as is used as the second argument to getsockopt() and
   setsockopt() (what is called the "level"), and the same constant for
   the cmsg_type member as is used as the third argument to getsockopt()
   and setsockopt() (what is called the "option name").  This is
   consistent with the existing use of ancillary data in 4.4BSD:
   returning the destination address of an IPv4 datagram.)

私たちは3番目の議論としてgetsockopt()とsetsockopt()(いわゆる「オプション名」)に慣れているcmsg_タイプメンバーに故意に同じ2番目の議論としてgetsockopt()とsetsockopt()(いわゆる「レベル」)に慣れているcmsg_レベルメンバーにとって一定で、同じ定数を使用します。(注意: これは4.4BSDにおける補助データの既存の使用と一致しています: IPv4データグラムの送付先アドレスを返します。)

   (Note: It is up to the implementation what it passes as ancillary
   data for the Hop-by-Hop option, Destination option, and Routing
   header option, since the API to these features is through a set of
   inet6_option_XXX() and inet6_rthdr_XXX() functions that we define
   later.  These functions serve two purposes: to simplify the interface
   to these features (instead of requiring the application to know the
   intimate details of the extension header formats), and to hide the
   actual implementation from the application.  Nevertheless, we show
   some examples of these features that store the actual extension
   header as the ancillary data.  Implementations need not use this
   technique.)

(以下に注意してください。 実装まで、API以来それがホップによるHopオプション、Destinationオプション、およびルート設定ヘッダーオプションのための補助データとしてこれらの特徴に通過するものが_inet6_オプションXXXの1セットを通して達しているということです。()、inet6_rthdr_XXX()、私たちが後で定義する機能。 これらの機能は2つの目的に役立ちます: これらの特徴(拡大ヘッダー形式の詳細な詳細を知るためにアプリケーションを必要とすることの代わりに)にインタフェースを簡素化して、実際の実装をアプリケーションから隠すために。 それにもかかわらず、私たちは補助データとして実際の拡張ヘッダーを保存するこれらの特徴に関するいくつかの例を示しています。 実装はこのテクニックを使用する必要はありません。)

4.5.  IPV6_PKTOPTIONS Socket Option

4.5. IPV6_PKTOPTIONSソケットオプション

   The summary in the previous section assumes a UDP socket.  Sending
   and receiving ancillary data is easy with UDP: the application calls
   sendmsg() and recvmsg() instead of sendto() and recvfrom().

前項の概要はUDPソケットを仮定します。 送受信補助データはUDPで簡単です: sendto()の代わりにアプリケーション呼び出しのsendmsg()とrecvmsg()とrecvfrom()。

   But there might be cases where a TCP application wants to send or
   receive this optional information.  For example, a TCP client might
   want to specify a Routing header and this needs to be done before
   calling connect().  Similarly a TCP server might want to know the
   received interface after accept() returns along with any Destination
   options.

しかし、ケースがTCPアプリケーションがこの任意情報を送りたいか、または受け取りたがっているところにあるかもしれません。 例えば、TCPクライアントはルート設定ヘッダーを指定したがっているかもしれません、そして、この呼ぶ前にされるべき必要性は()を接続します。 同様に、TCPサーバは、容認されたインタフェースが後に() どんなDestinationオプションに伴うリターンも受け入れるのを知りたがっているかもしれません。

Stevens & Thomas             Informational                     [Page 24]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[24ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   A new socket option is defined that provides access to the optional
   information described in the previous section, but without using
   recvmsg() and sendmsg().  Setting the socket option specifies any of
   the optional output fields:

新しい前項で説明された任意情報へのアクセスを提供しますが、recvmsg()とsendmsg()を使用しないでそうするソケットオプションは定義されます。 ソケットオプションを設定すると、任意の出力フィールドのどれかは指定されます:

       setsockopt(fd, IPPROTO_IPV6, IPV6_PKTOPTIONS, &buf, len);

setsockopt(fd、IPPROTO_IPV6、IPV6_PKTOPTIONS、およびbuf、len)。

   The fourth argument points to a buffer containing one or more
   ancillary data objects, and the fifth argument is the total length of
   all these objects.  The application fills in this buffer exactly as
   if the buffer were being passed to sendmsg() as control information.

4番目の議論は1個以上の補助データオブジェクトを入れてあるバッファを示します、そして、5番目の議論はこれらのすべてのオブジェクトの全長です。 まるでちょうどバッファが制御情報としてsendmsg()に渡されているかのようにアプリケーションはこのバッファに記入します。

   The options set by calling setsockopt() for IPV6_PKTOPTIONS are
   called "sticky" options because once set they apply to all packets
   sent on that socket.  The application can call setsockopt() again to
   change all the sticky options, or it can call setsockopt() with a
   length of 0 to remove all the sticky options for the socket.

IPV6_のためのsetsockopt()をPKTOPTIONSと呼ぶことによって設定されたオプションは、いったん設定されるとそのソケットに送られたすべてのパケットに適用するので、「ねばねばする」オプションと呼ばれます。 アプリケーションが、すべてのねばねばするオプションを変えるために再びsetsockopt()と呼ぶことができますか、またはそれはソケットのためのすべてのねばねばするオプションを取り除く0の長さがある呼び出しsetsockopt()を呼ぶことができます。

   The corresponding receive option

対応はオプションを受け取ります。

       getsockopt(fd, IPPROTO_IPV6, IPV6_PKTOPTIONS, &buf, &len);

getsockopt(fd、IPPROTO_IPV6、IPV6_PKTOPTIONS、buf、およびlen)。

   returns a buffer with one or more ancillary data objects for all the
   optional receive information that the application has previously
   specified that it wants to receive.  The fourth argument points to
   the buffer that is filled in by the call.  The fifth argument is a
   pointer to a value-result integer: when the function is called the
   integer specifies the size of the buffer pointed to by the fourth
   argument, and on return this integer contains the actual number of
   bytes that were returned.  The application processes this buffer
   exactly as if the buffer were returned by recvmsg() as control
   information.

1つ以上の補助データがあるバッファがすべての任意のために反対させるリターンはアプリケーションが、以前に受信したがっていると指定したという情報を受け取ります。 4番目の議論は呼び出しで記入されるバッファを示します。 5番目の議論は値結果整数への指針です: 機能が呼ばれるとき、整数は4番目の議論で示されたバッファのサイズを指定します、そして、リターンでは、この整数は返されたバイトの実数を含んでいます。 まるでちょうどバッファが制御情報としてrecvmsg()によって返されるかのようにアプリケーションはこのバッファを処理します。

   To simplify this document, in the remaining sections when we say "can
   be specified as ancillary data to sendmsg()" we mean "can be
   specified as ancillary data to sendmsg() or specified as a sticky
   option using setsockopt() and the IPV6_PKTOPTIONS socket option".
   Similarly when we say "can be returned as ancillary data by
   recvmsg()" we mean "can be returned as ancillary data by recvmsg() or
   returned by getsockopt() with the IPV6_PKTOPTIONS socket option".

私たちが言うとき、残っているセクションのこのドキュメントを簡素化するために、「補助データとして、sendmsg()に指定できること」を「setsockopt()とIPV6_PKTOPTIONSソケットオプションを使用することで補助データとしてsendmsg()に指定するか、またはねばねばするオプションとして指定できます」私たちが、言っている。 私たちが言うとき、同様に、「補助データとして、recvmsg()は返すことができること」を「IPV6_PKTOPTIONSソケットオプションと共にrecvmsg()が補助データとして返すか、またはgetsockopt()は返すことができます」私たちが、言っている。

4.5.1.  TCP Sticky Options

4.5.1. TCPのねばねばするオプション

   When using getsockopt() with the IPV6_PKTOPTIONS option and a TCP
   socket, only the options from the most recently received segment are
   retained and returned to the caller, and only after the socket option
   has been set.  That is, TCP need not start saving a copy of the
   options until the application says to do so.

IPV6_PKTOPTIONSオプションとTCPソケットがあるgetsockopt()を使用するとき、最も最近容認されたセグメントからの唯一のオプションは訪問者に保有されて、返されて、ソケットオプションが単に設定された後です。 すなわち、TCPは、アプリケーションがそうするために言うまでオプションのコピーを保存し始める必要はありません。

Stevens & Thomas             Informational                     [Page 25]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[25ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   The application is not allowed to specify ancillary data in a call to
   sendmsg() on a TCP socket, and none of the ancillary data that we
   describe in this document is ever returned as control information by
   recvmsg() on a TCP socket.

アプリケーションはTCPソケットの上に呼び出しにおける補助データをsendmsg()に指定できません、そして、私たちが説明する補助データのいずれもかつて、制御情報としてTCPソケットの上にrecvmsg()によって本書では返されません。

4.5.2.  UDP and Raw Socket Sticky Options

4.5.2. UDPと生のソケットねばねばするオプション

   The IPV6_PKTOPTIONS socket option can also be used with a UDP socket
   or with a raw IPv6 socket, normally to set some of the options once,
   instead of with each call to sendmsg().

また、通常、一度オプションのいくつかを設定するのにUDPソケットか生のIPv6ソケットと共にIPV6_PKTOPTIONSソケットオプションを使用できます、sendmsg()への各呼び出しの代わりに。

   Unlike the TCP case, the sticky options can be overridden on a per-
   packet basis with ancillary data specified in a call to sendmsg() on
   a UDP or raw IPv6 socket.  If any ancillary data is specified in a
   call to sendmsg(), none of the sticky options are sent with that
   datagram.

TCPケースと異なって、aでねばねばするオプションをくつがえすことができる、-、補助データがあるパケット基礎はUDPか生のIPv6ソケットの上に呼び出しでsendmsg()に指定しました。 何か補助データが呼び出しでsendmsg()に指定されるなら、ねばねばするオプションのいずれもそのデータグラムで送られません。

5.  Packet Information

5. パケット情報

   There are four pieces of information that an application can specify
   for an outgoing packet using ancillary data:

アプリケーションが補助データを使用することで出発しているパケットに指定できるという情報の4つの断片があります:

       1.  the source IPv6 address,
       2.  the outgoing interface index,
       3.  the outgoing hop limit, and
       4.  the next hop address.

1. ソースIPv6アドレス、2 外向的なインタフェースインデックス、3 外向的なホップ限界、および4 次のホップアドレス。

   Three similar pieces of information can be returned for a received
   packet as ancillary data:

容認されたパケットのために補助データとして3つの同様の情報を返すことができます:

       1.  the destination IPv6 address,
       2.  the arriving interface index, and
       3.  the arriving hop limit.

1. 送付先IPv6アドレス、2 到着しているインタフェースインデックス、および3 到着しているホップ限界。

   The first two pieces of information are contained in an in6_pktinfo
   structure that is sent as ancillary data with sendmsg() and received
   as ancillary data with recvmsg().  This structure is defined as a
   result of including the <netinet/in.h> header.

情報の最初の2つの断片が補助データとしてsendmsg()で送られて、補助データとしてrecvmsg()で受け取られるin6_pktinfo構造に含まれています。 <netinet/in.h>ヘッダーを含んでいることの結果、この構造は定義されます。

       struct in6_pktinfo {
         struct in6_addr ipi6_addr;    /* src/dst IPv6 address */
         unsigned int    ipi6_ifindex; /* send/recv interface index */
       };

struct in6_addr ipi6_addr; /*src/dst IPv6アドレス*/未署名のint ipi6_ifindex; /*が/recvインタフェースインデックス*/を送るstruct in6_pktinfo。

   In the cmsghdr structure containing this ancillary data, the
   cmsg_level member will be IPPROTO_IPV6, the cmsg_type member will be
   IPV6_PKTINFO, and the first byte of cmsg_data[] will be the first
   byte of the in6_pktinfo structure.

この補助データを含むcmsghdr構造では、cmsg_レベルメンバーはIPPROTO_IPV6でしょう、そして、cmsg_タイプメンバーはIPV6_PKTINFOでしょう、そして、cmsg_データ[]の最初のバイトはin6_pktinfo構造の最初のバイトになるでしょう。

Stevens & Thomas             Informational                     [Page 26]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[26ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   This information is returned as ancillary data by recvmsg() only if
   the application has enabled the IPV6_PKTINFO socket option:

アプリケーションがIPV6_PKTINFOソケットオプションを可能にした場合にだけ、この情報は補助データとしてrecvmsg()によって返されます:

       int  on = 1;
       setsockopt(fd, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on));

=1のint。 setsockopt、(fd、IPV6_PKTINFOの、そして、オンなIPPROTO_IPV6、sizeof(on))。

   Nothing special need be done to send this information: just specify
   the control information as ancillary data for sendmsg().

この情報を送るために何も特別なことをする必要はありません: sendmsg()のための補助データとしてただ制御情報を指定してください。

   (Note: The hop limit is not contained in the in6_pktinfo structure
   for the following reason.  Some UDP servers want to respond to client
   requests by sending their reply out the same interface on which the
   request was received and with the source IPv6 address of the reply
   equal to the destination IPv6 address of the request.  To do this the
   application can enable just the IPV6_PKTINFO socket option and then
   use the received control information from recvmsg() as the outgoing
   control information for sendmsg().  The application need not examine
   or modify the in6_pktinfo structure at all.  But if the hop limit
   were contained in this structure, the application would have to parse
   the received control information and change the hop limit member,
   since the received hop limit is not the desired value for an outgoing
   packet.)

(以下に注意してください。 ホップ限界は以下の理由によるin6_pktinfo構造に含まれていません。 いくつかのUDPサーバが要求がどれであったかに関して受け取って、同じように彼らの回答を出すのによる要求が連結するクライアントと要求の送付先IPv6アドレスと等しい回答のソースIPv6アドレスで応じたがっています。 アプリケーションは、これをするのに、まさしくIPV6_PKTINFOソケットオプションを可能にして、次に、recvmsgからの受信された制御情報を使用できます。()、sendmsgのための送信する制御情報(). アプリケーションは、全くin6_pktinfo構造を調べる必要はありませんし、また変更する必要はありません。 しかし、ホップ限界がこの構造に含まれているなら、アプリケーションは、受信された制御情報を分析して、ホップ限界メンバーを変えなければならないでしょうに、容認されたホップ限界が出発しているパケットのための目標値でないので。)

5.1.  Specifying/Receiving the Interface

5.1. インタフェースを指定するか、または受けます。

   Interfaces on an IPv6 node are identified by a small positive
   integer, as described in Section 4 of [RFC-2133].  That document also
   describes a function to map an interface name to its interface index,
   a function to map an interface index to its interface name, and a
   function to return all the interface names and indexes.  Notice from
   this document that no interface is ever assigned an index of 0.

IPv6ノードの上のインタフェースは[RFC-2133]のセクション4で説明されるようにわずかな正の整数によって特定されます。 また、そのドキュメントは、インタフェースインデックス(インタフェースインデックスをインタフェース名に写像して、すべてのインタフェースが命名するリターンとインデックスに機能を写像する機能)にインタフェース名を写像するために機能について説明します。 このドキュメントから、0のインデックスが今までにどんなインタフェースにも割り当てられないのに注意してください。

   When specifying the outgoing interface, if the ipi6_ifindex value is
   0, the kernel will choose the outgoing interface.  If the application
   specifies an outgoing interface for a multicast packet, the interface
   specified by the ancillary data overrides any interface specified by
   the IPV6_MULTICAST_IF socket option (described in [RFC-2133]), for
   that call to sendmsg() only.

ipi6_ifindex値が0であるなら外向的なインタフェースを指定するとき、カーネルは外向的なインタフェースを選ぶでしょう。 アプリケーションがマルチキャストパケットに外向的なインタフェースを指定するなら、補助データによって指定されたインタフェースは_ソケットオプション([RFC-2133]では、説明される)であるならIPV6_MULTICASTによって指定されたどんなインタフェースもくつがえします、sendmsg()だけへのその呼び出しのために。

   When the IPV6_PKTINFO socket option is enabled, the received
   interface index is always returned as the ipi6_ifindex member of the
   in6_pktinfo structure.

IPV6_PKTINFOソケットオプションが可能にされるとき、受け取られていているインタフェースインデックスはin6_pktinfo構造のipi6_ifindex部材としていつも返されます。

5.2.  Specifying/Receiving Source/Destination Address

5.2. 指定/受信ソース/送付先アドレス

   The source IPv6 address can be specified by calling bind() before
   each output operation, but supplying the source address together with
   the data requires less overhead (i.e., fewer system calls) and

そしてすなわち、それぞれが操作を出力する前にひもを()と呼ぶことによってソースIPv6アドレスを指定できますが、データと共にソースアドレスを供給するのが、より少ないオーバーヘッドを必要とする、(より少ないシステムコール)。

Stevens & Thomas             Informational                     [Page 27]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[27ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   requires less state to be stored and protected in a multithreaded
   application.

より少ない状態がマルチスレッド化されたアプリケーションに保存されて、保護されるのが必要です。

   When specifying the source IPv6 address as ancillary data, if the
   ipi6_addr member of the in6_pktinfo structure is the unspecified
   address (IN6ADDR_ANY_INIT), then (a) if an address is currently bound
   to the socket, it is used as the source address, or (b) if no address
   is currently bound to the socket, the kernel will choose the source
   address.  If the ipi6_addr member is not the unspecified address, but
   the socket has already bound a source address, then the ipi6_addr
   value overrides the already-bound source address for this output
   operation only.

in6_pktinfo構造のipi6_addr部材が不特定のアドレスであるなら補助データとしてソースIPv6アドレスを指定する、(IN6ADDR_、どんな_INITも)、そして、(a) アドレスが現在ソケットに縛られるなら、(b) ソースアドレスかそれともどんなアドレスも現在ソケット(意志がソースアドレスを選ぶカーネル)に制限されていないかどうかとしてそれは使用されます。 ipi6_addrメンバーが不特定のアドレスではありませんが、ソケットが既にソースアドレスを縛ったなら、ipi6_addr値はこの出力操作だけのための既に行きのソースアドレスをくつがえします。

   The kernel must verify that the requested source address is indeed a
   unicast address assigned to the node.

カーネルは、本当に、要求されたソースアドレスがノードに割り当てられたユニキャストアドレスであることを確かめなければなりません。

   When the in6_pktinfo structure is returned as ancillary data by
   recvmsg(), the ipi6_addr member contains the destination IPv6 address
   from the received packet.

in6_pktinfo構造が補助データとしてrecvmsg()によって返されるとき、ipi6_addrメンバーは容認されたパケットからの送付先IPv6アドレスを含みます。

5.3.  Specifying/Receiving the Hop Limit

5.3. ホップ限界を指定するか、または受けます。

   The outgoing hop limit is normally specified with either the
   IPV6_UNICAST_HOPS socket option or the IPV6_MULTICAST_HOPS socket
   option, both of which are described in [RFC-2133].  Specifying the
   hop limit as ancillary data lets the application override either the
   kernel's default or a previously specified value, for either a
   unicast destination or a multicast destination, for a single output
   operation.  Returning the received hop limit is useful for programs
   such as Traceroute and for IPv6 applications that need to verify that
   the received hop limit is 255 (e.g., that the packet has not been
   forwarded).

通常、外向的なホップ限界はIPV6_UNICAST_ホップスのソケットオプションかIPV6_MULTICAST_ホップスのソケットオプションのどちらかで指定されます。その両方が[RFC-2133]で説明されます。 アプリケーションは補助データとしてホップ限界を指定するのにカーネルのデフォルトか以前に指定された値のどちらかをくつがえします、ユニキャストの目的地かマルチキャストの目的地のどちらかに、ただ一つの出力操作のために。 容認されたホップ限界を返すのがTracerouteなどのプログラムと容認されたホップ限界が255であることを確かめる必要があるIPv6アプリケーションの役に立つ、(例えば、パケットは進められていません)

   The received hop limit is returned as ancillary data by recvmsg()
   only if the application has enabled the IPV6_HOPLIMIT socket option:

アプリケーションがIPV6_HOPLIMITソケットオプションを可能にした場合にだけ、容認されたホップ限界は補助データとしてrecvmsg()によって返されます:

       int  on = 1;
       setsockopt(fd, IPPROTO_IPV6, IPV6_HOPLIMIT, &on, sizeof(on));

=1のint。 setsockopt、(fd、IPV6_HOPLIMITの、そして、オンなIPPROTO_IPV6、sizeof(on))。

   In the cmsghdr structure containing this ancillary data, the
   cmsg_level member will be IPPROTO_IPV6, the cmsg_type member will be
   IPV6_HOPLIMIT, and the first byte of cmsg_data[] will be the first
   byte of the integer hop limit.

この補助データを含むcmsghdr構造では、cmsg_レベルメンバーはIPPROTO_IPV6でしょう、そして、cmsg_タイプメンバーはIPV6_HOPLIMITでしょう、そして、cmsg_データ[]の最初のバイトは整数ホップ限界の最初のバイトになるでしょう。

   Nothing special need be done to specify the outgoing hop limit: just
   specify the control information as ancillary data for sendmsg().  As
   specified in [RFC-2133], the interpretation of the integer hop limit
   value is

外向的なホップ限界を指定するために何も特別なことをする必要はありません: sendmsg()のための補助データとしてただ制御情報を指定してください。 [RFC-2133]で指定されるように、整数ホップ制限値の解釈は指定されます。

Stevens & Thomas             Informational                     [Page 28]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[28ページ]のRFC IPv6 February 1998に、高度なソケットAPI

       x < -1:        return an error of EINVAL
       x == -1:       use kernel default
       0 <= x <= 255: use x
       x >= 256:      return an error of EINVAL

x<-1: EINVAL x=-1の誤りを返してください: カーネルデフォルト0<=x<=255を使用してください: x x>=256を使用してください: EINVALの誤りを返してください。

5.4.  Specifying the Next Hop Address

5.4. 次のホップアドレスを指定します。

   The IPV6_NEXTHOP ancillary data object specifies the next hop for the
   datagram as a socket address structure.  In the cmsghdr structure
   containing this ancillary data, the cmsg_level member will be
   IPPROTO_IPV6, the cmsg_type member will be IPV6_NEXTHOP, and the
   first byte of cmsg_data[] will be the first byte of the socket
   address structure.

IPV6_NEXTHOP補助データオブジェクトはソケットアドレス構造として次のホップをデータグラムに指定します。 この補助データを含むcmsghdr構造では、cmsg_レベルメンバーはIPPROTO_IPV6でしょう、そして、cmsg_タイプメンバーはIPV6_NEXTHOPでしょう、そして、cmsg_データ[]の最初のバイトはソケットアドレス構造の最初のバイトになるでしょう。

   This is a privileged option.  (Note: It is implementation defined and
   beyond the scope of this document to define what "privileged" means.
   Unix systems use this term to mean the process must have an effective
   user ID of 0.)

これは特権があるオプションです。 (以下に注意してください。 それは「特権があること」が意味することを定義するために定義されて、このドキュメントの範囲を超えてそうする実装です。 unixシステムは、プロセスには0の実効ユーザーIDがなければならないことを意味するのに今期を使用します。)

   If the socket address structure contains an IPv6 address (e.g., the
   sin6_family member is AF_INET6), then the node identified by that
   address must be a neighbor of the sending host.  If that address
   equals the destination IPv6 address of the datagram, then this is
   equivalent to the existing SO_DONTROUTE socket option.

ソケットアドレス構造がIPv6アドレスを含んでいるなら(例えば、sin6_親族はAF_INET6です)、そのアドレスによって特定されたノードは送付ホストの隣接物であるに違いありません。 そのアドレスがデータグラムの送付先IPv6アドレスと等しいなら、これは既存のSO_DONTROUTEソケットオプションに同等です。

5.5.  Additional Errors with sendmsg()

5.5. sendmsgと追加Errors()

   With the IPV6_PKTINFO socket option there are no additional errors
   possible with the call to recvmsg().  But when specifying the
   outgoing interface or the source address, additional errors are
   possible from sendmsg().  The following are examples, but some of
   these may not be provided by some implementations, and some
   implementations may define additional errors:

IPV6_PKTINFOソケットオプションと共に、呼び出しでrecvmsg()に可能などんな追加誤りもありません。 しかし、外向的なインタフェースかソースアドレスを指定するとき、追加誤りはsendmsg()から可能です。 これらの或るものはいくつかの実装によって提供されないかもしれません、そして、↓これは例ですが、いくつかの実装が追加誤りを定義するかもしれません:

   ENXIO         The interface specified by ipi6_ifindex does not exist.

インタフェースがipi6_ifindexで指定したENXIOは存在していません。

   ENETDOWN      The interface specified by ipi6_ifindex is not enabled
                 for IPv6 use.

インタフェースがipi6_ifindexで指定したENETDOWNはIPv6使用のために有効にされません。

   EADDRNOTAVAIL ipi6_ifindex specifies an interface but the address
                 ipi6_addr is not available for use on that interface.

EADDRNOTAVAIL ipi6_ifindexはインタフェースを指定しますが、そのインタフェースのにおける使用について、アドレスipi6_addrがありません。

   EHOSTUNREACH  No route to the destination exists over the interface
                 specified by ifi6_ifindex.

目的地へのEHOSTUNREACHいいえルートはifi6_ifindexによって指定されたインタフェースの上に存在しています。

Stevens & Thomas             Informational                     [Page 29]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[29ページ]のRFC IPv6 February 1998に、高度なソケットAPI

6.  Hop-By-Hop Options

6. ホップごとのオプション

   A variable number of Hop-by-Hop options can appear in a single Hop-
   by-Hop options header.  Each option in the header is TLV-encoded with
   a type, length, and value.

可変数のホップによるHopオプションがホップによる独身のHopオプションヘッダーに現れることができます。 ヘッダーのそれぞれのオプションはタイプ、長さ、および値でTLVによってコード化されています。

   Today only three Hop-by-Hop options are defined for IPv6 [RFC-1883]:
   Jumbo Payload, Pad1, and PadN, although a proposal exists for a
   router-alert Hop-by-Hop option.  The Jumbo Payload option should not
   be passed back to an application and an application should receive an
   error if it attempts to set it.  This option is processed entirely by
   the kernel.  It is indirectly specified by datagram-based
   applications as the size of the datagram to send and indirectly
   passed back to these applications as the length of the received
   datagram.  The two pad options are for alignment purposes and are
   automatically inserted by a sending kernel when needed and ignored by

今日、3つのホップによるHopオプションだけがIPv6[RFC-1883]のために定義されます: ジャンボな有効搭載量、Pad1、およびPadN、aですが、提案はルータ注意深いHopが跳んでいるオプションのために存在しています。 Jumbo有効搭載量オプションをアプリケーションに戻すべきではありません、そして、それを設定するのを試みるなら、アプリケーションは誤りを受けるべきです。 このオプションは完全にカーネルによって処理されます。 それは、発信するためにデータグラムのサイズとしてデータグラムベースのアプリケーションで間接的に指定されて、容認されたデータグラムの長さとして間接的にこれらのアプリケーションに戻されます。 必要であり、無視されると、2つのパッドオプションが、整列目的のためにあって、送付カーネルによって自動的に挿入されます。

   the receiving kernel.  This section of the API is therefore defined
   for future Hop-by-Hop options that an application may need to specify
   and receive.

受信カーネル。 したがって、APIのこのセクションはアプリケーションが指定して、受け取る必要があるかもしれない今後のホップによるHopオプションのために定義されます。

   Individual Hop-by-Hop options (and Destination options, which are
   described shortly, and which are similar to the Hop-by-Hop options)
   may have specific alignment requirements.  For example, the 4-byte
   Jumbo Payload length should appear on a 4-byte boundary, and IPv6
   addresses are normally aligned on an 8-byte boundary.  These
   requirements and the terminology used with these options are
   discussed in Section 4.2 and Appendix A of [RFC-1883].  The alignment
   of each option is specified by two values, called x and y, written as
   "xn + y".  This states that the option must appear at an integer
   multiple of x bytes from the beginning of the options header (x can
   have the values 1, 2, 4, or 8), plus y bytes (y can have a value
   between 0 and 7, inclusive).  The Pad1 and PadN options are inserted
   as needed to maintain the required alignment.  Whatever code builds
   either a Hop-by-Hop options header or a Destination options header
   must know the values of x and y for each option.

個々のホップHopのオプション(そして、まもなく、説明された、ホップによるHopオプションと同様のDestinationオプション)には、特定の整列要求があるかもしれません。 例えば、4バイトのJumbo有効搭載量の長さは4バイトの境界に現れるべきです、そして、通常、IPv6アドレスは8バイトの境界で並べられます。 [RFC-1883]のセクション4.2とAppendix Aでこれらのオプションと共に使用されるこれらの要件と用語について議論します。 それぞれのオプションの整列はxとyと呼ばれる「xn+y」として書かれた2つの値によって指定されます。 これは、オプションがxバイトの整数倍数でオプションヘッダーの始まり(xは値1、2、4、または8を持つことができる)、およびyバイトから現れなければならないと述べます(yは値を0と7の間持つことができます、包括的です)。 Pad1とPadNオプションは、必要な整列を維持するために必要に応じて挿入されます。 何が体格をコード化しても、ホップによるHopオプションヘッダーかDestinationオプションヘッダーのどちらかが各オプションのためのxとyの値を知らなければなりません。

   Multiple Hop-by-Hop options can be specified by the application.
   Normally one ancillary data object describes all the Hop-by-Hop
   options (since each option is itself TLV-encoded) but the application
   can specify multiple ancillary data objects for the Hop-by-Hop
   options, each object specifying one or more options.  Care must be
   taken designing the API for these options since

アプリケーションで複数のホップによるHopオプションを指定できます。 通常、1個の補助データオブジェクトがすべてのホップによるHopオプションについて説明しますが(それぞれのオプションがTLV自身によってコード化されているので)、アプリケーションはホップによるHopオプション(1つ以上のオプションを指定する各オブジェクト)に複数の補助データオブジェクトを指定できます。 以来これらのオプションのためにAPIを設計しながら、注意しなければなりません。

   1.   it may be possible for some future Hop-by-Hop options to be
        generated by the application and processed entirely by the
        application (e.g., the kernel may not know the alignment
        restrictions for the option),

1. いくつかの今後のホップによるHopオプションがアプリケーションで生成されて、完全にアプリケーションで処理されるのは、可能であるかもしれません(例えば、カーネルはオプションのための整列制限を知らないかもしれません)。

Stevens & Thomas             Informational                     [Page 30]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[30ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   2.   it must be possible for the kernel to insert its own Hop-by-Hop
        options in an outgoing packet (e.g., the Jumbo Payload option),

2. カーネルが出発しているパケット(例えば、Jumbo有効搭載量オプション)にそれ自身のホップによるHopオプションを挿入するのは、可能であるに違いありません。

   3.   the application can place one or more Hop-by-Hop options into a
        single ancillary data object,

3. アプリケーションは1つ以上のホップによるHopオプションを単一の補助データオブジェクトに置くことができます。

   4.   if the application specifies multiple ancillary data objects,
        each containing one or more Hop-by-Hop options, the kernel must
        combine these a single Hop-by-Hop options header, and

そして4. それぞれ1つを含んでいて、アプリケーションが複数の補助データオブジェクトを指定するか、そして、Hopが、より跳んでいるオプション、カーネルがホップによる独身のHopがヘッダーにゆだねるこれらを結合しなければならない。

   5.   it must be possible for the kernel to remove some Hop-by-Hop
        options from a received packet before returning the remaining
        Hop-by-Hop options to the application.  (This removal might
        consist of the kernel converting the option into a pad option of
        the same length.)

5. カーネルに、いくつかのホップによる残っているHopにオプションを返す前の容認されたパケットからアプリケーションまでのホップによるHopオプションを取り除くのは可能であるに違いありません。 (この取り外しは同じ長さのパッドオプションにオプションを変換するカーネルから成るかもしれません。)

   Finally, we note that access to some Hop-by-Hop options or to some
   Destination options, might require special privilege.  That is,
   normal applications (without special privilege) might be forbidden
   from setting certain options in outgoing packets, and might never see
   certain options in received packets.

最終的に、私たちは、いくつかのホップによるHopオプション、または、いくつかのDestinationオプションへのそのアクセスに注意して、特権を必要とするかもしれません。 すなわち、通常のアプリケーション(特権のない)は、出発しているパケットに、あるオプションをはめ込むので禁じられて、容認されたパケットで、あるオプションを決して見ないかもしれません。

6.1.  Receiving Hop-by-Hop Options

6.1. ホップごとのオプションを受け取ります。

   To receive Hop-by-Hop options the application must enable the
   IPV6_HOPOPTS socket option:

ホップによるHopオプションを受け取るために、アプリケーションはIPV6_HOPOPTSソケットオプションを可能にしなければなりません:

       int  on = 1;
       setsockopt(fd, IPPROTO_IPV6, IPV6_HOPOPTS, &on, sizeof(on));

=1のint。 setsockopt、(fd、IPV6_HOPOPTSの、そして、オンなIPPROTO_IPV6、sizeof(on))。

   All the Hop-by-Hop options are returned as one ancillary data object
   described by a cmsghdr structure.  The cmsg_level member will be
   IPPROTO_IPV6 and the cmsg_type member will be IPV6_HOPOPTS.  These
   options are then processed by calling the inet6_option_next() and
   inet6_option_find() functions, described shortly.

1個の補助データオブジェクトがcmsghdr構造のそばで説明したようにすべてのホップによるHopオプションを返します。 cmsg_レベルメンバーはIPPROTO_IPV6でしょう、そして、cmsg_タイプメンバーはIPV6_HOPOPTSでしょう。 そして、inet6_オプションの_の次の()とinet6_オプション_掘り出し物の()をまもなく説明された機能と呼ぶことによって、これらのオプションは処理されます。

6.2.  Sending Hop-by-Hop Options

6.2. ホップごとの送付オプション

   To send one or more Hop-by-Hop options, the application just
   specifies them as ancillary data in a call to sendmsg().  No socket
   option need be set.

ホップによる1Hopにオプションを送るために、アプリケーションは呼び出しにおける補助データとしてただsendmsg()にそれらを指定します。 ソケットオプションは全く設定される必要はありません。

   Normally all the Hop-by-Hop options are specified by a single
   ancillary data object.  Multiple ancillary data objects, each
   containing one or more Hop-by-Hop options, can also be specified, in
   which case the kernel will combine all the Hop-by-Hop options into a
   single Hop-by-Hop extension header.  But it should be more efficient
   to use a single ancillary data object to describe all the Hop-by-Hop

通常すべてのホップによるHopオプションが単一の補助データオブジェクトによって指定されます。 また、それぞれ1つ以上のホップによるHopオプションを含んでいて、複数の補助データオブジェクトを指定できます、その場合、カーネルはすべてのホップによるHopオプションを独身のホップによるHop拡張ヘッダーに結合するでしょう。 しかし、ホップすべてのHopについて説明するのに単一の補助データオブジェクトを使用するのは、より効率的であるべきです。

Stevens & Thomas             Informational                     [Page 31]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[31ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   options.  The cmsg_level member is set to IPPROTO_IPV6 and the
   cmsg_type member is set to IPV6_HOPOPTS.  The option is normally
   constructed using the inet6_option_init(), inet6_option_append(), and
   inet6_option_alloc() functions, described shortly.

オプション。 cmsg_レベルメンバーはIPPROTO_IPV6に用意ができています、そして、cmsg_タイプメンバーはIPV6_HOPOPTSに用意ができています。 通常、オプションはinet6_オプション_イニット()を使用することで構成されます、そして、inet6_オプション_は()を追加します、そして、まもなく説明されて、inet6_オプション_alloc()は機能します。

   Additional errors may be possible from sendmsg() if the specified
   option is in error.

指定されたオプションが間違っているなら、追加誤りはsendmsg()から可能であるかもしれません。

6.3.  Hop-by-Hop and Destination Options Processing

6.3. ホップごとの目的地オプション処理

   Building and parsing the Hop-by-Hop and Destination options is
   complicated for the reasons given earlier.  We therefore define a set
   of functions to help the application.  The function prototypes for
   these functions are all in the <netinet/in.h> header.

ホップによるHopとDestinationオプションを建てて、分析するのは、より早くあげられた理由で複雑にされます。 したがって、私たちは、アプリケーションを助けるために関数群を定義します。 これらの機能のための関数原型がすべて<netinet/in.h>ヘッダーにあります。

6.3.1.  inet6_option_space

6.3.1. inet6_オプション_スペース

       int inet6_option_space(int nbytes);

int inet6_オプション_スペース(int nbytes)。

   This function returns the number of bytes required to hold an option
   when it is stored as ancillary data, including the cmsghdr structure
   at the beginning, and any padding at the end (to make its size a
   multiple of 8 bytes).  The argument is the size of the structure
   defining the option, which must include any pad bytes at the
   beginning (the value y in the alignment term "xn + y"), the type
   byte, the length byte, and the option data.

この機能はそれが補助データとして格納されるとき、オプションを保持するのに必要であるバイト数を返します、始めにおけるcmsghdr構造、および終わりのどんな詰め物(サイズを8バイトの倍数にする)も含んでいて。 議論はオプションを定義する構造のサイズです。オプションは始め(整列用語「xn+y」による値y)におけるどんなパッドバイト、タイプバイト、長さのバイト、およびオプションデータも含まなければなりません。

   (Note: If multiple options are stored in a single ancillary data
   object, which is the recommended technique, this function
   overestimates the amount of space required by the size of N-1 cmsghdr
   structures, where N is the number of options to be stored in the
   object.  This is of little consequence, since it is assumed that most
   Hop-by-Hop option headers and Destination option headers carry only
   one option (p. 33 of [RFC-1883]).)

(以下に注意してください。 複数のオプションが単一の補助データ物に格納されるなら、(お勧めのテクニックです)この機能は物に格納されるためにNがオプションの数であるN-1 cmsghdr構造のサイズによって必要とされたスペースの合計を過大評価します。 これはほとんど結果のものではありません、ほとんどのホップによるHopオプションヘッダーとDestinationオプションヘッダーが1つのオプションだけを運ぶと思われて。(p。 33[RFC-1883。))

6.3.2.  inet6_option_init

6.3.2. inet6_オプション_イニット

       int inet6_option_init(void *bp, struct cmsghdr **cmsgp, int
       type);

int inet6_オプション_イニット(空間*bp、struct cmsghdr**cmsgp、intタイプ)。

   This function is called once per ancillary data object that will
   contain either Hop-by-Hop or Destination options.  It returns 0 on
   success or -1 on an error.

この機能はホップによるHopかDestinationのどちらかを含む補助データ物に一度オプションと呼ばれます。 それは成功か-1で0を誤りに返します。

   bp is a pointer to previously allocated space that will contain the
   ancillary data object.  It must be large enough to contain all the
   individual options to be added by later calls to
   inet6_option_append() and inet6_option_alloc().

bpは補助データ物を含む以前に割り当てられたスペースへのポインタです。 それはすべての_オプション_が()を追加するというinet6への後の要求で加えられるべき個人の選択を含むことができるくらいのinet6の大きい_がオプション_alloc()であったならそうしなければなりません。

Stevens & Thomas             Informational                     [Page 32]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[32ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   cmsgp is a pointer to a pointer to a cmsghdr structure.  *cmsgp is
   initialized by this function to point to the cmsghdr structure
   constructed by this function in the buffer pointed to by bp.

cmsgpはcmsghdr構造へのポインタへのポインタです。 *cmsgpはこの機能によって初期化されて、bpによって示されたバッファでのこの機能によって構成されたcmsghdr構造を示します。

   type is either IPV6_HOPOPTS or IPV6_DSTOPTS.  This type is stored in
   the cmsg_type member of the cmsghdr structure pointed to by *cmsgp.

タイプは、IPV6_HOPOPTSかIPV6_DSTOPTSのどちらかです。 このタイプは*cmsgpによって示されたcmsghdr構造のcmsg_タイプ部材に格納されます。

6.3.3.  inet6_option_append

6.3.3. _が追加するinet6_オプション

       int inet6_option_append(struct cmsghdr *cmsg, const uint8_t *typep,
                               int multx, int plusy);

int inet6_オプション_は(struct cmsghdr*cmsg、const uint8_t*typep、int multx、int plusy)を追加します。

   This function appends a Hop-by-Hop option or a Destination option
   into an ancillary data object that has been initialized by
   inet6_option_init().  This function returns 0 if it succeeds or -1 on
   an error.

この機能はinet6_オプション_イニット()によって初期化された補助データ物にホップによるHopオプションかDestinationオプションを追加します。 成功するなら機能が0を返すこれか誤りの-1。

   cmsg is a pointer to the cmsghdr structure that must have been
   initialized by inet6_option_init().

cmsgはinet6_オプション_イニット()によって初期化されたに違いないcmsghdr構造へのポインタです。

   typep is a pointer to the 8-bit option type.  It is assumed that this
   field is immediately followed by the 8-bit option data length field,
   which is then followed immediately by the option data.  The caller
   initializes these three fields (the type-length-value, or TLV) before
   calling this function.

typepは8ビットのオプションタイプへのポインタです。 8ビットのオプションデータ長さの分野がすぐにこの野原のあとに続くと思われます。(次に、すぐオプションデータは分野のあとに続きます)。 この機能を呼ぶ前に、訪問者はこれらの3つの分野(タイプ長さの価値、またはTLV)を初期化します。

   The option type must have a value from 2 to 255, inclusive.  (0 and 1
   are reserved for the Pad1 and PadN options, respectively.)

オプションタイプはaに包括的に2〜255を評価させなければなりません。 (0と1はPad1とPadNオプションのためにそれぞれ予約されます。)

   The option data length must have a value between 0 and 255,
   inclusive, and is the length of the option data that follows.

オプションデータの長さは、値を包括的な0と255の間持たなければならなくて、いうことになるオプションデータの長さです。

   multx is the value x in the alignment term "xn + y" described
   earlier.  It must have a value of 1, 2, 4, or 8.

より早く説明された整列用語「xn+y」でmultxは値xです。 それには、1、2、4、または8の値がなければなりません。

   plusy is the value y in the alignment term "xn + y" described
   earlier.  It must have a value between 0 and 7, inclusive.

より早く説明された整列用語「xn+y」でplusyは値yです。 それで、aは包括的に0〜7を評価しなければなりません。

6.3.4.  inet6_option_alloc

6.3.4. _inet6_オプションalloc

       uint8_t *inet6_option_alloc(struct cmsghdr *cmsg, int datalen,
                                    int multx, int plusy);

_uint8_t*inet6_オプションalloc(struct cmsghdr*cmsg、int datalen、int multx、int plusy)。

Stevens & Thomas             Informational                     [Page 33]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[33ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   This function appends a Hop-by-Hop option or a Destination option
   into an ancillary data object that has been initialized by
   inet6_option_init().  This function returns a pointer to the 8-bit
   option type field that starts the option on success, or NULL on an
   error.

この機能はinet6_オプション_イニット()によって初期化された補助データ物にホップによるHopオプションかDestinationオプションを追加します。 この機能は8ビットのオプションを成功を始めるか、または誤りに関してNULLを始めるオプションタイプ分野にポインタを返します。

   The difference between this function and inet6_option_append() is
   that the latter copies the contents of a previously built option into
   the ancillary data object while the current function returns a
   pointer to the space in the data object where the option's TLV must
   then be built by the caller.

違い、()による流れ関数が次に訪問者がオプションのTLVを造らなければならないデータ・オブジェクトのスペースにポインタを返しますが、後者がオプションが以前に組み込まれたaのコンテンツを補助データ物にコピーするという_が追加するこの機能とinet6_オプションの間では、ことです。

   cmsg is a pointer to the cmsghdr structure that must have been
   initialized by inet6_option_init().

cmsgはinet6_オプション_イニット()によって初期化されたに違いないcmsghdr構造へのポインタです。

   datalen is the value of the option data length byte for this option.
   This value is required as an argument to allow the function to
   determine if padding must be appended at the end of the option.  (The
   inet6_option_append() function does not need a data length argument
   since the option data length must already be stored by the caller.)

datalenはこのオプションのためのオプションデータ長さのバイトの値です。 この値が、そっと歩くならオプションの終わりに機能が決定するのを許容する議論を追加しなければならないので、必要です。 inet6_オプション_は() 機能を追加します。(訪問者が既にオプションデータの長さを格納しなければならないのでデータ長さの議論を必要としない、)

   multx is the value x in the alignment term "xn + y" described
   earlier.  It must have a value of 1, 2, 4, or 8.

より早く説明された整列用語「xn+y」でmultxは値xです。 それには、1、2、4、または8の値がなければなりません。

   plusy is the value y in the alignment term "xn + y" described
   earlier.  It must have a value between 0 and 7, inclusive.

より早く説明された整列用語「xn+y」でplusyは値yです。 それで、aは包括的に0〜7を評価しなければなりません。

6.3.5.  inet6_option_next

6.3.5. 次のinet6_オプション_

       int inet6_option_next(const struct cmsghdr *cmsg, uint8_t
       **tptrp);

次のint inet6_オプション_(const struct cmsghdr*cmsg、uint8_t**tptrp)。

   This function processes the next Hop-by-Hop option or Destination
   option in an ancillary data object.  If another option remains to be
   processed, the return value of the function is 0 and *tptrp points to
   the 8-bit option type field (which is followed by the 8-bit option
   data length, followed by the option data).  If no more options remain
   to be processed, the return value is -1 and *tptrp is NULL.  If an
   error occurs, the return value is -1 and *tptrp is not NULL.

この機能は補助データ物で次のホップによるHopオプションかDestinationオプションを処理します。 *別のオプションが処理されるために残っているなら、機能のリターン値は0です、そして、tptrpは8ビットのオプションタイプ野原(オプションデータがあとに続いた8ビットのオプションデータの長さはあとに続く)を示します。 *それ以上のオプションが全く処理されるために残っていないなら、リターン値は-1です、そして、tptrpはNULLです。 *誤りが発生するなら、リターン値は-1です、そして、tptrpはNULLではありません。

   cmsg is a pointer to cmsghdr structure of which cmsg_level equals
   IPPROTO_IPV6 and cmsg_type equals either IPV6_HOPOPTS or
   IPV6_DSTOPTS.

cmsgはcmsg_レベル同輩のIPPROTO_IPV6とcmsg_が同輩のIPV6_HOPOPTSかIPV6_DSTOPTSのどちらかをタイプするcmsghdr構造へのポインタです。

   tptrp is a pointer to a pointer to an 8-bit byte and *tptrp is used
   by the function to remember its place in the ancillary data object
   each time the function is called.  The first time this function is
   called for a given ancillary data object, *tptrp must be set to NULL.

*tptrpは8ビットのバイトへのポインタへのポインタです、そして、tptrpは機能によって使用されて、各回補助データ物の機能が呼ばれる場所を覚えています。 *この機能が与えられた補助データ物のために呼ばれる1回目に、tptrpはNULLに用意ができなければなりません。

Stevens & Thomas             Informational                     [Page 34]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[34ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   Each time this function returns success, *tptrp points to the 8-bit
   option type field for the next option to be processed.

その都度、この機能は成功(タイプが次のオプションが処理されるためにさばく8ビットのオプションへの*tptrpポイント)を返します。

6.3.6.  inet6_option_find

6.3.6. inet6_オプション_掘り出し物

       int inet6_option_find(const struct cmsghdr *cmsg, uint8_t *tptrp,
                             int type);

int inet6_オプション_掘り出し物(const struct cmsghdr*cmsg、uint8_t*tptrp、intタイプ)。

   This function is similar to the previously described
   inet6_option_next() function, except this function lets the caller
   specify the option type to be searched for, instead of always
   returning the next option in the ancillary data object.  cmsg is a
   pointer to cmsghdr structure of which cmsg_level equals IPPROTO_IPV6
   and cmsg_type equals either IPV6_HOPOPTS or IPV6_DSTOPTS.

この機能は次の()が捜されるために機能して、この機能を除いて、訪問者にオプションタイプを指定させることができる以前に説明されたinet6_オプション_と同様です、補助データ物でいつも次のオプションを返すことの代わりに。cmsgはcmsg_レベル同輩のIPPROTO_IPV6とcmsg_が同輩のIPV6_HOPOPTSかIPV6_DSTOPTSのどちらかをタイプするcmsghdr構造へのポインタです。

   tptrp is a pointer to a pointer to an 8-bit byte and *tptrp is used
   by the function to remember its place in the ancillary data object
   each time the function is called.  The first time this function is
   called for a given ancillary data object, *tptrp must be set to NULL.

*tptrpは8ビットのバイトへのポインタへのポインタです、そして、tptrpは機能によって使用されて、各回補助データ物の機能が呼ばれる場所を覚えています。 *この機能が与えられた補助データ物のために呼ばれる1回目に、tptrpはNULLに用意ができなければなりません。

   This function starts searching for an option of the specified type
   beginning after the value of *tptrp.  If an option of the specified
   type is located, this function returns 0 and *tptrp points to the 8-
   bit option type field for the option of the specified type.  If an
   option of the specified type is not located, the return value is -1
   and *tptrp is NULL.  If an error occurs, the return value is -1 and
   *tptrp is not NULL.

この機能は指定されたタイプが*の値の後にtptrpを始めるオプションを捜し求め始めます。 *指定されたタイプのオプションが見つけられているなら、この機能は0を返します、そして、tptrpはオプションタイプが指定されたタイプのオプションのためにさばく8ビットを示します。 *指定されたタイプのオプションが見つけられていないなら、リターン値は-1です、そして、tptrpはNULLです。 *誤りが発生するなら、リターン値は-1です、そして、tptrpはNULLではありません。

6.3.7.  Options Examples

6.3.7. オプションの例

   We now provide an example that builds two Hop-by-Hop options.  First
   we define two options, called X and Y, taken from the example in
   Appendix A of [RFC-1883].  We assume that all options will have
   structure definitions similar to what is shown below.

私たちは現在、2つのホップによるHopオプションをそれが築き上げる例に提供します。 まず最初に、私たちは[RFC-1883]のAppendix Aで例から抜粋されるXとYと呼ばれる2つのオプションを定義します。 私たちは、すべてのオプションには以下に示されることと同様の構造定義があると思います。

        /* option X and option Y are defined in [RFC-1883], pp. 33-34 */
#define IP6_X_OPT_TYPE       X   /* replace X with assigned value */
#define IP6_X_OPT_LEN       12
#define IP6_X_OPT_MULTX      8   /* 8n + 2 alignment */
#define IP6_X_OPT_OFFSETY    2

/*オプションXとオプションYは[RFC-1883]、ページで定義されます。 33-34 */#、がOPT_TYPE X/*が取り替えるIP6_X_を定義する、X、*/#、が定義する割り当てられた値で、IP6_X_OPT_LEN12#、がOPT_MULTX8/*8n+2整列*/#が定義するIP6_X_を定義する、IP6_X_OPT_OFFSETY2

struct ip6_X_opt {
  uint8_t   ip6_X_opt_pad[IP6_X_OPT_OFFSETY];
  uint8_t   ip6_X_opt_type;
  uint8_t   ip6_X_opt_len;
  uint32_t  ip6_X_opt_val1;
  uint64_t  ip6_X_opt_val2;
};

struct ip6_X_は選ばれます。

Stevens & Thomas             Informational                     [Page 35]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[35ページ]のRFC IPv6 February 1998に、高度なソケットAPI

#define IP6_Y_OPT_TYPE       Y   /* replace Y with assigned value */
#define IP6_Y_OPT_LEN        7
#define IP6_Y_OPT_MULTX      4   /* 4n + 3 alignment */
#define IP6_Y_OPT_OFFSETY    3

#定義、IP6_Y_OPT_TYPE Y/*がYを取り替える、*/#、が定義する割り当てられた値で、IP6_Y_OPT_LEN7#、がOPT_MULTX4/*4n+3整列*/#が定義するIP6_Y_を定義する、IP6_Y_OPT_OFFSETY3

struct ip6_Y_opt {
  uint8_t   ip6_Y_opt_pad[IP6_Y_OPT_OFFSETY];
  uint8_t   ip6_Y_opt_type;
  uint8_t   ip6_Y_opt_len;
  uint8_t   ip6_Y_opt_val1;
  uint16_t  ip6_Y_opt_val2;
  uint32_t  ip6_Y_opt_val3;
};

struct ip6_Y_は選ばれます。

   We now show the code fragment to build one ancillary data object
   containing both options.

私たちは、現在、両方のオプションを含む1個の補助データ物を造るためにコード断片を見せています。

struct msghdr  msg;
struct cmsghdr  *cmsgptr;
struct ip6_X_opt  optX;
struct ip6_Y_opt  optY;

struct msghdr msg。 struct cmsghdr*cmsgptr。 struct ip6_X_はoptXを選びます。 struct ip6_Y_はoptYを選びます。

msg.msg_control = malloc(inet6_option_space(sizeof(optX) +
                                            sizeof(optY)));

msg.msg_コントロールはmallocと等しいです(inet6_オプション_スペース(sizeof(optX)+sizeof(optY)))。

inet6_option_init(msg.msg_control, &cmsgptr, IPV6_HOPOPTS);

inet6_オプション_イニット(msg.msg_コントロール、およびcmsgptr、IPV6_HOPOPTS)。

optX.ip6_X_opt_type = IP6_X_OPT_TYPE;
optX.ip6_X_opt_len  = IP6_X_OPT_LEN;
optX.ip6_X_opt_val1 = <32-bit value>;
optX.ip6_X_opt_val2 = <64-bit value>;
inet6_option_append(cmsgptr, &optX.ip6_X_opt_type,
                    IP6_X_OPT_MULTX, IP6_X_OPT_OFFSETY);

optX.ip6_X_はタイプ=IP6_X_が選ぶ_を選びます。_タイプしてください。 IP6_X X_が_lenに選ぶoptX.ip6_=_は_LENを選びます。 optX.ip6_X_は<の32ビットの値の_val1=>を選びます。 optX.ip6_X_は<の64ビットの値の_val2=>を選びます。 _が追加する(cmsgptr、およびoptX.ip6_X_は__タイプ、_IP6_X OPT_MULTX、IP6_X OPT_OFFSETYを選びます)inet6_オプション。

optY.ip6_Y_opt_type = IP6_Y_OPT_TYPE;
optY.ip6_Y_opt_len  = IP6_Y_OPT_LEN;
optY.ip6_Y_opt_val1 = <8-bit value>;
optY.ip6_Y_opt_val2 = <16-bit value>;
optY.ip6_Y_opt_val3 = <32-bit value>;
inet6_option_append(cmsgptr, &optY.ip6_Y_opt_type,
                    IP6_Y_OPT_MULTX, IP6_Y_OPT_OFFSETY);

optY.ip6_Y_はタイプ=IP6_Y_が選ぶ_を選びます。_タイプしてください。 IP6_Y Y_が_lenに選ぶoptY.ip6_=_は_LENを選びます。 optY.ip6_Y_は<8ビット値_val1=>を選びます。 optY.ip6_Y_は<の16ビットの値の_val2=>を選びます。 optY.ip6_Y_は<の32ビットの値の_val3=>を選びます。 _が追加する(cmsgptr、およびoptY.ip6_Y_は__タイプ、_IP6_Y OPT_MULTX、IP6_Y OPT_OFFSETYを選びます)inet6_オプション。

msg.msg_controllen = cmsgptr->cmsg_len;

msg.msg_controllen=cmsgptr>のcmsg_len。

   The call to inet6_option_init() builds the cmsghdr structure in the
   control buffer.

inet6_オプション_イニット()への呼び出しはコントロールバッファでcmsghdr構造を建設します。

Stevens & Thomas             Informational                     [Page 36]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[36ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = CMSG_LEN(0) = 12                             |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_HOPOPTS                                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_lenはCMSG_LEN(0)=12と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_HOPOPTSと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Here we assume a 32-bit architecture where sizeof(struct cmsghdr)
   equals 12, with a desired alignment of 4-byte boundaries (that is,
   the ALIGN() macro shown in the sample implementations of the
   CMSG_xxx() macros rounds up to a multiple of 4).

ここで、私たちはsizeof(struct cmsghdr)が12と等しい32ビットの構造を仮定します、4バイトの境界(すなわち、CMSG_xxx()マクロラウンドのサンプル実現で4の倍数まで示されたALIGN()マクロ)の必要な整列で。

   The first call to inet6_option_append() appends the X option.  Since
   this is the first option in the ancillary data object, 2 bytes are
   allocated for the Next Header byte and for the Hdr Ext Len byte.  The
   former will be set by the kernel, depending on the type of header
   that follows this header, and the latter byte is set to 1.  These 2
   bytes form the 2 bytes of padding (IP6_X_OPT_OFFSETY) required at the
   beginning of this option.

_オプション_が()を追加するというinet6への準備ラッパはXオプションを追加します。 これが補助データ物の第1の選択であるので、Next HeaderバイトとHdr Extレンバイトのために2バイトを割り当てます。 このヘッダーについて来るヘッダーのタイプに頼っていて、前者はカーネルによって設定されるでしょう、そして、後者のバイトは1に設定されます。 これらの2バイトはこのオプションの始めに必要であった(_IP6_X OPT_OFFSETY)を水増しする2バイトを形成します。

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 28                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_HOPOPTS                                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=1 | Option Type=X |Opt Data Len=12|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         4-octet field                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                         8-octet field                         +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=28| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_HOPOPTSと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=1| オプションタイプはXと等しいです。|Dataレン=12を選んでください。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 4八重奏の分野| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + 8八重奏の分野+| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   The cmsg_len member of the cmsghdr structure is incremented by 16,
   the size of the option.

cmsghdr構造のcmsg_len部材は16、オプションのサイズによって増加されます。

   The next call to inet6_option_append() appends the Y option to the
   ancillary data object.

_オプション_が()を追加するというinet6への次の要求はYオプションを補助データ物に追加します。

Stevens & Thomas             Informational                     [Page 37]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[37ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 44                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_HOPOPTS                                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=3 | Option Type=X |Opt Data Len=12|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         4-octet field                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                         8-octet field                         +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | PadN Option=1 |Opt Data Len=1 |       0       | Option Type=Y |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |Opt Data Len=7 | 1-octet field |         2-octet field         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         4-octet field                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | PadN Option=1 |Opt Data Len=2 |       0       |       0       |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=44| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_HOPOPTSと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=3| オプションタイプはXと等しいです。|Dataレン=12を選んでください。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 4八重奏の分野| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + 8八重奏の分野+| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PadNオプション=1|Dataレン=1を選んでください。| 0 | オプションタイプはYと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Dataレン=7を選んでください。| 1八重奏の分野| 2八重奏の分野| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 4八重奏の分野| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PadNオプション=1|Dataレン=2を選んでください。| 0 | 0 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   16 bytes are appended by this function, so cmsg_len becomes 44.  The
   inet6_option_append() function notices that the appended data
   requires 4 bytes of padding at the end, to make the size of the
   ancillary data object a multiple of 8, and appends the PadN option
   before returning.  The Hdr Ext Len byte is incremented by 2 to become
   3.

この機能で16バイトを追加するので、cmsg_lenは44になります。 inet6_オプション_は() 追加されたデータが戻りながら終わりに補助データ物のサイズを8の倍数にするようにそっと歩く4バイトを必要として、PadNオプションを追加する機能通知を追加します。 Hdr Extレンバイトは、3になるように2つ増加されます。

   Alternately, the application could build two ancillary data objects,
   one per option, although this will probably be less efficient than
   combining the two options into a single ancillary data object (as
   just shown).  The kernel must combine these into a single Hop-by-Hop
   extension header in the final IPv6 packet.

交互に、アプリケーションは2個の補助データ物を造るかもしれません、1オプションあたり1つ、これがたぶん単一の補助データ物(ただ示されるとしての)に2つのオプションを結合するより効率的にならないでしょうが。 カーネルは最終的なIPv6パケットの独身のホップによるHop拡張ヘッダーにこれらを結合しなければなりません。

       struct msghdr  msg;
       struct cmsghdr  *cmsgptr;
       struct ip6_X_opt  optX;
       struct ip6_Y_opt  optY;

struct msghdr msg。 struct cmsghdr*cmsgptr。 struct ip6_X_はoptXを選びます。 struct ip6_Y_はoptYを選びます。

       msg.msg_control = malloc(inet6_option_space(sizeof(optX)) +
                                inet6_option_space(sizeof(optY)));

msg.msg_コントロールはmallocと等しいです(inet6_オプション_スペース(sizeof(optX))+ inet6_オプション_スペース(sizeof(optY)))。

       inet6_option_init(msg.msg_control, &cmsgptr, IPPROTO_HOPOPTS);

inet6_オプション_イニット(msg.msg_コントロール、およびcmsgptr、IPPROTO_HOPOPTS)。

       optX.ip6_X_opt_type = IP6_X_OPT_TYPE;

optX.ip6_X_はタイプ=IP6_X_が選ぶ_を選びます。_タイプしてください。

Stevens & Thomas             Informational                     [Page 38]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[38ページ]のRFC IPv6 February 1998に、高度なソケットAPI

       optX.ip6_X_opt_len  = IP6_X_OPT_LEN;
       optX.ip6_X_opt_val1 = <32-bit value>;
       optX.ip6_X_opt_val2 = <64-bit value>;
       inet6_option_append(cmsgptr, &optX.ip6_X_opt_type,
                           IP6_X_OPT_MULTX, IP6_X_OPT_OFFSETY);
       msg.msg_controllen = CMSG_SPACE(sizeof(optX));

IP6_X X_が_lenに選ぶoptX.ip6_=_は_LENを選びます。 optX.ip6_X_は<の32ビットの値の_val1=>を選びます。 optX.ip6_X_は<の64ビットの値の_val2=>を選びます。 _が追加する(cmsgptr、およびoptX.ip6_X_は__タイプ、_IP6_X OPT_MULTX、IP6_X OPT_OFFSETYを選びます)inet6_オプション。 msg.msg_controllenはCMSG_SPACE(sizeof(optX))と等しいです。

       inet6_option_init((u_char *)msg.msg_control + msg.msg_controllen,
                         &cmsgptr, IPPROTO_HOPOPTS);

inet6_オプション_イニット((u_炭*)msg.msg_コントロール+msg.msg_controllen、およびcmsgptr、IPPROTO_HOPOPTS)。

       optY.ip6_Y_opt_type = IP6_Y_OPT_TYPE;
       optY.ip6_Y_opt_len  = IP6_Y_OPT_LEN;
       optY.ip6_Y_opt_val1 = <8-bit value>;
       optY.ip6_Y_opt_val2 = <16-bit value>;
       optY.ip6_Y_opt_val3 = <32-bit value>;
       inet6_option_append(cmsgptr, &optY.ip6_Y_opt_type,
                           IP6_Y_OPT_MULTX, IP6_Y_OPT_OFFSETY);
       msg.msg_controllen += cmsgptr->cmsg_len;

optY.ip6_Y_はタイプ=IP6_Y_が選ぶ_を選びます。_タイプしてください。 IP6_Y Y_が_lenに選ぶoptY.ip6_=_は_LENを選びます。 optY.ip6_Y_は<8ビット値_val1=>を選びます。 optY.ip6_Y_は<の16ビットの値の_val2=>を選びます。 optY.ip6_Y_は<の32ビットの値の_val3=>を選びます。 _が追加する(cmsgptr、およびoptY.ip6_Y_は__タイプ、_IP6_Y OPT_MULTX、IP6_Y OPT_OFFSETYを選びます)inet6_オプション。 msg.msg_controllen+=cmsgptr>のcmsg_len。

   Each call to inet6_option_init() builds a new cmsghdr structure, and
   the final result looks like the following:

inet6_オプション_イニット()への各呼び出しは新しいcmsghdr構造を建設します、そして、最終的な結果は以下に似ています:

Stevens & Thomas             Informational                     [Page 39]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[39ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 28                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_HOPOPTS                                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=1 | Option Type=X |Opt Data Len=12|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         4-octet field                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                         8-octet field                         +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 28                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_HOPOPTS                                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=1 | Pad1 Option=0 | Option Type=Y |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |Opt Data Len=7 | 1-octet field |         2-octet field         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         4-octet field                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | PadN Option=1 |Opt Data Len=2 |       0       |       0       |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=28| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_HOPOPTSと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=1| オプションタイプはXと等しいです。|Dataレン=12を選んでください。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 4八重奏の分野| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + 8八重奏の分野+| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=28| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_HOPOPTSと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=1| Pad1オプション=0| オプションタイプはYと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Dataレン=7を選んでください。| 1八重奏の分野| 2八重奏の分野| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 4八重奏の分野| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PadNオプション=1|Dataレン=2を選んでください。| 0 | 0 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   When the kernel combines these two options into a single Hop-by-Hop
   extension header, the first 3 bytes of the second ancillary data
   object (the Next Header byte, the Hdr Ext Len byte, and the Pad1
   option) will be combined into a PadN option occupying 3 bytes.

カーネルが独身のホップによるHop拡張ヘッダーにこれらの2つのオプションを結合するとき、2番目の補助データ物(Next Headerバイト、Hdr Extレンバイト、およびPad1オプション)の最初の3バイトは3バイトを占領するPadNオプションに結合されるでしょう。

   The following code fragment is a redo of the first example shown
   (building two options in a single ancillary data object) but this
   time we use inet6_option_alloc().

以下のコード断片はそうです。aはしかし今回私たちが_inet6_オプションalloc()を使用するのが示された(単一の補助データ物の2つのオプションを組み込みます)最初の例についてやり直します。

uint8_t  *typep;
struct msghdr  msg;
struct cmsghdr  *cmsgptr;
struct ip6_X_opt  *optXp;  /* now a pointer, not a struct */
struct ip6_Y_opt  *optYp;  /* now a pointer, not a struct */

uint8_t*typep。 struct msghdr msg。 struct cmsghdr*cmsgptr。 struct ip6_X_は*optXpを選びます。 aではなく、ポインタが*/struct ip6_Y_をstructする/*現在は*optYpを選びます。 現在、/*はstruct*/ではなく、ポインタです。

msg.msg_control = malloc(inet6_option_space(sizeof(*optXp) +
                                            sizeof(*optYp)));

msg.msg_コントロールはmalloc(inet6_オプション_スペース(sizeof(*optXp)+sizeof(*optYp)))と等しいです。

Stevens & Thomas             Informational                     [Page 40]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[40ページ]のRFC IPv6 February 1998に、高度なソケットAPI

inet6_option_init(msg.msg_control, &cmsgptr, IPV6_HOPOPTS);

inet6_オプション_イニット(msg.msg_コントロール、およびcmsgptr、IPV6_HOPOPTS)。

typep = inet6_option_alloc(cmsgptr, IP6_X_OPT_LEN,
                           IP6_X_OPT_MULTX, IP6_X_OPT_OFFSETY);
optXp = (struct ip6_X_opt *) (typep - IP6_X_OPT_OFFSETY);
optXp->ip6_X_opt_type = IP6_X_OPT_TYPE;
optXp->ip6_X_opt_len  = IP6_X_OPT_LEN;
optXp->ip6_X_opt_val1 = <32-bit value>;
optXp->ip6_X_opt_val2 = <64-bit value>;

typepは_inet6_オプションallocと等しいです(_cmsgptr、IP6_X_OPT_レン、_IP6_X OPT_MULTX、IP6_X OPT_OFFSETY)。 optXp=(struct ip6_X_は*を選ぶ)(typepに、IP6_X_は_OFFSETYを選びます)。 IP6_X ip6_X_が選ぶ>をoptXpしている_タイプ=_は_タイプを選びます。 X_が選ぶIP6ip6_X_が_lenに選ぶ>=_をoptXpしている_LEN。 ip6_X_が選ぶ>をoptXpしている_val1は<の32ビットの値の>と等しいです。 ip6_X_が選ぶ>をoptXpしている_val2は<の64ビットの値の>と等しいです。

typep = inet6_option_alloc(cmsgptr, IP6_Y_OPT_LEN,
                           IP6_Y_OPT_MULTX, IP6_Y_OPT_OFFSETY);
optYp = (struct ip6_Y_opt *) (typep - IP6_Y_OPT_OFFSETY);
optYp->ip6_Y_opt_type = IP6_Y_OPT_TYPE;
optYp->ip6_Y_opt_len  = IP6_Y_OPT_LEN;
optYp->ip6_Y_opt_val1 = <8-bit value>;
optYp->ip6_Y_opt_val2 = <16-bit value>;
optYp->ip6_Y_opt_val3 = <32-bit value>;

typepは_inet6_オプションalloc(_cmsgptr、IP6_Y_OPT_レン、_IP6_Y OPT_MULTX、IP6_Y OPT_OFFSETY)と等しいです。 optYp=(struct ip6_Y_は*を選ぶ)(typepに、IP6_Y_は_OFFSETYを選びます)。 ip6_Y_が選ぶ>をoptYpしている_タイプ=IP6_Y_は_タイプを選びます。 Y_が選ぶIP6ip6_Y_が_lenに選ぶ>=_をoptYpしている_LEN。 ip6_Y_が選ぶ>をoptYpしている_val1=<8ビット値>。 ip6_Y_が選ぶ>をoptYpしている_val2は<の16ビットの値の>と等しいです。 ip6_Y_が選ぶ>をoptYpしている_val3は<の32ビットの値の>と等しいです。

msg.msg_controllen = cmsgptr->cmsg_len;

msg.msg_controllen=cmsgptr>のcmsg_len。

   Notice that inet6_option_alloc() returns a pointer to the 8-bit
   option type field.  If the program wants a pointer to an option
   structure that includes the padding at the front (as shown in our
   definitions of the ip6_X_opt and ip6_Y_opt structures), the y-offset
   at the beginning of the structure must be subtracted from the
   returned pointer.

inet6_オプション_alloc()が8ビットのオプションタイプ分野にポインタを返すのに注意してください。 プログラムが前部に詰め物を含んでいるオプション構造にポインタを必要とするなら(私たちのip6_Xの定義で_選んでください。そうすれば、ip6_Y_が構造を選ぶのが示されるように)、返されたポインタから構造の始めのy-オフセットを引き算しなければなりません。

   The following code fragment shows the processing of Hop-by-Hop
   options using the inet6_option_next() function.

以下のコード断片は、_inet6_オプションを使用して、次の()が機能するのをホップによるHopオプションの処理に示します。

    struct msghdr   msg;
    struct cmsghdr  *cmsgptr;

struct msghdr msg。 struct cmsghdr*cmsgptr。

    /* fill in msg */

msg*/での/*中詰め

    /* call recvmsg() */

/*呼び出しrecvmsg()*/

    for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
         cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
        if (cmsgptr->cmsg_level == IPPROTO_IPV6 &&
            cmsgptr->cmsg_type == IPV6_HOPOPTS) {

(cmsgptr=CMSG_FIRSTHDR(msg); cmsgptr!=NULL; cmsgptr=CMSG_NXTHDR(msg、cmsgptr))、(cmsgptr>cmsg_平らな=IPPROTO_IPV6、cmsgptr>のcmsg_タイプ=IPV6_HOPOPTS)

            uint8_t  *tptr = NULL;

uint8_t*tptrはNULLと等しいです。

            while (inet6_option_next(cmsgptr, &tptr) == 0) {
                if (*tptr == IP6_X_OPT_TYPE) {
                    struct ip6_X_opt  *optXp;

(次のinet6_オプション_(cmsgptr、およびtptr)=0)である、(_*tptr=IP6_X OPT_TYPE)である、struct ip6_X_は*optXpを選びます。

Stevens & Thomas             Informational                     [Page 41]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[41ページ]のRFC IPv6 February 1998に、高度なソケットAPI

                    optXp = (struct ip6_X_opt *) (tptr - IP6_X_OPT_OFFSETY);
                    <do whatever with> optXp->ip6_X_opt_val1;
                    <do whatever with> optXp->ip6_X_opt_val2;

optXp=(struct ip6_X_は*を選ぶ)(tptrに、IP6_X_は_OFFSETYを選びます)。 >optXpと共に>ip6_X_を何でもにしている<は_val1を選びます。 >optXpと共に>ip6_X_を何でもにしている<は_val2を選びます。

                } else if (*tptr == IP6_Y_OPT_TYPE) {
                    struct ip6_Y_opt  *optYp;

ほか、(_*tptr=IP6_Y OPT_TYPE)である、struct ip6_Y_は*optYpを選びます。

                    optYp = (struct ip6_Y_opt *) (tptr - IP6_Y_OPT_OFFSETY);
                    <do whatever with> optYp->ip6_Y_opt_val1;
                    <do whatever with> optYp->ip6_Y_opt_val2;
                    <do whatever with> optYp->ip6_Y_opt_val3;
                }
            }
            if (tptr != NULL)
                <error encountered by inet6_option_next()>;
        }
    }

optYp=(struct ip6_Y_は*を選ぶ)(tptrに、IP6_Y_は_OFFSETYを選びます)。 >optYpと共に>ip6_Y_を何でもにしている<は_val1を選びます。 >optYpと共に>ip6_Y_を何でもにしている<は_val2を選びます。 >optYpと共に>ip6_Y_を何でもにしている<は_val3を選びます。 } _(tptr!はNULLと等しいです)<誤りがinet6に遭遇したなら、_次の()>にゆだねてください。 } }

7.  Destination Options

7. 目的地オプション

   A variable number of Destination options can appear in one or more
   Destination option headers.  As defined in [RFC-1883], a Destination
   options header appearing before a Routing header is processed by the
   first destination plus any subsequent destinations specified in the
   Routing header, while a Destination options header appearing after a
   Routing header is processed only by the final destination.  As with
   the Hop-by-Hop options, each option in a Destination options header
   is TLV-encoded with a type, length, and value.

可変数のDestinationオプションが1個以上のDestinationオプションヘッダーに現れることができます。 [RFC-1883]で定義されるように、ルート設定ヘッダーが最初の目的地とどんなその後の目的地によっても処理される前に現れるDestinationオプションヘッダーはルート設定ヘッダーで指定しました、ルート設定ヘッダーの後に現れるDestinationオプションヘッダーが最終的な目的地だけによって処理されますが。 ホップによるHopオプションのように、Destinationオプションヘッダーのそれぞれのオプションはタイプ、長さ、および値でTLVによってコード化されています。

   Today no Destination options are defined for IPv6 [RFC-1883],
   although proposals exist to use Destination options with mobility and
   anycasting.

提案は移動性とanycastingによるDestinationオプションを使用するために存在していますが、今日の、Destinationオプションは全くIPv6[RFC-1883]のために定義されません。

7.1.  Receiving Destination Options

7.1. 目的地オプションを受け取ります。

   To receive Destination options the application must enable the
   IPV6_DSTOPTS socket option:

Destinationオプションを受け取るために、アプリケーションはIPV6_DSTOPTSソケットオプションを可能にしなければなりません:

       int  on = 1;
       setsockopt(fd, IPPROTO_IPV6, IPV6_DSTOPTS, &on, sizeof(on));

=1のint。 setsockopt、(fd、IPV6_DSTOPTSの、そして、オンなIPPROTO_IPV6、sizeof(on))。

   All the Destination options appearing before a Routing header are
   returned as one ancillary data object described by a cmsghdr
   structure and all the Destination options appearing after a Routing
   header are returned as another ancillary data object described by a
   cmsghdr structure.  For these ancillary data objects, the cmsg_level

1個の補助データ物がcmsghdr構造のそばで説明したようにルート設定ヘッダーの前に現れるすべてのDestinationオプションを返します、そして、別の補助データ物がcmsghdr構造のそばで説明したようにルート設定ヘッダーの後に現れるすべてのDestinationオプションを返します。 これらの補助データ物、cmsg_レベルのために

Stevens & Thomas             Informational                     [Page 42]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[42ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   member will be IPPROTO_IPV6 and the cmsg_type member will be
   IPV6_HOPOPTS.  These options are then processed by calling the
   inet6_option_next() and inet6_option_find() functions.

メンバーはIPPROTO_IPV6でしょう、そして、cmsg_タイプメンバーはIPV6_HOPOPTSでしょう。 そして、inet6_オプションの_の次の()とinet6_オプション_掘り出し物の()を機能と呼ぶことによって、これらのオプションは処理されます。

7.2.  Sending Destination Options

7.2. 送付目的地オプション

   To send one or more Destination options, the application just
   specifies them as ancillary data in a call to sendmsg().  No socket
   option need be set.

1つ以上のDestinationオプションを送るために、アプリケーションは呼び出しにおける補助データとしてただsendmsg()にそれらを指定します。 ソケットオプションは全く設定される必要はありません。

   As described earlier, one set of Destination options can appear
   before a Routing header, and one set can appear after a Routing
   header.  Each set can consist of one or more options.

より早く説明されるように、1セットのDestinationオプションはルート設定ヘッダーの前で見えることができます、そして、1セットはルート設定ヘッダーの後に現れることができます。 各セットは1つ以上のオプションから成ることができます。

   Normally all the Destination options in a set are specified by a
   single ancillary data object, since each option is itself TLV-
   encoded.  Multiple ancillary data objects, each containing one or
   more Destination options, can also be specified, in which case the
   kernel will combine all the Destination options in the set into a
   single Destination extension header.  But it should be more efficient
   to use a single ancillary data object to describe all the Destination
   options in a set.  The cmsg_level member is set to IPPROTO_IPV6 and
   the cmsg_type member is set to IPV6_DSTOPTS.  The option is normally
   constructed using the inet6_option_init(), inet6_option_append(), and
   inet6_option_alloc() functions.

通常セットにおけるすべてのDestinationオプションが単一の補助データ物によって指定されます、各オプションがそれ自体でコード化されたTLVであるので。 また、それぞれ1つ以上のDestinationオプションを含んでいて、複数の補助データ物を指定できます、その場合、カーネルはセットですべてのDestinationオプションを独身のDestination拡張ヘッダーに結合するでしょう。 しかし、セットですべてのDestinationオプションについて説明するのに単一の補助データ物を使用するのは、より効率的であるべきです。 cmsg_レベルメンバーはIPPROTO_IPV6に用意ができています、そして、cmsg_タイプメンバーはIPV6_DSTOPTSに用意ができています。 通常、オプションはinet6_オプション_イニット()を使用することで構成されます、そして、inet6_オプション_は()を追加します、そして、inet6_オプション_alloc()は機能します。

   Additional errors may be possible from sendmsg() if the specified
   option is in error.

指定されたオプションが間違っているなら、追加誤りはsendmsg()から可能であるかもしれません。

8.  Routing Header Option

8. ルート設定ヘッダーオプション

   Source routing in IPv6 is accomplished by specifying a Routing header
   as an extension header.  There can be different types of Routing
   headers, but IPv6 currently defines only the Type 0 Routing header
   [RFC-1883].  This type supports up to 23 intermediate nodes.  With
   this maximum number of intermediate nodes, a source, and a
   destination, there are 24 hops, each of which is defined as a strict
   or loose hop.

IPv6でのソースルーティングは、拡張ヘッダーとしてルート設定ヘッダーを指定することによって、達成されます。 異なったタイプのルート設定ヘッダーがあることができますが、IPv6は現在、Type0ルート設定ヘッダー[RFC-1883]だけを定義します。 このタイプは最大23の中間的ノードをサポートします。 この最大数の中間的ノード、ソース、および目的地をもって、24のホップがあります。それはそれぞれ厳しいかゆるいホップと定義されます。

   Source routing with IPv4 sockets API (the IP_OPTIONS socket option)
   requires the application to build the source route in the format that
   appears as the IPv4 header option, requiring intimate knowledge of
   the IPv4 options format.  This IPv6 API, however, defines eight
   functions that the application calls to build and examine a Routing
   header.  Four functions build a Routing header:

IPv4ソケットAPI(IP_OPTIONSソケットオプション)があるソースルーティングはIPv4ヘッダーオプションとして現れる形式で送信元経路を造るためにアプリケーションを必要とします、IPv4オプション形式に関する詳細な知識を必要として。 しかしながら、このIPv6APIはアプリケーションがルート設定ヘッダーを造って、調べるために呼ぶ8つの機能を定義します。 4つの機能がルート設定ヘッダーを造ります:

   inet6_rthdr_space()    - return #bytes required for ancillary data
   inet6_rthdr_init()     - initialize ancillary data for Routing header

inet6_rthdr_スペース()--リターン#バイトが補助データinet6_rthdr_イニット()に必要です--ルート設定ヘッダーのために補助データを初期化してください。

Stevens & Thomas             Informational                     [Page 43]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[43ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   inet6_rthdr_add()      - add IPv6 address & flags to Routing header
   inet6_rthdr_lasthop()  - specify the flags for the final hop

inet6_rthdr_は()を加えます--ルート設定ヘッダーinet6_rthdr_lasthop()にIPv6アドレスと旗を加えてください--最終的なホップに旗を指定してください。

   Four functions deal with a returned Routing header:

4つの機能が返されたルート設定ヘッダーに対処します:

    inet6_rthdr_reverse()  - reverse a Routing header
    inet6_rthdr_segments() - return #segments in a Routing header
    inet6_rthdr_getaddr()  - fetch one address from a Routing header
    inet6_rthdr_getflags() - fetch one flag from a Routing header

inet6_rthdr_逆()--ルート設定ヘッダーinet6_rthdr_セグメント()を逆にしてください--ルート設定ヘッダーinet6_rthdr_getaddr()で#セグメントを返してください--フェッチ1はルート設定ヘッダーからinet6_rthdr_getflags()を記述します--ルート設定ヘッダーから1個の旗をとって来てください。

   The function prototypes for these functions are all in the
   <netinet/in.h> header.

これらの機能のための関数原型がすべて<netinet/in.h>ヘッダーにあります。

   To receive a Routing header the application must enable the
   IPV6_RTHDR socket option:

ルート設定ヘッダーを受け取るために、アプリケーションはIPV6_RTHDRソケットオプションを可能にしなければなりません:

       int  on = 1;
       setsockopt(fd, IPPROTO_IPV6, IPV6_RTHDR, &on, sizeof(on));

=1のint。 setsockopt、(fd、IPV6_RTHDRの、そして、オンなIPPROTO_IPV6、sizeof(on))。

   To send a Routing header the application just specifies it as
   ancillary data in a call to sendmsg().

ルート設定ヘッダーにアプリケーションを送るのは呼び出しにおける補助データとしてただsendmsg()にそれを指定します。

   A Routing header is passed between the application and the kernel as
   an ancillary data object.  The cmsg_level member has a value of
   IPPROTO_IPV6 and the cmsg_type member has a value of IPV6_RTHDR.  The
   contents of the cmsg_data[] member is implementation dependent and
   should not be accessed directly by the application, but should be
   accessed using the eight functions that we are about to describe.

ルート設定ヘッダーは補助データ物としてアプリケーションとカーネルの間で渡されます。 cmsg_レベルメンバーには、IPPROTO_IPV6の値があります、そして、cmsg_タイプメンバーには、IPV6_RTHDRの値があります。cmsg_データ[]メンバーのコンテンツに実現に依存していて、直接アプリケーションでアクセスするべきではありませんが、私たちが説明しようとしている8つの機能を使用することでアクセスするべきであってください。

   The following constants are defined in the <netinet/in.h> header:

以下の定数は<netinet/in.h>ヘッダーで定義されます:

    #define IPV6_RTHDR_LOOSE     0 /* this hop need not be a neighbor */
    #define IPV6_RTHDR_STRICT    1 /* this hop must be a neighbor */

#このホップが*/#、が定義する隣人がこのホップが隣人が*/であったならそうしなければならないIPV6_RTHDR_STRICT1/*であったならそうする必要はないIPV6_RTHDR_LOOSE0/*を定義してください。

    #define IPV6_RTHDR_TYPE_0    0 /* IPv6 Routing header type 0 */

#IPV6_RTHDR_TYPE_0 0/*IPv6ルート設定ヘッダータイプ0*/を定義してください。

   When a Routing header is specified, the destination address specified
   for connect(), sendto(), or sendmsg() is the final destination
   address of the datagram.  The Routing header then contains the
   addresses of all the intermediate nodes.

ルート設定ヘッダーが指定されるとき、アドレスが指定した目的地は()を接続します、sendto()、または、sendmsg()がデータグラムの最終的な送付先アドレスです。 そして、ルート設定ヘッダーはすべての中間的ノードのアドレスを含んでいます。

8.1.  inet6_rthdr_space

8.1. inet6_rthdr_スペース

       size_t inet6_rthdr_space(int type, int segments);

サイズ_t inet6_rthdr_スペース(intタイプ、intセグメント)。

   This function returns the number of bytes required to hold a Routing
   header of the specified type containing the specified number of

この機能は指定された数を含む指定されたタイプのルート設定ヘッダーを持つのに必要な状態でバイト数を返します。

Stevens & Thomas             Informational                     [Page 44]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[44ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   segments (addresses).  For an IPv6 Type 0 Routing header, the number
   of segments must be between 1 and 23, inclusive.  The return value
   includes the size of the cmsghdr structure that precedes the Routing
   header, and any required padding.

セグメント(アドレス)。 ヘッダー、セグメントの数がそうしなければならないIPv6 Type0ルート設定のために1と23の間いてください。包括的。 リターン値はルート設定ヘッダー、およびどんな必要な詰め物にも先行するcmsghdr構造のサイズを含んでいます。

   If the return value is 0, then either the type of the Routing header
   is not supported by this implementation or the number of segments is
   invalid for this type of Routing header.

リターン値が0であるなら、ルート設定ヘッダーのタイプがこの実現で支持されないか、またはこのタイプのルート設定ヘッダーに、セグメントの数は無効です。

   (Note: This function returns the size but does not allocate the space
   required for the ancillary data.  This allows an application to
   allocate a larger buffer, if other ancillary data objects are
   desired, since all the ancillary data objects must be specified to
   sendmsg() as a single msg_control buffer.)

(以下に注意してください。 この機能は、サイズを返しますが、補助データに必要であるスペースを割り当てません。 これで、アプリケーションは大きめのバッファを割り当てることができます、他の補助データ物が望まれているなら、すべての補助データ物をsendmsgに指定しなければならないので()、ただ一つのmsg_コントロールバッファとして。)

8.2.  inet6_rthdr_init

8.2. inet6_rthdr_イニット

       struct cmsghdr *inet6_rthdr_init(void *bp, int type);

struct cmsghdr*inet6_rthdr_イニット(空間*bp、intタイプ)。

   This function initializes the buffer pointed to by bp to contain a
   cmsghdr structure followed by a Routing header of the specified type.
   The cmsg_len member of the cmsghdr structure is initialized to the
   size of the structure plus the amount of space required by the
   Routing header.  The cmsg_level and cmsg_type members are also
   initialized as required.

この機能は指定されたタイプのルート設定ヘッダーによって従われたcmsghdr構造を含むようにbpによって示されたバッファを初期化します。 cmsghdr構造のcmsg_len部材は構造のサイズに初期化されます、そして、スペースの合計がルート設定ヘッダーが必要です。 また、cmsg_レベルとcmsg_タイプメンバーは必要に応じて初期化されます。

   The caller must allocate the buffer and its size can be determined by
   calling inet6_rthdr_space().

訪問者はバッファを割り当てなければなりません、そして、inet6_をrthdr_スペース()と呼ぶことによって、サイズは決定できます。

   Upon success the return value is the pointer to the cmsghdr
   structure, and this is then used as the first argument to the next
   two functions.  Upon an error the return value is NULL.

成功では、リターン値はcmsghdr構造へのポインタです、そして、次の2への最初の議論が機能するとき、次に、これは使用されます。 誤りのときに、リターン値はNULLです。

8.3.  inet6_rthdr_add

8.3. inet6_rthdr_は加えます。

    int inet6_rthdr_add(struct cmsghdr *cmsg,
                        const struct in6_addr *addr, unsigned int flags);

int inet6_rthdr_は(struct cmsghdr*cmsg、無記名のintが旗を揚げさせるconst struct in6_addr*addr)を加えます。

   This function adds the address pointed to by addr to the end of the
   Routing header being constructed and sets the type of this hop to the
   value of flags.  For an IPv6 Type 0 Routing header, flags must be
   either IPV6_RTHDR_LOOSE or IPV6_RTHDR_STRICT.

この機能は、組み立てられているルート設定ヘッダーの端にaddrによって示されたアドレスを加えて、このホップのタイプを旗の値に設定します。 IPv6 Type0ルート設定ヘッダーにおいて、旗は、IPV6_RTHDR_LOOSEかIPV6_RTHDR_STRICTのどちらかであるに違いありません。

   If successful, the cmsg_len member of the cmsghdr structure is
   updated to account for the new address in the Routing header and the
   return value of the function is 0.  Upon an error the return value of
   the function is -1.

うまくいきます、ルート設定ヘッダーで新しいアドレスを説明するためにcmsghdr構造のcmsg_len部材をアップデートして、機能のリターン値が0であるなら。 誤りのときに、機能のリターン値は-1です。

Stevens & Thomas             Informational                     [Page 45]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[45ページ]のRFC IPv6 February 1998に、高度なソケットAPI

8.4.  inet6_rthdr_lasthop

8.4. inet6_rthdr_lasthop

       int inet6_rthdr_lasthop(struct cmsghdr *cmsg,
                               unsigned int flags);

int inet6_rthdr_lasthop(struct cmsghdr*cmsg、無記名のint旗)。

   This function specifies the Strict/Loose flag for the final hop of a
   Routing header.  For an IPv6 Type 0 Routing header, flags must be
   either IPV6_RTHDR_LOOSE or IPV6_RTHDR_STRICT.

この機能はルート設定ヘッダーの最終的なホップにStrict/ゆるい旗を指定します。 IPv6 Type0ルート設定ヘッダーにおいて、旗は、IPV6_RTHDR_LOOSEかIPV6_RTHDR_STRICTのどちらかであるに違いありません。

   The return value of the function is 0 upon success, or -1 upon an
   error.

機能のリターン値は、成功に関する0、または誤りの-1です。

   Notice that a Routing header specifying N intermediate nodes requires
   N+1 Strict/Loose flags.  This requires N calls to inet6_rthdr_add()
   followed by one call to inet6_rthdr_lasthop().

N中間的ノードを指定するルート設定ヘッダーがN+1Strict/ゆるい旗を必要とするのに注意してください。 これはinet6_rthdr_lasthop()への1つの呼び出しで()が続いた_が、言い足すinet6_rthdrにN呼び出しを必要とします。

8.5.  inet6_rthdr_reverse

8.5. inet6_rthdr_逆

    int inet6_rthdr_reverse(const struct cmsghdr *in, struct cmsghdr *out);

int inet6_rthdr_逆(*中のconst struct cmsghdr、struct cmsghdr*アウト)。

   This function takes a Routing header that was received as ancillary
   data (pointed to by the first argument) and writes a new Routing
   header that sends datagrams along the reverse of that route.  Both
   arguments are allowed to point to the same buffer (that is, the
   reversal can occur in place).

この機能は、補助データ(最初の議論で、示される)として受け取られたルート設定ヘッダーを思い込んで、そのルートの逆に沿って発信する新しいルート設定ヘッダーにデータグラムを書きます。 両方の議論は同じバッファを示すことができます(すなわち、反転は適所に起こることができます)。

   The return value of the function is 0 on success, or -1 upon an
   error.

機能のリターン値は、成功に関する0、または誤りの-1です。

8.6.  inet6_rthdr_segments

8.6. inet6_rthdr_セグメント

       int inet6_rthdr_segments(const struct cmsghdr *cmsg);

int inet6_rthdr_セグメント(const struct cmsghdr*cmsg)。

   This function returns the number of segments (addresses) contained in
   the Routing header described by cmsg.  On success the return value is
   between 1 and 23, inclusive.  The return value of the function is -1
   upon an error.

この機能はcmsgによって説明されたルート設定ヘッダーに含まれたセグメント(アドレス)の数を返します。 リターン値が成功に、1と23の間あります。包括的。 機能のリターン値は誤りの-1です。

8.7.  inet6_rthdr_getaddr

8.7. inet6_rthdr_getaddr

    struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *cmsg, int
    index);

struct in6_addr*inet6_rthdr_getaddr(struct cmsghdr*cmsg、intインデックス)。

   This function returns a pointer to the IPv6 address specified by
   index (which must have a value between 1 and the value returned by
   inet6_rthdr_segments()) in the Routing header described by cmsg.  An
   application should first call inet6_rthdr_segments() to obtain the
   number of segments in the Routing header.

この機能はインデックスによって指定されたIPv6アドレスにポインタを返します。(cmsgによって説明されたルート設定ヘッダーのinet6_rthdr_セグメント())で1と値の間の値を返させなければならない。 アプリケーションは、最初に、inet6_をルート設定ヘッダーのセグメントの数を得るrthdr_セグメント()と呼ぶべきです。

Stevens & Thomas             Informational                     [Page 46]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[46ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   Upon an error the return value of the function is NULL.

誤りのときに、機能のリターン値はNULLです。

8.8.  inet6_rthdr_getflags

8.8. inet6_rthdr_getflags

       int inet6_rthdr_getflags(const struct cmsghdr *cmsg, int index);

int inet6_rthdr_getflags(const struct cmsghdr*cmsg、intインデックス)。

   This function returns the flags value specified by index (which must
   have a value between 0 and the value returned by
   inet6_rthdr_segments()) in the Routing header described by cmsg.  For
   an IPv6 Type 0 Routing header the return value will be either
   IPV6_RTHDR_LOOSE or IPV6_RTHDR_STRICT.

インデックスによって指定されて、この機能は値を旗に返します。(cmsgによって説明されたルート設定ヘッダーのinet6_rthdr_セグメント())で0と値の間の値を返させなければならない。 リターンが評価するIPv6 Type0ルート設定ヘッダーがIPV6_RTHDR_LOOSEかIPV6_STRICTにRTHDR_などちらかであるので。

   Upon an error the return value of the function is -1.

誤りのときに、機能のリターン値は-1です。

   (Note: Addresses are indexed starting at 1, and flags starting at 0,
   to maintain consistency with the terminology and figures in [RFC-
   1883].)

(注意: アドレスは1時に索引をつけられた始めであることであり、旗は0時に始まることです[RFC1883]の用語と数字と共に一貫性を維持するために。)

8.9.  Routing Header Example

8.9. ルート設定ヘッダーの例

   As an example of these Routing header functions, we go through the
   function calls for the example on p. 18 of [RFC-1883].  The source is
   S, the destination is D, and the three intermediate nodes are I1, I2,
   and I3.  f0, f1, f2, and f3 are the Strict/Loose flags for each hop.

これらのルート設定ヘッダー機能に関する例として、私たちはpに関する例のためのファンクションコールに直面しています。 18[RFC-1883。] 3つの中間的ノードが、ソースはSであり、目的地はDであり、I1と、I2と、I3です。f0、f1、f2、およびf3は各ホップのためのStrict/ゆるい旗です。

                   f0        f1        f2        f3
               S -----> I1 -----> I2 -----> I3 -----> D

f0 f1 f2 f3 S----->I1----->I2----->I3----->D

       src:    *    S         S         S         S   S
       dst:    D   I1        I2        I3         D   D
       A[1]:  I1   I2        I1        I1        I1  I1
       A[2]:  I2   I3        I3        I2        I2  I2
       A[3]:  I3    D         D         D        I3  I3
       #seg:   3    3         2         1         0   3

src: * S S S S S dst: D I1 I2 I3D D A[1]: I1 I2 I1 I1 I1 I1 A[2]: I2 I3 I3 I2 I2 I2 A[3]: I3D D D I3 I3#seg: 3 3 2 1 0 3

       check: f0        f1        f2        f3

以下をチェックしてください。 f0 f1 f2 f3

   src and dst are the source and destination IPv6 addresses in the IPv6
   header.  A[1], A[2], and A[3] are the three addresses in the Routing
   header.  #seg is the Segments Left field in the Routing header.
   check indicates which bit of the Strict/Loose Bit Map (0 through 3,
   specified as f0 through f3) that node checks.

srcとdstはIPv6がIPv6ヘッダーで演説するソースと目的地です。 A[1]、A[2]、およびA[3]はルート設定ヘッダーの3つのアドレスです。 #segはルート設定ヘッダーのSegments Left分野です。チェックは、そのノードがStrict/ゆるいBit Map(f0としてf3を通して指定された0〜3)のどのビットをチェックするかを示します。

   The six values in the column beneath node S are the values in the
   Routing header specified by the application using sendmsg().  The
   function calls by the sender would look like:

ノードSの下のコラムの6つの値がsendmsg()を使用しながらアプリケーションで指定されたルート設定ヘッダーの値です。 送付者によるファンクションコールに似ているでしょう:

Stevens & Thomas             Informational                     [Page 47]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[47ページ]のRFC IPv6 February 1998に、高度なソケットAPI

       void  *ptr;
       struct msghdr  msg;
       struct cmsghdr  *cmsgptr;
       struct sockaddr_in6  I1, I2, I3, D;
       unsigned int  f0, f1, f2, f3;

*ptrを欠如させてください。 struct msghdr msg。 struct cmsghdr*cmsgptr。 struct sockaddr_in6 I1、I2、I3、D。 無記名のint f0、f1、f2、f3。

       ptr = malloc(inet6_rthdr_space(IPV6_RTHDR_TYPE_0, 3));
       cmsgptr = inet6_rthdr_init(ptr, IPV6_RTHDR_TYPE_0);

ptrはmalloc(inet6_rthdr_スペース(IPV6_RTHDR_TYPE_0、3))と等しいです。 cmsgptrはinet6_rthdr_イニット(ptr、IPV6_RTHDR_TYPE_0)と等しいです。

       inet6_rthdr_add(cmsgptr, &I1.sin6_addr, f0);
       inet6_rthdr_add(cmsgptr, &I2.sin6_addr, f1);
       inet6_rthdr_add(cmsgptr, &I3.sin6_addr, f2);
       inet6_rthdr_lasthop(cmsgptr, f3);

inet6_rthdr_は(cmsgptr、およびI1.sin6_addr、f0)を加えます。 inet6_rthdr_は(cmsgptr、およびI2.sin6_addr、f1)を加えます。 inet6_rthdr_は(cmsgptr、およびI3.sin6_addr、f2)を加えます。 inet6_rthdr_lasthop(cmsgptr、f3)。

       msg.msg_control = ptr;
       msg.msg_controllen = cmsgptr->cmsg_len;

msg.msg_コントロールはptrと等しいです。 msg.msg_controllen=cmsgptr>のcmsg_len。

       /* finish filling in msg{}, msg_name = D */
       /* call sendmsg() */

中にmsgをいっぱいにする/*終わり、msg_名前=D*//*呼び出しsendmsg()*/

   We also assume that the source address for the socket is not
   specified (i.e., the asterisk in the figure).

また、私たちは、ソケットのためのソースアドレスが指定されない(すなわち、図のアスタリスク)と思います。

   The four columns of six values that are then shown between the five
   nodes are the values of the fields in the packet while the packet is
   in transit between the two nodes.  Notice that before the packet is
   sent by the source node S, the source address is chosen (replacing
   the asterisk), I1 becomes the destination address of the datagram,
   the two addresses A[2] and A[3] are "shifted up", and D is moved to
   A[3].  If f0 is IPV6_RTHDR_STRICT, then I1 must be a neighbor of S.

パケットはトランジット2つのノードの間で中ですが、次に5つのノードの間に示される4つのコラムの6つの値がパケットの分野の値です。 ソースノードSでパケットを送る前にソースアドレスを選んで(アスタリスクを置き換えて)、I1がアドレスのA[2]とA[3]が「移行する」データグラム、2つのものの送付先アドレスになって、DをA[3]に動かすのに注意してください。 f0がIPV6_RTHDR_STRICTであるなら、I1はSの隣接物であるに違いありません。

   The columns of values that are shown beneath the destination node are
   the values returned by recvmsg(), assuming the application has
   enabled both the IPV6_PKTINFO and IPV6_RTHDR socket options.  The
   source address is S (contained in the sockaddr_in6 structure pointed
   to by the msg_name member), the destination address is D (returned as
   an ancillary data object in an in6_pktinfo structure), and the
   ancillary data object specifying the Routing header will contain
   three addresses (I1, I2, and I3) and four flags (f0, f1, f2, and f3).
   The number of segments in the Routing header is known from the Hdr
   Ext Len field in the Routing header (a value of 6, indicating 3
   addresses).

目的地ノードの下に示される値に関するコラムはrecvmsg()によって返された値です、アプリケーションがIPV6_PKTINFOとIPV6_RTHDRソケットオプションの両方を可能にしたと仮定して。 ソースアドレスはS(メンバーというmsg_名前によって示されたsockaddr_in6構造では、含まれている)です、そして、送付先アドレスはD(補助データ物として、in6_pktinfo構造では、戻る)です、そして、ルート設定ヘッダーを指定する補助データ物は3つのアドレス(I1、I2、およびI3)と4個の旗(f0、f1、f2、およびf3)を含むでしょう。 ルート設定ヘッダーのセグメントの数はルート設定ヘッダー(3つのアドレスを示す6の値)のHdr Extレン分野から知られています。

   The return value from inet6_rthdr_segments() will be 3 and
   inet6_rthdr_getaddr(1) will return I1, inet6_rthdr_getaddr(2) will
   return I2, and inet6_rthdr_getaddr(3) will return I3, The return

inet6_rthdr_セグメント()からのリターン値は、3とinet6_になるでしょう、そして、rthdr_getaddr(1)がI1を返すinet6_rthdr_getaddr(2)はI2を返すでしょう、そして、inet6_rthdr_getaddr(3)はI3を返すでしょう、リターン

Stevens & Thomas             Informational                     [Page 48]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[48ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   value from inet6_rthdr_flags(0) will be f0, inet6_rthdr_flags(1) will
   return f1, inet6_rthdr_flags(2) will return f2, and
   inet6_rthdr_flags(3) will return f3.

inet6_rthdr_旗(0)からの値はf0になるでしょう、そして、inet6_rthdr_旗(1)はf1を返すでしょう、そして、inet6_rthdr_旗(2)はf2を返すでしょう、そして、inet6_rthdr_旗(3)はf3を返すでしょう。

   If the receiving application then calls inet6_rthdr_reverse(), the
   order of the three addresses will become I3, I2, and I1, and the
   order of the four Strict/Loose flags will become f3, f2, f1, and f0.

3つのアドレスの注文はI3、I2、およびI1になるでしょう、そして、inet6_rthdr_逆()が受信アプリケーションであるならその時、呼んで、4Strict/ゆるい旗の注文はf3、f2、f1、およびf0になるでしょう。

   We can also show what an implementation might store in the ancillary
   data object as the Routing header is being built by the sending
   process.  If we assume a 32-bit architecture where sizeof(struct
   cmsghdr) equals 12, with a desired alignment of 4-byte boundaries,
   then the call to inet6_rthdr_space(3) returns 68: 12 bytes for the
   cmsghdr structure and 56 bytes for the Routing header (8 + 3*16).

また、ルート設定ヘッダーが送付工程で造られているとき、私たちは実現が補助データ物に格納するかもしれないものを示すことができます。 私たちがsizeof(struct cmsghdr)が12と等しい32ビットの構造を仮定するなら、4バイトの境界の必要な整列で、inet6_rthdr_スペース(3)への呼び出しは68を返します: cmsghdr構造への12バイトとルート設定ヘッダーのための56バイト(8+3*16)。

   The call to inet6_rthdr_init() initializes the ancillary data object
   to contain a Type 0 Routing header:

inet6_rthdr_イニット()への呼び出しはType0ルート設定ヘッダーを含むように補助データ物を初期化します:

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 20                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_RTHDR                                  |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=0 | Routing Type=0|  Seg Left=0   |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |   Reserved    |             Strict/Loose Bit Map              |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=20| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_RTHDRと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=0| ルート設定タイプ=0| Segは=を0に残しました。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 予約されます。| 厳しいかゆるいビットマップ| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   The first call to inet6_rthdr_add() adds I1 to the list.

inet6_rthdr_への準備ラッパは、()がI1をリストに追加すると言い足します。

Stevens & Thomas             Informational                     [Page 49]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[49ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 36                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_RTHDR                                  |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=2 | Routing Type=0|  Seg Left=1   |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |   Reserved    |X|           Strict/Loose Bit Map              |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                                                               +
     |                                                               |
     +                           Address[1] = I1                     +
     |                                                               |
     +                                                               +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=36| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_RTHDRと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=2| ルート設定タイプ=0| Segは=を1に残しました。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 予約されます。|X| 厳しいかゆるいビットマップ| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + アドレス[1]=I1+| | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Bit 0 of the Strict/Loose Bit Map contains the value f0, which we
   just mark as X.  cmsg_len is incremented by 16, the Hdr Ext Len field
   is incremented by 2, and the Segments Left field is incremented by 1.

Strict/ゆるいBit Mapのビット0は値のf0を含んでいます。(X.cmsg_lenが16増加されて、Hdr Extレン分野が2つ増加されて、Segments Left分野が1つ増加されるのに従って、私たちはf0をただマークします)。

   The next call to inet6_rthdr_add() adds I2 to the list.

inet6_rthdr_への次の呼び出しは、()がI2をリストに追加すると言い足します。

Stevens & Thomas             Informational                     [Page 50]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[50ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 52                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_RTHDR                                  |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=4 | Routing Type=0|  Seg Left=2   |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |   Reserved    |X|X|         Strict/Loose Bit Map              |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                                                               +
     |                                                               |
     +                           Address[1] = I1                     +
     |                                                               |
     +                                                               +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                                                               +
     |                                                               |
     +                           Address[2] = I2                     +
     |                                                               |
     +                                                               +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=52| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_RTHDRと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=4| ルート設定タイプ=0| Segは=を2に残しました。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 予約されます。|X|X| 厳しいかゆるいビットマップ| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + アドレス[1]=I1+| | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + アドレス[2]=I2+| | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   The next bit of the Strict/Loose Bit Map contains the value f1.
   cmsg_len is incremented by 16, the Hdr Ext Len field is incremented
   by 2, and the Segments Left field is incremented by 1.

Strict/ゆるいBit Mapの次のビットは値のf1を含んでいます。cmsg_lenは16増加されます、そして、Hdr Extレン分野は2つ増加されます、そして、Segments Left分野は1つ増加されます。

   The last call to inet6_rthdr_add() adds I3 to the list.

inet6_rthdr_への最後の呼び出しは、()がI3をリストに追加すると言い足します。

Stevens & Thomas             Informational                     [Page 51]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[51ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_len = 68                                           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_level = IPPROTO_IPV6                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       cmsg_type = IPV6_RTHDR                                  |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  Next Header  | Hdr Ext Len=6 | Routing Type=0|  Seg Left=3   |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |   Reserved    |X|X|X|       Strict/Loose Bit Map              |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                                                               +
     |                                                               |
     +                           Address[1] = I1                     +
     |                                                               |
     +                                                               +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                                                               +
     |                                                               |
     +                           Address[2] = I2                     +
     |                                                               |
     +                                                               +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                                                               +
     |                                                               |
     +                           Address[3] = I3                     +
     |                                                               |
     +                                                               +
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_len=68| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_レベルはIPPROTO_IPV6と等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | cmsg_タイプはIPV6_RTHDRと等しいです。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 次のヘッダー| Hdr Extレン=6| ルート設定タイプ=0| Segは=を3に残しました。| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 予約されます。|X|X|X| 厳しいかゆるいビットマップ| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + アドレス[1]=I1+| | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + アドレス[2]=I2+| | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + アドレス[3]=I3+| | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   The next bit of the Strict/Loose Bit Map contains the value f2.
   cmsg_len is incremented by 16, the Hdr Ext Len field is incremented
   by 2, and the Segments Left field is incremented by 1.

Strict/ゆるいBit Mapの次のビットは値のf2を含んでいます。cmsg_lenは16増加されます、そして、Hdr Extレン分野は2つ増加されます、そして、Segments Left分野は1つ増加されます。

   Finally, the call to inet6_rthdr_lasthop() sets the next bit of the
   Strict/Loose Bit Map to the value specified by f3.  All the lengths
   remain unchanged.

最終的に、inet6_rthdr_lasthop()への呼び出しはStrict/ゆるいBit Mapの次のビットをf3によって指定された値に設定します。 すべての長さが変わりがあるというわけではありません。

Stevens & Thomas             Informational                     [Page 52]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[52ページ]のRFC IPv6 February 1998に、高度なソケットAPI

9.  Ordering of Ancillary Data and IPv6 Extension Headers

9. 補助データとIPv6拡張ヘッダーの注文

   Three IPv6 extension headers can be specified by the application and
   returned to the application using ancillary data with sendmsg() and
   recvmsg(): Hop-by-Hop options, Destination options, and the Routing
   header.  When multiple ancillary data objects are transferred via
   sendmsg() or recvmsg() and these objects represent any of these three
   extension headers, their placement in the control buffer is directly
   tied to their location in the corresponding IPv6 datagram.  This API
   imposes some ordering constraints when using multiple ancillary data
   objects with sendmsg().

sendmsg()とrecvmsg()がある補助データを使用することで3人のIPv6拡張ヘッダーをアプリケーションで指定して、アプリケーションに返すことができます: ホップで、オプション、Destinationオプション、およびルート設定ヘッダーを飛び越してください。 sendmsg()かrecvmsg()を通して複数の補助データオブジェクトを移して、これらのオブジェクトがこれらの3人の拡張ヘッダーのどれかの代理をするとき、コントロールバッファにおける彼らのプレースメントは直接対応するIPv6データグラムの彼らの位置に結ばれます。 このAPIは、sendmsg()がある複数の補助データオブジェクトを使用するとき、規制を命令しながら、いくつかを課します。

   When multiple IPv6 Hop-by-Hop options having the same option type are
   specified, these options will be inserted into the Hop-by-Hop options
   header in the same order as they appear in the control buffer.  But
   when multiple Hop-by-Hop options having different option types are
   specified, these options may be reordered by the kernel to reduce
   padding in the Hop-by-Hop options header.  Hop-by-Hop options may
   appear anywhere in the control buffer and will always be collected by
   the kernel and placed into a single Hop-by-Hop options header that
   immediately follows the IPv6 header.

同じオプションタイプがある複数のホップによるIPv6 Hopオプションが指定されるとき、コントロールバッファに現れるのに従って、これらのオプションは同次でホップによるHopオプションヘッダーに挿入されるでしょう。 しかし、異なったオプションタイプがある複数のホップによるHopオプションが指定されるとき、これらのオプションは減少させるホップによるHopオプションヘッダーでそっと歩くカーネルによって再命令されるかもしれません。 ホップごとのオプションは、いつもコントロールバッファでどこでも現れるかもしれなくて、カーネルによって集められて、すぐにIPv6ヘッダーについて来る独身のホップによるHopオプションヘッダーに置かれるでしょう。

   Similar rules apply to the Destination options: (1) those of the same
   type will appear in the same order as they are specified, and (2)
   those of differing types may be reordered.  But the kernel will build
   up to two Destination options headers: one to precede the Routing
   header and one to follow the Routing header.  If the application
   specifies a Routing header then all Destination options that appear
   in the control buffer before the Routing header will appear in a
   Destination options header before the Routing header and these
   options might be reordered, subject to the two rules that we just
   stated.  Similarly all Destination options that appear in the control
   buffer after the Routing header will appear in a Destination options
   header after the Routing header, and these options might be
   reordered, subject to the two rules that we just stated.

同様の規則はDestinationオプションに適用されます: (1) (2) それらが指定されるとき、同じタイプのものは同次に現れるでしょう、そして、異なったタイプのものは再命令されるかもしれません。 しかし、カーネルは最大2個のDestinationオプションヘッダーを造るでしょう: ルート設定ヘッダーに続くようにルート設定ヘッダーと1つに先行する1。 アプリケーションがルート設定ヘッダーを指定するなら、ルート設定ヘッダーがDestinationオプションヘッダーでルート設定ヘッダーの前に見える前にコントロールバッファに現れるすべてのDestinationオプションとこれらのオプションは私たちがただ述べた2つの規則を条件として再命令されるかもしれません。 同様に、コントロールバッファにルート設定ヘッダーの後に現れるすべてのDestinationオプションがDestinationオプションヘッダーにルート設定ヘッダーの後に現れるでしょう、そして、これらのオプションは私たちがただ述べた2つの規則を条件として再命令されるかもしれません。

   As an example, assume that an application specifies control
   information to sendmsg() containing six ancillary data objects: the
   first containing two Hop-by-Hop options, the second containing one
   Destination option, the third containing two Destination options, the
   fourth containing a Routing header, the fifth containing a Hop-by-Hop
   option, and the sixth containing two Destination options.  We also
   assume that all the Hop-by-Hop options are of different types, as are
   all the Destination options.  We number these options 1-9,
   corresponding to their order in the control buffer, and show them on
   the left below.

例として、アプリケーションが6個の補助データオブジェクトを含むsendmsg()に制御情報を指定すると仮定してください: ホップによる2Hopがゆだねる最初の含有、あるDestinationがゆだねる2番目の含有、2Destinationがゆだねる3番目の含有、4番目の含んでいるaルート設定ヘッダー、ホップによるa Hopがゆだねる5番目の含有、および2Destinationがゆだねる6番目の含有。 また、私たちは、異なったタイプにはすべてのホップによるHopオプションがすべてのDestinationオプションのようにあると思います。 私たちは、コントロールバッファにおける彼らのオーダーに対応している、これらのオプション1-9に付番して、以下の左でそれらを見せています。

Stevens & Thomas             Informational                     [Page 53]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[53ページ]のRFC IPv6 February 1998に、高度なソケットAPI

   In the middle we show the final arrangement of the options in the
   extension headers built by the kernel.  On the right we show the four
   ancillary data objects returned to the receiving application.

中央では、私たちが、拡張ヘッダーでのオプションの最終的な配置がカーネルによって建てられたのを示します。 右では、私たちが受信アプリケーションに返された4個の補助データオブジェクトを見せています。

          Sender's                                       Receiver's
       Ancillary Data      -->   IPv6 Extension   -->  Ancillary Data
          Objects                    Headers              Objects
       ------------------        ---------------       --------------
       HOPOPT-1,2 (first)        HOPHDR(J,7,1,2)       HOPOPT-7,1,2
       DSTOPT-3                  DSTHDR(4,5,3)         DSTOPT-4,5,3
       DSTOPT-4,5                RTHDR(6)              RTHDR-6
       RTHDR-6                   DSTHDR(8,9)           DSTOPT-8,9
       HOPOPT-7
       DSTOPT-8,9 (last)

送付者の受信機の補助データ-->IPv6拡張子-->補助データオブジェクトヘッダーオブジェクト------------------ --------------- -------------- HOPOPT-1、2(最初に)HOPHDR、(J、7、1、2)HOPOPT-7、1、2DSTOPT-3 DSTHDR(4、5、3)DSTOPT-4、5、3DSTOPT-4、5RTHDR(6) RTHDR-6 RTHDR-6 DSTHDR(8、9)DSTOPT-8、9HOPOPT-7 DSTOPT-8、9(最終)

   The sender's two Hop-by-Hop ancillary data objects are reordered, as
   are the first two Destination ancillary data objects.  We also show a
   Jumbo Payload option (denoted as J) inserted by the kernel before the
   sender's three Hop-by-Hop options.  The first three Destination
   options must appear in a Destination header before the Routing
   header, and the final two Destination options must appear in a
   Destination header after the Routing header.

送付者の2個のホップによるHop補助データオブジェクトが最初の2個のDestination補助データオブジェクトのように再命令されます。 また、私たちは送付者の3つのホップによるHopオプションの前にカーネルによって挿入されたJumbo有効搭載量オプション(Jとして、指示される)を示しています。 最初の3つのDestinationオプションがDestinationヘッダーにルート設定ヘッダーの前に現れなければなりません、そして、2つの最終的なDestinationオプションがDestinationヘッダーにルート設定ヘッダーの後に現れなければなりません。

   If Destination options are specified in the control buffer after a
   Routing header, or if Destination options are specified without a
   Routing header, the kernel will place those Destination options after
   an authentication header and/or an encapsulating security payload
   header, if present.

Destinationオプションがルート設定ヘッダーの後にコントロールバッファで指定されるか、またはDestinationオプションがルート設定ヘッダーなしで指定されると、カーネルは認証ヘッダー、そして/または、要約のセキュリティペイロードヘッダーの後にそれらのDestinationオプションを置くでしょう、存在しているなら。

10.  IPv6-Specific Options with IPv4-Mapped IPv6 Addresses

10. IPv4によって写像されたIPv6アドレスとのIPv6特有のオプション

   The various socket options and ancillary data specifications defined
   in this document apply only to true IPv6 sockets.  It is possible to
   create an IPv6 socket that actually sends and receives IPv4 packets,
   using IPv4-mapped IPv6 addresses, but the mapping of the options
   defined in this document to an IPv4 datagram is beyond the scope of
   this document.

本書では定義された様々なソケットオプションと補助データ仕様は本当のIPv6ソケットだけに適用されます。 IPv4によって写像されたIPv6アドレスを使用して、それがIPv6ソケットを作成するために、実際に発信して、IPv4パケットを受けますが、本書ではIPv4データグラムと定義されたオプションに関するマッピングがこのドキュメントの範囲を超えているのは、可能です。

   In general, attempting to specify an IPv6-only option, such as the
   Hop-by-Hop options, Destination options, or Routing header on an IPv6
   socket that is using IPv4-mapped IPv6 addresses, will probably result
   in an error.  Some implementations, however, may provide access to
   the packet information (source/destination address, send/receive
   interface, and hop limit) on an IPv6 socket that is using IPv4-mapped
   IPv6 addresses.

一般に、IPv4によって写像されたIPv6アドレスを使用しているIPv6ソケットの上のホップによるHopオプション、Destinationオプション、またはルート設定ヘッダーなどのように、IPv6だけオプションを指定するのを試みるのがたぶん誤りをもたらすでしょう。 しかしながら、いくつかの実装がIPv4によって写像されたIPv6アドレスを使用しているIPv6ソケットのパケット情報(/目的地が演説するソースは、インタフェースを送るか、または受けてください、そして、限界を飛び越す)へのアクセスを提供するかもしれません。

Stevens & Thomas             Informational                     [Page 54]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[54ページ]のRFC IPv6 February 1998に、高度なソケットAPI

11.  rresvport_af

11. rresvport_af

   The rresvport() function is used by the rcmd() function, and this
   function is in turn called by many of the "r" commands such as
   rlogin.  While new applications are not being written to use the
   rcmd() function, legacy applications such as rlogin will continue to
   use it and these will be ported to IPv6.

rresvport()機能はrcmd()機能によって使用されます、そして、この機能はrloginなどの「r」コマンドの多くで順番に呼ばれます。 新しいアプリケーションがrcmd()機能を使用するために書かれていない間、rloginなどのレガシーアプリケーションは、それを使用し続けるでしょう、そして、これらをIPv6に移植するでしょう。

   rresvport() creates an IPv4/TCP socket and binds a "reserved port" to
   the socket.  Instead of defining an IPv6 version of this function we
   define a new function that takes an address family as its argument.

rresvport()はソケットにIPv4/TCPソケットを作成して、「予約されたポート」を縛ります。 この機能のIPv6バージョンを定義することの代わりに、私たちは議論としてアドレスファミリーをみなす新しい機能を定義します。

       #include <unistd.h>

#<unistd.h>を含めてください。

       int  rresvport_af(int *port, int family);

int rresvport_af(int*ポート、intファミリー)。

   This function behaves the same as the existing rresvport() function,
   but instead of creating an IPv4/TCP socket, it can also create an
   IPv6/TCP socket.  The family argument is either AF_INET or AF_INET6,
   and a new error return is EAFNOSUPPORT if the address family is not
   supported.

この機能は、既存のrresvport()機能として同じように振る舞いますが、IPv4/TCPソケットを作成することの代わりに振る舞います、また、それはIPv6/TCPソケットを作成できます。 ファミリー議論は、AF_INETかAF_INET6のどちらかです、そして、アドレスファミリーが養われないなら、新しい誤りリターンはEAFNOSUPPORTです。

   (Note: There is little consensus on which header defines the
   rresvport() and rcmd() function prototypes.  4.4BSD defines it in
   <unistd.h>, others in <netdb.h>, and others don't define the function
   prototypes at all.)

(以下に注意してください。 ヘッダーがほとんどrresvportを定義しないコンセンサスがあります。()、rcmd()、関数原型。 4.4BSDは<unistd.h>、<netdb.h>の他のものでそれを定義します、そして、他のものは全く関数原型を定義しません。)

   (Note: We define this function only, and do not define something like
   rcmd_af() or rcmd6().  The reason is that rcmd() calls
   gethostbyname(), which returns the type of address: AF_INET or
   AF_INET6.  It should therefore be possible to modify rcmd() to
   support either IPv4 or IPv6, based on the address family returned by
   gethostbyname().)

私たちは、この機能だけを定義して、何もrcmd_af()やrcmd6()のようなものは定義しません。(注意: 理由はrcmd()が、アドレスのタイプを返すgethostbyname()と呼ぶということです: したがって、AF_INETかAF_INET6それはIPv4かIPv6のどちらかをサポートするようにrcmd()を変更するのにおいて可能であるべきです、gethostbyname()によって返されたアドレスファミリーに基づいて。)

12.  Future Items

12. 将来の項目

   Some additional items may require standardization, but no concrete
   proposals have been made for the API to perform these tasks.  These
   may be addressed in a later document.

数個の追加項目が標準化を必要とするかもしれませんが、APIがこれらのタスクを実行するのを具体的な提案を全くしていません。 これらは後のドキュメントで扱われるかもしれません。

12.1.  Flow Labels

12.1. 流れラベル

   Earlier revisions of this document specified a set of
   inet6_flow_XXX() functions to assign, share, and free IPv6 flow
   labels.  Consensus, however, indicated that it was premature to
   specify this part of the API.

このドキュメントの以前の改正は、IPv6流れラベルを割り当てて、共有して、解放するために1セットのinet6_流れ_XXX()機能を指定しました。 しかしながら、コンセンサスは、APIのこの部分を指定するのが時期尚早であることを示しました。

Stevens & Thomas             Informational                     [Page 55]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[55ページ]のRFC IPv6 February 1998に、高度なソケットAPI

12.2.  Path MTU Discovery and UDP

12.2. 経路MTU発見とUDP

   A standard method may be desirable for a UDP application to determine
   the "maximum send transport-message size" (Section 5.1 of [RFC-1981])
   to a given destination.  This would let the UDP application send
   smaller datagrams to the destination, avoiding fragmentation.

UDPアプリケーションが決定するのにおいて標準方法が望ましいかもしれない、当然のことの目的地に「最大は輸送メッセージサイズを送る」([RFC-1981]のセクション5.1)。 これで、断片化を避けて、UDPアプリケーションは、より小さいデータグラムを目的地に送るでしょう。

12.3.  Neighbor Reachability and UDP

12.3. 隣人の可到達性とUDP

   A standard method may be desirable for a UDP application to tell the
   kernel that it is making forward progress with a given peer (Section
   7.3.1 of [RFC-1970]).  This could save unneeded neighbor
   solicitations and neighbor advertisements.

UDPアプリケーションが、与えられた同輩(.1セクション7.3[RFC-1970])と共に前進の進歩をしているとカーネルに言うのにおいて標準方法は望ましいかもしれません。 これは不要な隣人懇願と隣人広告を保存するかもしれません。

13.  Summary of New Definitions

13. 新しい定義の概要

   The following list summarizes the constants and structure,
   definitions discussed in this memo, sorted by header.

以下のリストはヘッダーによって分類されたこのメモで議論した定数と構造、定義をまとめます。

     <netinet/icmp6.h> ICMP6_DST_UNREACH
     <netinet/icmp6.h> ICMP6_DST_UNREACH_ADDR
     <netinet/icmp6.h> ICMP6_DST_UNREACH_ADMIN
     <netinet/icmp6.h> ICMP6_DST_UNREACH_NOPORT
     <netinet/icmp6.h> ICMP6_DST_UNREACH_NOROUTE
     <netinet/icmp6.h> ICMP6_DST_UNREACH_NOTNEIGHBOR
     <netinet/icmp6.h> ICMP6_ECHO_REPLY
     <netinet/icmp6.h> ICMP6_ECHO_REQUEST
     <netinet/icmp6.h> ICMP6_INFOMSG_MASK
     <netinet/icmp6.h> ICMP6_MEMBERSHIP_QUERY
     <netinet/icmp6.h> ICMP6_MEMBERSHIP_REDUCTION
     <netinet/icmp6.h> ICMP6_MEMBERSHIP_REPORT
     <netinet/icmp6.h> ICMP6_PACKET_TOO_BIG
     <netinet/icmp6.h> ICMP6_PARAMPROB_HEADER
     <netinet/icmp6.h> ICMP6_PARAMPROB_NEXTHEADER
     <netinet/icmp6.h> ICMP6_PARAMPROB_OPTION
     <netinet/icmp6.h> ICMP6_PARAM_PROB
     <netinet/icmp6.h> ICMP6_TIME_EXCEEDED
     <netinet/icmp6.h> ICMP6_TIME_EXCEED_REASSEMBLY
     <netinet/icmp6.h> ICMP6_TIME_EXCEED_TRANSIT
     <netinet/icmp6.h> ND_NA_FLAG_OVERRIDE
     <netinet/icmp6.h> ND_NA_FLAG_ROUTER
     <netinet/icmp6.h> ND_NA_FLAG_SOLICITED
     <netinet/icmp6.h> ND_NEIGHBOR_ADVERT
     <netinet/icmp6.h> ND_NEIGHBOR_SOLICIT
     <netinet/icmp6.h> ND_OPT_MTU
     <netinet/icmp6.h> ND_OPT_PI_FLAG_AUTO
     <netinet/icmp6.h> ND_OPT_PI_FLAG_ONLINK
     <netinet/icmp6.h> ND_OPT_PREFIX_INFORMATION

<netinet/icmp6.h>ICMP6_DST_UNREACH<netinet/icmp6.h>ICMP6_DST_UNREACH_ADDR<netinet/icmp6.h>ICMP6_DST_UNREACH_アドミン<netinet/icmp6.h>ICMP6_DST_UNREACH_NOPORT<netinet/icmp6.h>ICMP6_DST_UNREACH_NOROUTE<netinet/icmp6.h>ICMP6_DST_UNREACH_NOTNEIGHBOR<netinet/icmp6; h>ICMP6_ECHO_REPLY<netinet/icmp6.h>ICMP6_ECHO_REQUEST<netinet/icmp6.h>ICMP6_INFOMSG_MASK<netinet/icmp6.h>ICMP6_MEMBERSHIP_QUERY<netinet/icmp6.h>ICMP6_MEMBERSHIP_REDUCTION<netinet/icmp6.h>ICMP6_MEMBERSHIP_REPORT<netinet/icmp6; h>ICMP6_PACKET、も_BIG<netinet/icmp6.h>ICMP6_PARAMPROB_HEADER<netinet/icmp6.h>ICMP6_PARAMPROB_NEXTHEADER<netinet/icmp6.h>ICMP6_PARAMPROB_OPTION<netinet/icmp6.h>ICMP6_PARAM_PROB<netinet/icmp6.h>ICMP6_タイム誌_EXCEEDED<netinet/icmp6; __h>ICMP6_タイム誌EXCEED_REASSEMBLY<netinet/icmp6.h>ICMP6_タイム誌_EXCEED_TRANSIT<netinet/icmp6.h>ノースダコタ_NA_FLAG_OVERRIDE<netinet/icmp6.h>ノースダコタ_NA_FLAG_ROUTER<netinet/icmp6.h>ノースダコタ_NA_FLAG_SOLICITED<netinet/icmp6.h>ノースダコタ_NEIGHBOR_ADVERT<netinet/icmp6.h>ノースダコタNEIGHBOR_SOLICIT<netinet/icmp6. h>ノースダコタ_が_netinet/icmp6.h>ノースダコタ_が選ぶMTU<を選ぶ、__の自動<netinet/icmp6.h>パイ_FLAGノースダコタ_が_ONLINK<netinet/icmp6.h>ノースダコタ_が選ぶパイ_旗の_を選ぶ、__情報を前に置いてください。

Stevens & Thomas             Informational                     [Page 56]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[56ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     <netinet/icmp6.h> ND_OPT_REDIRECTED_HEADER
     <netinet/icmp6.h> ND_OPT_SOURCE_LINKADDR
     <netinet/icmp6.h> ND_OPT_TARGET_LINKADDR
     <netinet/icmp6.h> ND_RA_FLAG_MANAGED
     <netinet/icmp6.h> ND_RA_FLAG_OTHER
     <netinet/icmp6.h> ND_REDIRECT
     <netinet/icmp6.h> ND_ROUTER_ADVERT
     <netinet/icmp6.h> ND_ROUTER_SOLICIT

<netinet/icmp6.h>ノースダコタ_が向け直された_のヘッダー<netinet/icmp6.h>ノースダコタ_が選ぶ_を選ぶ、_ソース_LINKADDR<netinet/icmp6.h>ノースダコタ_が_管理された<の_再直接の<netinet/icmp6.h>netinet/icmp6.h>ノースダコタ_RA_旗_もう一方<netinet/icmp6.h>ノースダコタ_第ルータ_が言及する目的の_の<netinet/icmp6.h>_LINKADDR RA_第旗の_を選ぶ、<netinet/icmp6.h>ノースダコタ_ルータ_は請求します。

     <netinet/icmp6.h> struct icmp6_filter{};
     <netinet/icmp6.h> struct icmp6_hdr{};
     <netinet/icmp6.h> struct nd_neighbor_advert{};
     <netinet/icmp6.h> struct nd_neighbor_solicit{};
     <netinet/icmp6.h> struct nd_opt_hdr{};
     <netinet/icmp6.h> struct nd_opt_mtu{};
     <netinet/icmp6.h> struct nd_opt_prefix_info{};
     <netinet/icmp6.h> struct nd_opt_rd_hdr{};
     <netinet/icmp6.h> struct nd_redirect{};
     <netinet/icmp6.h> struct nd_router_advert{};
     <netinet/icmp6.h> struct nd_router_solicit{};

<netinet/icmp6.h>struct icmp6_フィルタ、。 <netinet/icmp6.h>struct icmp6_hdr、。 <netinet/icmp6.h>struct、_隣人_が第言及する、。 <netinet/icmp6.h>struct、_隣人_が第請求する、。 <netinet/icmp6.h>struct、__hdrを第選んでください、。 <netinet/icmp6.h>struct、__mtuを第選んでください、。 <netinet/icmp6.h>struct、__接頭語_インフォメーションを第選んでください、。 <netinet/icmp6.h>struct、__を第選んでください、_第hdr、。 <netinet/icmp6.h>struct、_第再直接、。 <netinet/icmp6.h>struct、_ルータ_が第言及する、。 <netinet/icmp6.h>struct、_ルータ_が第請求する、。

     <netinet/in.h>    IPPROTO_AH
     <netinet/in.h>    IPPROTO_DSTOPTS
     <netinet/in.h>    IPPROTO_ESP
     <netinet/in.h>    IPPROTO_FRAGMENT
     <netinet/in.h>    IPPROTO_HOPOPTS
     <netinet/in.h>    IPPROTO_ICMPV6
     <netinet/in.h>    IPPROTO_IPV6
     <netinet/in.h>    IPPROTO_NONE
     <netinet/in.h>    IPPROTO_ROUTING
     <netinet/in.h>    IPV6_DSTOPTS
     <netinet/in.h>    IPV6_HOPLIMIT
     <netinet/in.h>    IPV6_HOPOPTS
     <netinet/in.h>    IPV6_NEXTHOP
     <netinet/in.h>    IPV6_PKTINFO
     <netinet/in.h>    IPV6_PKTOPTIONS
     <netinet/in.h>    IPV6_RTHDR
     <netinet/in.h>    IPV6_RTHDR_LOOSE
     <netinet/in.h>    IPV6_RTHDR_STRICT
     <netinet/in.h>    IPV6_RTHDR_TYPE_0
     <netinet/in.h>    struct in6_pktinfo{};

_ああ、<netinet/in.h>IPPROTO_DSTOPTS<netinet/in.h>IPPROTO_超能力<netinet/in.h>IPPROTO_断片<netinet/in.h>IPPROTO_HOPOPTS<netinet/in.h>IPPROTO_ICMPV6<netinet/in.h>IPPROTO_IPV6<netinet/in.h>IPPROTO。<netinet/in.h>IPPROTO、_なにもに、<netinet/in.h>IPPROTO_ルーティング<netinet/in.h>IPV6_DSTOPTS<は中で/をnetinetします; h>IPV6_HOPLIMIT<netinet/in.h>IPV6_HOPOPTS<netinet/in.h>IPV6_NEXTHOP<netinet/in.h>IPV6_PKTINFO<netinet/in.h>IPV6_PKTOPTIONS<netinet/in.h>IPV6_RTHDR<netinet/in.h>IPV6_RTHDR_LOOSE<netinet/in.h>IPV6_RTHDR_STRICT<netinet/in.h>IPV6_RTHDR_TYPE_0<netinet/in.h>struct in6_pktinfo、。

     <netinet/ip6.h>   IP6F_OFF_MASK
     <netinet/ip6.h>   IP6F_RESERVED_MASK
     <netinet/ip6.h>   IP6F_MORE_FRAG
     <netinet/ip6.h>   struct ip6_dest{};
     <netinet/ip6.h>   struct ip6_frag{};
     <netinet/ip6.h>   struct ip6_hbh{};

<netinet/ip6.h>IP6F_OFF_MASK<netinet/ip6.h>IP6F_RESERVED_MASK<netinet/ip6.h>IP6F_MORE_FRAG<netinet/ip6.h>struct ip6_dest、。 <netinet/ip6.h>struct ip6_が破片手榴弾で殺傷される、。 <netinet/ip6.h>struct ip6_hbh、。

Stevens & Thomas             Informational                     [Page 57]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[57ページ]のRFC IPv6 February 1998に、高度なソケットAPI

     <netinet/ip6.h>   struct ip6_hdr{};
     <netinet/ip6.h>   struct ip6_rthdr{};
     <netinet/ip6.h>   struct ip6_rthdr0{};

<netinet/ip6.h>struct ip6_hdr、。 <netinet/ip6.h>struct ip6_rthdr、。 <netinet/ip6.h>struct ip6_rthdr0、。

     <sys/socket.h>    struct cmsghdr{};
     <sys/socket.h>    struct msghdr{};

<sys/socket.h>struct cmsghdr、。 <sys/socket.h>struct msghdr、。

   The following list summarizes the function and macro prototypes
   discussed in this memo, sorted by header.

以下のリストはヘッダーによって分類されたこのメモで議論した機能とマクロ原型をまとめます。

<netinet/icmp6.h> void ICMP6_FILTER_SETBLOCK(int,
                                                struct icmp6_filter *);
<netinet/icmp6.h> void ICMP6_FILTER_SETBLOCKALL(struct icmp6_filter *);
<netinet/icmp6.h> void ICMP6_FILTER_SETPASS(int, struct icmp6_filter *);
<netinet/icmp6.h> void ICMP6_FILTER_SETPASSALL(struct icmp6_filter *);
<netinet/icmp6.h> int  ICMP6_FILTER_WILLBLOCK(int,
                                           const struct icmp6_filter *);
<netinet/icmp6.h> int  ICMP6_FILTER_WILLPASS(int,
                                           const struct icmp6_filter *);

<のnetinet/icmp6.hの>の空の_ICMP6_FILTER SETBLOCK(int、struct icmp6_フィルタ*)。 <のnetinet/icmp6.hの>の空の_ICMP6_FILTER SETBLOCKALL(struct icmp6_フィルタ*)。 <のnetinet/icmp6.hの>の空の_ICMP6_FILTER SETPASS(int、struct icmp6_フィルタ*)。 <のnetinet/icmp6.hの>の空の_ICMP6_FILTER SETPASSALL(struct icmp6_フィルタ*)。 <netinet/icmp6.h>int ICMP6_FILTER_WILLBLOCK(int、const struct icmp6_フィルタ*)。 <netinet/icmp6.h>int ICMP6_FILTER_WILLPASS(int、const struct icmp6_フィルタ*)。

<netinet/in.h>    int IN6_ARE_ADDR_EQUAL(const struct in6_addr *,
                                         const struct in6_addr *);

<netinet/in.h>int IN6_は_ADDR_EQUAL(const struct in6_addr*、const struct in6_addr*)です。

<netinet/in.h>    uint8_t *inet6_option_alloc(struct cmsghdr *,
                                               int, int, int);
<netinet/in.h>    int inet6_option_append(struct cmsghdr *,
                                          const uint8_t *, int, int);
<netinet/in.h>    int inet6_option_find(const struct cmsghdr *,
                                        uint8_t *, int);
<netinet/in.h>    int inet6_option_init(void *, struct cmsghdr **, int);
<netinet/in.h>    int inet6_option_next(const struct cmsghdr *,
                                        uint8_t **);
<netinet/in.h>    int inet6_option_space(int);

_<netinet/in.h>uint8_t*inet6_オプションalloc(struct cmsghdr*、int、int、int)。 <netinet/in.h>int inet6_オプション_は(struct cmsghdr*、const uint8_t*、int、int)を追加します。 <netinet/in.h>int inet6_オプション_掘り出し物(const struct cmsghdr*、uint8_t*、int)。 <netinet/in.h>int inet6_オプション_イニット(空間*、struct cmsghdr**、int)。 次の<netinet/in.h>int inet6_オプション_(const struct cmsghdr*、uint8_t**)。 <netinet/in.h>int inet6_オプション_スペース(int)。

<netinet/in.h>    int inet6_rthdr_add(struct cmsghdr *,
                                      const struct in6_addr *,
                                      unsigned int);
<netinet/in.h>    struct in6_addr inet6_rthdr_getaddr(struct cmsghdr *,
                                                      int);
<netinet/in.h>    int inet6_rthdr_getflags(const struct cmsghdr *, int);
<netinet/in.h>    struct cmsghdr *inet6_rthdr_init(void *, int);
<netinet/in.h>    int inet6_rthdr_lasthop(struct cmsghdr *,
                                                          unsigned int);
<netinet/in.h>    int inet6_rthdr_reverse(const struct cmsghdr *,
                                          struct cmsghdr *);
<netinet/in.h>    int inet6_rthdr_segments(const struct cmsghdr *);
<netinet/in.h>    size_t inet6_rthdr_space(int, int);

<netinet/in.h>int inet6_rthdr_は(struct cmsghdr*、const struct in6_addr*、無記名のint)を加えます。 <netinet/in.h>struct in6_addr inet6_rthdr_getaddr(struct cmsghdr*、int)。 <netinet/in.h>int inet6_rthdr_getflags(const struct cmsghdr*、int)。 <netinet/in.h>struct cmsghdr*inet6_rthdr_イニット(空間*、int)。 <netinet/in.h>int inet6_rthdr_lasthop(struct cmsghdr*、無記名のint)。 <netinet/in.h>int inet6_rthdr_逆(const struct cmsghdr*、struct cmsghdr*)。 <netinet/in.h>int inet6_rthdr_セグメント(const struct cmsghdr*)。 <netinet/in.h>サイズ_t inet6_rthdr_スペース(int、int)。

Stevens & Thomas             Informational                     [Page 58]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[58ページ]のRFC IPv6 February 1998に、高度なソケットAPI

<sys/socket.h>    unsigned char *CMSG_DATA(const struct cmsghdr *);
<sys/socket.h>    struct cmsghdr *CMSG_FIRSTHDR(const struct msghdr *);
<sys/socket.h>    unsigned int CMSG_LEN(unsigned int);
<sys/socket.h>    struct cmsghdr *CMSG_NXTHDR(const struct msghdr *mhdr,
                                              const struct cmsghdr *);
<sys/socket.h>    unsigned int CMSG_SPACE(unsigned int);

<のsys/socket.hの>の無記名の炭*のCMSG_DATA(const struct cmsghdr*)。 <sys/socket.h>struct cmsghdr*CMSG_FIRSTHDR(const struct msghdr*)。 <のsys/socket.hの>の無記名のint CMSG_LEN(無記名のint)。 <sys/socket.h>struct cmsghdr*CMSG_NXTHDR(const struct msghdr*mhdr、const struct cmsghdr*)。 <のsys/socket.hの>の無記名のint CMSG_SPACE(無記名のint)。

<unistd.h>        int rresvport_af(int *, int);

<unistd.h>int rresvport_af(int*、int)。

14.  Security Considerations

14. セキュリティ問題

   The setting of certain Hop-by-Hop options and Destination options may
   be restricted to privileged processes.  Similarly some Hop-by-Hop
   options and Destination options may not be returned to nonprivileged
   applications.

あるホップによるHopオプションとDestinationオプションの設定は特権がある過程に制限されるかもしれません。 同様に、いくつかのホップによるHopオプションとDestinationオプションは「非-特権を与え」させられたアプリケーションに返されないかもしれません。

15.  Change History

15. 変化歴史

   Changes from the June 1997 Edition (-03 draft)

1997年6月の版からの変化(-03草稿)

    -  Added a note that defined constants for multibyte fields are in
       network byte order.  This affects the ip6f_offlg member of the
       Fragment header (Section 2.1.2) and the nd_na_flags_reserved
       member of the nd_neighbor_advert structure (Section 2.2.2).

- ネットワークバイトオーダーには「マルチ-バイト」分野への定義された定数があるというメモを加えました。 そして、これがFragmentヘッダー(セクション2.1.2)のip6f_offlgメンバーに影響する、_Na_が_控え目なメンバーに第旗を揚げさせる、_隣人_は構造(セクション2.2.2)について第言及します。

    -  Section 5: the ipi6_ifindex member of the in6_pktinfo structure
       should be "unsigned int" instead of "int", for consistency with
       the interface indexes in [RFC-2133].

- セクション5: in6_pktinfo構造のipi6_ifindex部材は"int"の代わりに「無記名のint」であるべきです、インタフェースインデックスが[RFC-2133]にある一貫性のために。

    -  Section 6.3.7: the three calls to inet6_option_space() in the
       examples needed to be arguments to malloc().  The final one of
       these was missing the "6" in the name "inet6_option_space".

- セクション6.3.7: 例のinet6_オプション_スペース()への3つの呼び出しが、malloc()への議論である必要がありました。 これらの最終的な1つは「名前「inet6_オプション_スペース」の6インチ」を逃していました。

    -  Section 8.6: the function prototype for inet6_rthdr_segments()
       was missing the ending semicolon.

- セクション8.6: inet6_rthdr_セグメント()のための関数原型は終わりのセミコロンを逃していました。

   Changes from the March 1997 Edition (-02 draft)

1997年3月の版からの変化(-02草稿)

    -  In May 1997 Draft 6.6 of Posix 1003.1g (called Posix.1g herein)
       passed ballot and will be forwarded to the IEEE Standards Board
       later in 1997 for final approval.  Some changes made for this
       final Posix draft are incorporated into this Internet Draft,
       specifically the datatypes mentioned in Section 1 (and used
       throughout the text), and the socklen_t datatype used in Section
       4.1 and 4.2.

- Posix1003.1の1997年5月のDraft6.6では、g(ここにPosix.1gと呼ばれる)を投票を通過して、1997年に後で最終承認のために、IEEE Standards Boardに送るでしょう。 この最終的なPosix草稿のために行われたいくつかの変更がこのインターネットDraft、明確にセクション1(そして、テキスト中で使用されます)で言及されたデータ型式、およびセクション4.1と4.2で使用されるsocklen_tデータ型式に組み入れられます。

    -  Section 1: Added the intN_t signed datatypes, changed the
       datatype u_intN_t to uintN_t (no underscore after the "u"), and

- セクション1: そしてuintN_t(「u」の後の強調がない)にintN_tがデータ型式にサインしたと言い足して、データ型式u_intN_tを変えた。

Stevens & Thomas             Informational                     [Page 59]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[59ページ]のRFC IPv6 February 1998に、高度なソケットAPI

       removed the datatype u_intNm_t, as per Draft 6.6 of Posix.1g.

Posix.1gのDraft6.6に従ってデータ型式u_intNm_tを取り外しました。

    -  Name space issues for structure and constant names in Section 2:
       Many of the structure member names and constant names were
       changed so that the prefixes are the same.  The following
       prefixes are used for structure members: "ip6_", "icmp6_", and
       "nd_".  All constants have the prefixes "ICMP6_" and "ND_".

- セクション2の構造と一定の名前にちなんでスペースを問題と命名してください: 構造メンバ名と一定の名前の多くを変えたので、接頭語は同じです。 以下の接頭語は構造メンバーに使用されます: そして、「ip6_」、「icmp6_」、「第_、」 すべての定数には、接頭語「ICMP6_」と「ノースダコタ_」があります。

    -  New definitions: Section 2.1.2: contains definitions for the IPv6
       extension headers, other than AH and ESP.  Section 2.2.2:
       contains additional structures and constants for the neighbor
       discovery option header and redirected header.

- 新しい定義: セクション2.1.2: AHと超能力以外のIPv6拡張ヘッダーのための定義を含んでいます。 セクション2.2.2: 隣人発見オプションヘッダーと向け直されたヘッダーのための追加構造と定数を含んでいます。

    -  Section 2.2.2: the enum for the neighbor discovery option field
       was changed to be a set of #define constants.

- セクション2.2.2: 1セットの#、になるようにオプション・フィールドを変えたという隣人発見のためのenumは定数を定義します。

    -  Changed the word "function" to "macro" for references to all the
       uppercase names in Sections 2.3 (IN6_ARE_ADDR_EQUAL), 3.2
       (ICMPV6_FILTER_xxx), and 4.3 (CMSG_xxx).

- セクション2.3(IN6_は_ADDR_EQUALです)、3.2(ICMPV6_FILTER_xxx)と4.3(CMSG_xxx)におけるすべての大文字している名前の参照のために「機能」という言葉を「マクロ」に変えました。

    -  Added more protocols to the /etc/protocols file (Section 2.4) and
       changed the name of "icmpv6" to "ipv6-icmp".

- /etc/protocolsファイル(セクション2.4)により多くのプロトコルを追加して、「"ipv6-icmp"へのicmpv6"」の名前を変えました。

    -  Section 3: Made it more explicit that an application cannot read
       or write entire IPv6 packets, that all extension headers are
       passed as ancillary data.  Added a sentence that the kernel
       fragments packets written to an IPv6 raw socket when necessary.
       Added a note that IPPROTO_RAW raw IPv6 sockets are not special.

- セクション3: アプリケーションが全体のIPv6パケットを読むことができませんし、書くことができないで、すべての拡張ヘッダーが補助データとして渡されるのをより明白にしました。 文を加える、カーネルは必要であるときにIPv6の生のソケットに書かれたパケットを断片化します。 IPPROTO_RAWの生のIPv6ソケットが特別でないというメモを加えました。

    -  Section 3.1: Explicitly stated that the checksum option applies
       to both outgoing packets and received packets.

- セクション3.1: チェックサムオプションが両方の出発しているパケットに適用されると明らかに述べて、パケットを受けました。

    -  Section 3.2: Changed the array name within the icmp6_filter
       structure from "data" to "icmp6_filt".  Changes the prefix for
       the filter macros from "ICMPV6_" to "ICMP6_", for consistency
       with the names in Section 2.2.  Changed the example from a ping
       program to a program that wants to receive only router
       advertisements.

- セクション3.2: icmp6_フィルタ構造の中で配列名を「データ」から「icmp6_filt」に変えました。 名前がセクション2.2にある状態で、「ICMPV6_」から「ICMP6_」までのフィルタマクロ、一貫性のために接頭語を変えます。 例をピングプログラムからルータ通知だけを受け取りたがっているプログラムに変えました。

    -  Section 4.1: Changed msg_namelen and msg_controllen from size_t
       to the Posix.1g socklen_t datatype.  Updated the Note that
       follows.

- セクション4.1: 変えられたmsg_namelenとmsg_はサイズ_tからPosix.1g socklen_tデータ型式までcontrollenされます。 続くNoteをアップデートしました。

    -  Section 4.2: Changed cmsg_len from size_t to the Posix.1g
       socklen_t datatype.  Updated the Note that follows.

- セクション4.2: cmsg_lenをサイズ_tからPosix.1g socklen_tデータ型式に変えました。 続くNoteをアップデートしました。

Stevens & Thomas             Informational                     [Page 60]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[60ページ]のRFC IPv6 February 1998に、高度なソケットAPI

    -  Section 4.4: Added a Note that the second and third arguments to
       getsockopt() and setsockopt() are intentionally the same as the
       cmsg_level and cmsg_type members.

- セクション4.4: cmsg_レベルとcmsg_タイプメンバーとして同じように、getsockopt()とsetsockopt()への2番目と3番目の議論が故意にそうであるNoteを加えました。

    -  Section 4.5: Reorganized the section into a description of the
       option, followed by the TCP semantics, and the UDP and raw socket
       semantics.  Added a sentence on how to clear all the sticky
       options.  Added a note that TCP need not save the options from
       the most recently received segment until the application says to
       do so.  Added the statement that ancillary data is never passed
       with sendmsg() or recvmsg() on a TCP socket.  Simplified the
       interaction of the sticky options with ancillary data for UDP or
       raw IP: none of the sticky options are sent if ancillary data is
       specified.

- セクション4.5: TCP意味論があとに続いたオプションの記述、UDP、および生のソケット意味論にセクションを再編成しました。 どうすべてのねばねばするオプションをクリアするかに関する文を加えました。 アプリケーションがそうするために言うまでTCPが大部分からオプションを保存する必要はないというメモが最近セグメントを受けたと言い足しました。 補助データがTCPソケットの上にsendmsg()かrecvmsg()で決して通過されないという声明を加えました。 簡素化されて、ねばねばすることの相互作用はUDPか生のIPのための補助データと共に以下をゆだねます。 補助データが指定されるなら、ねばねばするオプションのいずれも送られません。

    -  Final paragraph of Section 5.1: ipi6_index should be
       ipi6_ifindex.

- セクション5.1の最終節: ipi6_インデックスはipi6_ifindexであるべきです。

    -  Section 5.4: Added a note on the term "privileged".

- セクション5.4: 「特権がある」という諸条件の注意を加えました。

    -  Section 5.5: Noted that the errors listed are examples, and the
       actual errors depend on the implementation.

- セクション5.5: 記載された誤りが例であり、実際の誤りが実現によることに注意しました。

    -  Removed Section 6 ("Flow Labels") as the consensus is that it is
       premature to try and specify an API for this feature.  Access to
       the flow label field in the IPv6 header is still provided through
       the sin6_flowinfo member of the IPv6 socket address structure in
       [RFC-2133].  Added a subsection to Section 13 that this is a
       future item.

- 取り除かれたセクション6(「流れラベル」) コンセンサスがこの特徴にAPIを指定してみるのが時期尚早であるということであるので。 [RFC-2133]のIPv6ソケットアドレス構造のsin6_flowinfo部材を通してまだIPv6ヘッダーの流れラベルフィールドへのアクセスを提供しています。 これはセクション13への小区分ですが、加えられました。未来の項目。

       All remaining changes are identified by their section number in
       the previous draft.  With the removal of Section 6, the section
       numbers are decremented by one.

すべての残っている変化が前の草稿におけるそれらのセクション番号によって特定されます。 セクション6の取り外しによると、セクション番号は1つ減少します。

    -  Section 7.3.7: the calls to malloc() in all three examples should
       be calls to inet6_option_space() instead.  The two calls to
       inet6_option_append() in the third example should be calls to
       inet6_option_alloc().  The two calls to CMSG_SPACE() in the first
       and third examples should be calls to CMSG_LEN().  The second
       call to CMSG_SPACE() in the second example should be a call to
       CMSG_LEN().

- セクション7.3.7: すべての3つの例のmalloc()への呼び出しは() 代わりにinet6_オプション_スペースへの呼び出しであるべきです。 inet6_オプション_への2つの呼び出しが_inet6への呼び出しがオプション_alloc()であったなら3番目の例の()を追加します。 1番目のCMSG_SPACE()への2つの呼び出しと3番目の例はCMSG_LEN()への呼び出しであるべきです。 2番目の例のCMSG_SPACE()への2番目の呼び出しはCMSG_LEN()への呼び出しであるべきです。

    -  Section 7.3.7: All the opt_X_ and opt_Y_ structure member names
       were changed to be ip6_X_opt_ and ip6_Y_opt_.  The two structure
       names ipv6_opt_X and ipv6_opt_Y were changed to ip6_X_opt and
       ip6_Y_opt.  The constants beginning with IPV6_OPT_X_ and
       IPV6_OPT_Y_ were changed to begin with IP6_X_OPT_ and IP6_Y_OPT_.

- セクション7.3.7: _X_を選んでください、そして、選んでください。ip6_X_は_を選びます、そして、ip6_Y_は_を選びます。すべて、_Y_構造メンバ名は_2構造名前ipv6_がXとipv6_が選ぶ_を選ぶということになるように変えて、YがX_が選ぶip6_に変わったということであり、ip6_Y_は選びます。 初めに、IPV6と共に_OPT_X_とIPV6_OPT_Y_を始める定数を変えました。_IP6_X OPT_と_IP6_Y OPT_。

Stevens & Thomas             Informational                     [Page 61]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[61ページ]のRFC IPv6 February 1998に、高度なソケットAPI

    -  Use the term "Routing header" throughout the draft, instead of
       "source routing".  Changed the names of the eight
       inet6_srcrt_XXX() functions in Section 9 to inet6_rthdr_XXX().
       Changed the name of the socket option from IPV6_SRCRT to
       IPV6_RTHDR, and the names of the three IPV6_SRCRT_xxx constants
       in Section 9 to IPV6_RTHDR_xxx.

- 「ソースルーティング」の代わりに草稿の間中「ルート設定ヘッダー」という用語を使用してください。 セクション9における8つのinet6_srcrt_XXX()機能の名前をinet6_rthdr_XXX()に変えました。 IPV6_SRCRTからIPV6_RTHDRと、セクション9における3つのIPV6_SRCRT_xxx定数の名前からIPV6_RTHDR_xxxまでのソケットオプションの名前を変えました。

    -  Added a paragraph to Section 9 on how to receive and send a
       Routing header.

- ルート設定ヘッダーを受けて、どう送るかに関してセクション9にパラグラフを追加しました。

    -  Changed inet6_rthdr_add() and inet6_rthdr_reverse() so that they
       return -1 upon an error, instead of an Exxx errno value.

- 変えられたinet6_rthdr_は、() ()とinet6_rthdr_が逆になるので彼らがExxx errno値の代わりに誤りに-1を返すと言い足します。

    -  In the description of inet6_rthdr_space() in Section 9.1, added
       the qualifier "For an IPv6 Type 0 Routing header" to the
       restriction of between 1 and 23 segments.

- inet6_rthdr_の記述では、セクション9.1で()を区切ってください、と資格を与える人は「IPv6 Type0ルート設定ヘッダー」のために1〜23のセグメントの制限に追加しました。

    -  Refer to final function argument in Sections 9.7 and 9.8 as
       index, not offset.

- 相殺するのではなく、セクション9.7と9.8における最終的な機能議論をインデックスを参照してください。

    -  Updated Section 14 with new names from Section 2.

- 新しい名前でセクション2からセクション14をアップデートしました。

    -  Changed the References from "[n]" to "[RFC-abcd]".

- "[n]"から「[RFC-abcd]」までの参照を変えました。

   Changes from the February 1997 Edition (-01 draft)

1997年2月の版からの変化(-01草稿)

    -  Changed the name of the ip6hdr structure to ip6_hdr (Section 2.1)
       for consistency with the icmp6hdr structure.  Also changed the
       name of the ip6hdrctl structure contained within the ip6_hdr
       structure to ip6_hdrctl (Section 2.1).  Finally, changed the name
       of the icmp6hdr structure to icmp6_hdr (Section 2.2).  All other
       occurrences of this structure name, within the Neighbor Discovery
       structures in Section 2.2.1, already contained the underscore.

- icmp6hdr構造に従って、一貫性のためにip6hdr構造の名前をip6_hdr(セクション2.1)に変えました。 また、ip6_hdr構造の中にip6_hdrctl(セクション2.1)に含まれたip6hdrctl構造の名前を変えました。 最終的に、変えて、icmp6hdrの名前は_hdr(セクション2.2)をicmp6に構造化します。 この構造名の他のすべての発生がセクション2.2.1におけるNeighborディスカバリー構造の中に既に強調を含みました。

    -  The "struct nd_router_solicit" and "struct nd_router_advert"
       should both begin with "nd6_". (Section 2.2.2).

- _ルータ_は言及します。「struct、_ルータ_が第請求する、」、「struct、」 ともに、「nd6_」で第始まるべきです。 (セクション2.2.2。)

    -  Changed the name of in6_are_addr_equal to IN6_ARE_ADDR_EQUAL
       (Section 2.3) for consistency with basic API address testing
       functions.  The header defining this macro is <netinet/in.h>.

- 変えて、in6_の名前は_IN6_と等しいaddr_が_ADDR_EQUAL(セクション2.3)であるということです。基本的なAPIアドレスが機能をテストしている一貫性のために。 このマクロを定義するヘッダーは<netinet/in.h>です。

    -  getprotobyname("ipv6") now returns 41, not 0 (Section 2.4).

- getprotobyname、(「ipv6") 現在は0(セクション2.4)ではなく41を返します」。

    -  The first occurrence of "struct icmpv6_filter" in Section 3.2
       should be "struct icmp6_filter".

- セクション3.2における、「struct icmpv6_フィルタ」の最初の発生は「struct icmp6_フィルタ」であるべきです。

    -  Changed the name of the CMSG_LENGTH() macro to CMSG_LEN()
       (Section 4.3.5), since LEN is used throughout the <netinet/*.h>

- LENがCMSG_LEN()(セクション4.3.5)へのCMSG_LENGTH()マクロ<netinet/*.h>中で使用されるので、改称します。

Stevens & Thomas             Informational                     [Page 62]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[62ページ]のRFC IPv6 February 1998に、高度なソケットAPI

       headers.

ヘッダー。

    -  Corrected the argument name for the sample implementations of the
       CMSG_SPACE() and CMSG_LEN() macros to be "length" (Sections 4.3.4
       and 4.3.5).

- CMSG_SPACE()とCMSG_LEN()マクロのサンプル実現が「長さ」であるために議論名を修正する、(セクション4.3 .4と4.3、.5)。

    -  Corrected the socket option mentioned in Section 5.1 to specify
       the interface for multicasting from IPV6_ADD_MEMBERSHIP to
       IPV6_MULTICAST_IF.

- IPV6_ADD_MEMBERSHIPからIPV6_MULTICAST_までマルチキャスティングにインタフェースを指定するためにセクション5.1で言及されたソケットオプションを修正します。

    -  There were numerous errors in the previous draft that specified
       <netinet/ip6.h> that should have been <netinet/in.h>.  These have
       all been corrected and the locations of all definitions is now
       summarized in the new Section 14 ("Summary of New Definitions").

- <netinet/in.h>であるべきであった<netinet/ip6.h>を指定した前の草稿における頻繁な誤りがありました。 これらをすべて修正してあります、そして、すべての定義の位置は現在、新しいセクション14(「新しい定義の概要」)にまとめられます。

    Changes from the October 1996 Edition (-00 draft)

1996年10月の版からの変化(-00草稿)

    -  Numerous rationale added using the format (Note: ...).

- 多数の原理は、形式(注意: …)を使用することで加えました。

    -  Added note that not all errors may be defined.

- すべての誤りが定義されるかもしれないというわけではないというメモを加えました。

    -  Added note about ICMPv4, IGMPv4, and ARPv4 terminology.

- ICMPv4、IGMPv4、およびARPv4用語に関する注を加えました。

    -  Changed the name of <netinet/ip6_icmp.h> to <netinet/icmp6.h>.

- <netinet/ip6_icmp.h>の名前を<netinet/icmp6.h>に変えました。

    -  Changed some names in Section 2.2.1: ICMPV6_PKT_TOOBIG to
       ICMPV6_PACKET_TOOBIG, ICMPV6_TIME_EXCEED to ICMPV6_TIME_EXCEEDED,
       ICMPV6_ECHORQST to ICMPV6_ECHOREQUEST, ICMPV6_ECHORPLY to
       ICMPV6_ECHOREPLY, ICMPV6_PARAMPROB_HDR to
       ICMPV6_PARAMPROB_HEADER, ICMPV6_PARAMPROB_NXT_HDR to
       ICMPV6_PARAMPROB_NEXTHEADER, and ICMPV6_PARAMPROB_OPTS to
       ICMPV6_PARAMPROB_OPTION.

- セクション2.2.1におけるいくつかの名前を変えます: ICMPV6、_ICMPV6_パケット_TOOBIGへのPKT_TOOBIG、時間_が超えているICMPV6_、_ICMPV6_は超えられていた_、ICMPV6_ECHOREQUEST、ICMPV6_ECHOREPLYへのICMPV6_ECHORPLY、ICMPV6_PARAMPROB_HDRへのICMPV6_ECHORQSTをICMPV6_PARAMPROB_ヘッダーに調節して、ICMPV6_PARAMPROBはICMPV6_PARAMPROB_NEXTHEADERへのNXT_HDRです、そして、ICMPV6_PARAMPROB_がICMPV6_PARAMPROB_オプションに選ばれます。

    -  Prepend the prefix "icmp6_" to the three members of the
       icmp6_dataun union of the icmp6hdr structure (Section 2.2).

- icmp6hdr構造(セクション2.2)のPrepend icmp6_dataunの3人のメンバーへの接頭語「icmp6_」組合。

    -  Moved the neighbor discovery definitions into the
       <netinet/icmp6.h> header, instead of being in their own header
       (Section 2.2.1).

- 隣人発見定義をそれら自身のヘッダー(セクション2.2.1)にあることの代わりに<netinet/icmp6.h>ヘッダーに動かしました。

    -  Changed Section 2.3 ("Address Testing").  The basic macros are
       now in the basic API.

- 変えられたセクション2.3 (「アドレステスト」。) 基本的なマクロが現在、基本的なAPIにあります。

    -  Added the new Section 2.4 on "Protocols File".

- 「プロトコルはファイルするところ」で新しいセクション2.4を加えました。

    -  Added note to raw sockets description that something like BPF or
       DLPI must be used to read or write entire IPv6 packets.

- 全体のIPv6パケットを読むか、または書くのに、何かがBPFかDLPIが好きであるという生のソケット記述への付記されたメモを使用しなければなりません。

Stevens & Thomas             Informational                     [Page 63]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[63ページ]のRFC IPv6 February 1998に、高度なソケットAPI

    -  Corrected example of IPV6_CHECKSUM socket option (Section 3.1).
       Also defined value of -1 to disable.

- IPV6_CHECKSUMソケットオプション(セクション3.1)の直っている例。 無効にする-1のまた、定義された値。

    -  Noted that <netinet/icmp6.h> defines all the ICMPv6 filtering
       constants, macros, and structures (Section 3.2).

- <netinet/icmp6.h>が定数、マクロ、および構造(セクション3.2)をフィルターにかけるすべてのICMPv6を定義することに注意しました。

    -  Added note on magic number 10240 for amount of ancillary data
       (Section 4.1).

- 補助データ(セクション4.1)の量のためにマジックナンバー10240に関する注を加えました。

    -  Added possible padding to picture of ancillary data (Section
       4.2).

- 補助データ(セクション4.2)の絵に可能な詰め物を追加しました。

    -  Defined <sys/socket.h> header for CMSG_xxx() functions (Section
       4.2).

- CMSG_xxx()のための定義された<sys/socket.h>ヘッダーは機能します(セクション4.2)。

    -  Note that the data returned by getsockopt(IPV6_PKTOPTIONS) for a
       TCP socket is just from the optional headers, if present, of the
       most recently received segment.  Also note that control
       information is never returned by recvmsg() for a TCP socket.

- 存在しているなら、TCPソケットのためのgetsockopt(IPV6_PKTOPTIONS)によって返されたデータがまさしく任意のヘッダーからあることに最も最近容認されたセグメントに注意してください。 また、制御情報がTCPソケットのためにrecvmsg()によって決して返されないことに注意してください。

    -  Changed header for struct in6_pktinfo from <netinet.in.h> to
       <netinet/ip6.h> (Section 5).

- struct in6_pktinfoのためにヘッダーを<netinet.in.h>から<netinet/ip6.h>(セクション5)に変えました。

    -  Removed the old Sections 5.1 and 5.2, because the interface
       identification functions went into the basic API.

- インタフェース識別機能が基本的なAPIに入ったので、古いセクション5.1と5.2を取り除きました。

    -  Redid Section 5 to support the hop limit field.

- ホップ限界分野を支持するためにセクション5をやり直しました。

    -  New Section 5.4 ("Next Hop Address").

- 新しいセクション5.4 (「次のホップアドレス」。)

    -  New Section 6 ("Flow Labels").

- 新しいセクション6 (「流れラベル」。)

    -  Changed all of Sections 7 and 8 dealing with Hop-by-Hop and
       Destination options.  We now define a set of inet6_option_XXX()
       functions.

- ホップによるHopに対処するセクション7と8とDestinationオプションのすべてを変えました。 私たちは現在、1セットのinet6_オプション_XXX()機能を定義します。

    -  Changed header for IPV6_SRCRT_xxx constants from <netinet.in.h>
       to <netinet/ip6.h> (Section 9).

- IPV6_SRCRT_xxx定数のためにヘッダーを<netinet.in.h>から<netinet/ip6.h>(セクション9)に変えました。

    -  Add inet6_rthdr_lasthop() function, and fix errors in description
       of Routing header (Section 9).

- inet6_rthdr_lasthop()機能を加えてください、そして、ルート設定ヘッダー(セクション9)の記述における誤りを修正してください。

    -  Reworded some of the Routing header descriptions to conform to
       the terminology in [RFC-1883].

- [RFC-1883]の用語に従うためにルート設定ヘッダ記述のいくつかを言い換えました。

    -  Added the example from [RFC-1883] for the Routing header (Section
       9.9).

- ルート設定ヘッダー(セクション9.9)のために[RFC-1883]から例を加えました。

Stevens & Thomas             Informational                     [Page 64]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[64ページ]のRFC IPv6 February 1998に、高度なソケットAPI

    -  Expanded the example in Section 10 to show multiple options per
       ancillary data object, and to show the receiver's ancillary data
       objects.

- 複数の補助データ物あたりのオプションを示していて、受信機の補助データ物を見せているためにセクション10の例を広げました。

    -  New Section 11 ("IPv6-Specific Options with IPv4-Mapped IPv6
       Addresses").

- 新しいセクション11 (「IPv4によって写像されたIPv6アドレスとのIPv6特有のオプション」。)

    -  New Section 12 ("rresvport_af").

- 新しいセクション12 (「rresvport_af」。)

    -  Redid old Section 10 ("Additional Items") into new Section 13
       ("Future Items").

- 新しいセクション13(「将来の項目」)に古いセクション10(「追加項目」)をやり直しました。

16.  References

16. 参照

   [RFC-1883]  Deering, S., and R. Hinden, "Internet Protocol, Version 6
               (IPv6), Specification", RFC 1883, December 1995.

[RFC-1883]のデアリング、S.とR.Hinden、「インターネットプロトコル、バージョン6(IPv6)、仕様」、RFC1883、12月1995日

   [RFC-2133]  Gilligan, R., Thomson, S., Bound, J., and W. Stevens,
               "Basic Socket Interface Extensions for IPv6", RFC 2133,
               April 1997.

[RFC-2133] ギリガンとR.とトムソンとS.とバウンド、J.とW.スティーブンス、「IPv6"、RFC2133、1997年4月のための基本的なソケットインタフェース拡大。」

   [RFC-1981]  McCann, J., Deering, S., and J. Mogul, "Path MTU
   Discovery
               for IP version 6", RFC 1981, August 1996.

[RFC-1981] マッキャン、J.、デアリング、S.、およびJ.ムガール人、「IPのための経路MTUディスカバリー、バージョン6インチ、RFC1981、1996インチ年8月。

   [RFC-1970]  Narten, T., Nordmark, E., and W. Simpson, "Neighbor
               Discovery for IP Version 6 (IPv6)", RFC 1970, August
               1996.

[RFC-1970]Narten、T.、Nordmark、E.、およびW.シンプソン、「IPバージョン6(IPv6)のための隣人発見」、RFC1970、1996年8月。

17.  Acknowledgments

17. 承認

   Matt Thomas and Jim Bound have been working on the technical details
   in this draft for over a year.  Keith Sklower is the original
   implementor of ancillary data in the BSD networking code.  Craig Metz
   provided lots of feedback, suggestions, and comments based on his
   implementing many of these features as the document was being
   written.

1年間以上、マット・トーマスとジムBoundはこの草稿に技術的詳細に取り組んでいます。 キースSklowerはBSDネットワークコードの補助データのオリジナルの作成者です。 クレイグ・メスは多くのフィードバックを提供しました、提案、そして、ドキュメントが書かれていたようにコメントがこれらの特徴の多くを彼の実行に基礎づけました。

   The following provided comments on earlier drafts: Pascal Anelli,
   Hamid Asayesh, Ran Atkinson, Karl Auerbach, Hamid Asayesh, Matt
   Crawford, Sam T. Denton, Richard Draves, Francis Dupont, Bob
   Gilligan, Tim Hartrick, Masaki Hirabaru, Yoshinobu Inoue, Mukesh
   Kacker, A. N. Kuznetsov, Pedro Marques, Jack McCann, der Mouse, John
   Moy, Thomas Narten, Erik Nordmark, Steve Parker, Charles Perkins, Tom
   Pusateri, Pedro Roque, Sameer Shah, Peter Sjodin, Stephen P.
   Spackman, Jinmei Tatuya, Karen Tracey, Quaizar Vohra, Carl Williams,
   Steve Wise, and Kazu Yamamoto.

以下は以前の草稿のコメントを提供しました: パスカルAnelli(ハミドAsayesh)はアトキンソン、カール・アウアーバック、ハミドAsayesh、マット・クロフォード、サム・T.デントン、リチャードDraves、フランシス・デュポン、ボブ・ギリガン、ティムHartrick、Masaki Hirabaru、井上由伸、Mukesh Kacker、A.N.クズネツォーフ、ペドロ・マルケス、ジャック・マッキャン、derマウス、ジョンMoy、トーマスNarten、エリックNordmark、スティーブ・パーカー、チャールズ・パーキンス、トムPusateri、ペドロ・ロッキ、Sameerシャー、ピーターSjodin、スティーブン・P.スパックマン、Jinmei Tatuya、カレン・トレーシー、カール・ウィリアムズの、そして、スティーブWiseのQuaizar Vohra、およびKazu山本を車で送りました。

Stevens & Thomas             Informational                     [Page 65]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[65ページ]のRFC IPv6 February 1998に、高度なソケットAPI

18.  Authors' Addresses

18. 作者のアドレス

   W. Richard Stevens
   1202 E. Paseo del Zorro
   Tucson, AZ  85718

W.リチャード・スティーブンス1202・E.Paseo delゾロ・ツーソン、アリゾナ 85718

   EMail: rstevens@kohala.com

メール: rstevens@kohala.com

   Matt Thomas
   AltaVista Internet Software
   LJO2-1/J8
   30 Porter Rd
   Littleton, MA  01460
   EMail: matt.thomas@altavista-software.com

ポーター第リトルトン、マットトーマスAltaVistaインターネットソフトウェアLJO2-1/J8 30MA 01460はメールされます: matt.thomas@altavista-software.com

Stevens & Thomas             Informational                     [Page 66]

RFC 2292             Advanced Sockets API for IPv6         February 1998

2292年のスティーブンスとトーマスInformational[66ページ]のRFC IPv6 February 1998に、高度なソケットAPI

19.  Full Copyright Statement

19. 完全な著作権宣言文

   Copyright (C) The Internet Society (1998).  All Rights Reserved.

Copyright(C)インターネット協会(1998)。 All rights reserved。

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works.  However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

それに関するこのドキュメントと翻訳は、コピーして、それが批評するか、またはそうでなければわかる他のもの、および派生している作品に提供するか、または準備されているかもしれなくて、コピーされて、発行されて、全体か一部広げられた実現を助けるかもしれません、どんな種類の制限なしでも、上の版権情報とこのパラグラフがそのようなすべてのコピーと派生している作品の上に含まれていれば。 しかしながら、このドキュメント自体は何らかの方法で変更されないかもしれません、インターネット協会か他のインターネット組織の版権情報か参照を取り除くのなどように、それを英語以外の言語に翻訳するのが著作権のための手順がインターネットStandardsの過程で定義したどのケースに従わなければならないか、必要に応じてさもなければ、インターネット標準を開発する目的に必要であるのを除いて。

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assigns.

上に承諾された限られた許容は、永久であり、インターネット協会、後継者または案配によって取り消されないでしょう。

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

このドキュメントとそして、「そのままで」という基礎とインターネットの振興発展を目的とする組織に、インターネット・エンジニアリング・タスク・フォースが速達の、または、暗示しているすべての保証を放棄するかどうかというここにことであり、他を含んでいて、含まれて、情報の使用がここに侵害しないどんな保証も少しもまっすぐになるという情報か市場性か特定目的への適合性のどんな黙示的な保証。

Stevens & Thomas             Informational                     [Page 67]

スティーブンスとトーマスInformationalです。[67ページ]

一覧

 RFC 1〜100  RFC 1401〜1500  RFC 2801〜2900  RFC 4201〜4300 
 RFC 101〜200  RFC 1501〜1600  RFC 2901〜3000  RFC 4301〜4400 
 RFC 201〜300  RFC 1601〜1700  RFC 3001〜3100  RFC 4401〜4500 
 RFC 301〜400  RFC 1701〜1800  RFC 3101〜3200  RFC 4501〜4600 
 RFC 401〜500  RFC 1801〜1900  RFC 3201〜3300  RFC 4601〜4700 
 RFC 501〜600  RFC 1901〜2000  RFC 3301〜3400  RFC 4701〜4800 
 RFC 601〜700  RFC 2001〜2100  RFC 3401〜3500  RFC 4801〜4900 
 RFC 701〜800  RFC 2101〜2200  RFC 3501〜3600  RFC 4901〜5000 
 RFC 801〜900  RFC 2201〜2300  RFC 3601〜3700  RFC 5001〜5100 
 RFC 901〜1000  RFC 2301〜2400  RFC 3701〜3800  RFC 5101〜5200 
 RFC 1001〜1100  RFC 2401〜2500  RFC 3801〜3900  RFC 5201〜5300 
 RFC 1101〜1200  RFC 2501〜2600  RFC 3901〜4000  RFC 5301〜5400 
 RFC 1201〜1300  RFC 2601〜2700  RFC 4001〜4100  RFC 5401〜5500 
 RFC 1301〜1400  RFC 2701〜2800  RFC 4101〜4200 

スポンサーリンク

border-style ボーダーのスタイルを指定する

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る