ip

IP(7)                      Linux Programmer's Manual                     IP(7)



åå
       ip - Linux IPv4 ãããã³ã«ã®å®è£

æ¸å¼
       #include <sys/socket.h>
       #include <netinet/in.h>
       #include <netinet/ip.h> /* ä¸è¨ã®ã¹ã¼ãã¼ã»ãã */

       tcp_socket = socket(AF_INET, SOCK_STREAM, 0);
       udp_socket = socket(AF_INET, SOCK_DGRAM, 0);
       raw_socket = socket(AF_INET, SOCK_RAW, protocol);

説æ
       Linux 㯠RFC 791 㨠RFC 1122 ã§è¨è¿°ããã¦ãã Internet Protocol, version 4
       ãå®è£ãã¦ããã ip ã«ã¯ RFC 1112 ã«æºæ ãã level 2 ãã«ãã‐
       ã£ã¹ãã®å®è£ãå«ã¾ãã¦ããã ã¾ããã±ãããã£ã«ã¿æ©è½ãå«ã IP ã«ã¼ã¿ã¼ãå®è£ããã¦ããã

       ããã°ã©ãã³ã°ã»ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ BSD ã½ã±ããã¨äºæã§ããã
       ã½ã±ããã«é¢ãããã詳細ãªæå ±ã¯ socket(7)  ãåç§ã®ãã¨ã

       IP ã½ã±ããã¯ã socket(2) é¢æ°ã socket(AF_INET, socket_type, protocol)
       ã®ããã«å¼ã³åºããã¨ã§çæããããæå®ã§ããã½ã±ããã¿ã¤ã㯠3 ã¤ããã tcp(7)
       ã½ã±ããããªã¼ãã³ããå ´å SOCK_STREAMã udp(7) ã½ã±ããããªã¼ãã³ããå ´å
       SOCK_DGRAMã IP ãããã³ã«ã«ç´æ¥ã¢ã¯ã»ã¹ãã ããã« raw(7)
       ã½ã±ããããªã¼ãã³ããå ´åã«ã¯ SOCK_RAW ã§ããã protocol ã¯éåä¿¡ããã IP
       ãããã«æ¸ããã IP ãããã³ã«ã§ããã æå®ã§ããå¤ã¯ã TCP ã½ã±ããã«ã¯ 0 ã IPPROTO_TCPã
       UDP ã½ã±ããã«ã¯ 0 ã IPPROTO_UDP ã«éãããã SOCK_RAW ã«å¯¾ãã¦ã¯ã RFC 1700
       ã§å®ç¾© ããã¦ããæå¹ãª IANA IP ãããã³ã«ãã å²ãå½ã¦ããã¦ããçªå·ã§æå®ãã
       ãã¨ãã§ããã

       When a process wants to receive new incoming packets or connections, it
       should bind a socket to a local interface address using bind(2).  In
       this case, only one IP socket may be bound to any given local (address,
       port) pair.  When INADDR_ANY is specified in the bind call, the socket
       will be bound to all local interfaces.  When listen(2)  is called on an
       unbound socket, the socket is automatically bound to a random free port
       with the local address set to INADDR_ANY.  When connect(2)  is called
       on an unbound socket, the socket is automatically bound to a random
       free port or to a usable shared port with the local address set to
       INADDR_ANY.

       SO_REUSEADDR ãã©ã°ãã»ããããã¦ããªãå ´åã«ã¯ã ãã¤ã³ãããã¦ãã TCP ã‐
       ã¼ã«ã«ã½ã±ããã¢ãã¬ã¹ã¯ ã¯ãã¼ãºãããå¾ãã°ããã®é使ããªããªãã SO_REUSEADDR
       ãã©ã°ã使ã㨠TCP ã®ä¿¡é ¼æ§ãä½ä¸ãããã®ã§ã 使ãã¨ãã«ã¯æ³¨æãå¿è¦ã§ããã

   ã¢ãã¬ã¹ã®ãã©ã¼ããã
       IP ã½ã±ããã¢ãã¬ã¹ã¯ã IP ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¢ãã¬ã¹ã¨
       16ãããã®ãã¼ãçªå·ã®çµã¿åããã§å®ç¾©ãããã IP ãããã³ã«ãã®ãã®ã¯ãã¼ãçªå·ãæ±ããªãã
       ãã¼ãçªå·ã¯ã udp(7)  ã tcp(7)  ã¨ãã£ããä¸ä½ã®ãããã³ã«ã§å®è£ãããã raw
       ã½ã±ããã§ã¯ã sin_port ã IP ãããã³ã«ã«ã»ãããããã

           struct sockaddr_in {
               sa_family_t    sin_family; /* address family: AF_INET */
               in_port_t      sin_port;   /* port in network byte order */
               struct in_addr sin_addr;   /* internet address */
           };

           /* Internet address. */
           struct in_addr {
               uint32_t       s_addr;     /* address in network byte order */
           };

       sin_familiy ã«ã¯å¸¸ã« AF_INET ãã»ãããããããã¯å¿é ã§ããã Linux 2.2
       ã§ã¯ããã®ã»ãããå¿ãã㨠ã»ã¨ãã©ã®ãããã¯ã¼ã¯é¢æ°ã¯ EINVAL ãè¿ãããã«ãªã£ã¦ããã
       sin_port ã«ã¯ãã¼ãçªå·ããããã¯ã¼ã¯ãã¤ããªã¼ãã¼ã§æå®ããã 1024
       æªæºã®ãã¼ãçªå·ã¯ ç¹æ¨©ãã¼ã (privileged ports) ã¨å¼ã°ãã (äºç´ãã¼ã
       (reserved ports) ã¨ãæãå¼ã°ãã)ã ç¹æ¨©ããã»ã¹ (CAP_NET_BIND_SERVICE
       ã±ã¼ãããªãã£ãæã¤ããã»ã¹) 以å¤ã®ããã»ã¹ã¯ããããã®ãã¼ãã«ã¯ bind(2)  ã§ããªãã
       IPv4 ãããã³ã«ãã®ãã®ã«ã¯ãã¼ãã«é¢ããæ¦å¿µããªãããã¼ããå®è£ãããã®ã¯ã tcp(7)  ã
       udp(7) ã¨ãã£ããä¸ä½ã®ãããã³ã«ã«ããã¦ã®ã¿ã§ããã

       sin_addr 㯠IP ãã¹ãã¢ãã¬ã¹ã§ããã struct in_addr ã® s_addr
       ã¡ã³ãã«ã¯ããã¹ãã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¢ãã¬ã¹ã ãããã¯ã¼ã¯ãã¤ããªã¼ãã¼ã§ æå®ããã
       in_addr ã¯ãINADDR_* ã®ä¸ã¤ (ä¾ãã° INADDR_ANY) ã代å¥ããã ã©ã¤ãã©ãªé¢æ°
       inet_aton(3), inet_addr(3), inet_makeaddr(3) ãç¨ããã ãããã¯åå解決æ©æ§
       (name resolver) ãç´æ¥ç¨ãããã®ã©ããã§è¨å®ãã¹ãã§ããã (gethostbyname(3)
       ãè¦ã)ã

       IPv4 ã¢ãã¬ã¹ã«ã¯ãã¦ããã£ã¹ãã¢ãã¬ã¹ã ããã¼ããã£ã¹ãã¢ãã¬ã¹ããã«ãã‐
       ã£ã¹ãã¢ãã¬ã¹ãããã ã¦ããã£ã¹ãã¢ãã¬ã¹ã¯ããããã¹ãã®ä¸ã¤ã®ã¢ãã¬ã¹ãæå®ããã ãã‐
       ã¼ããã£ã¹ãã¢ãã¬ã¹ã¯ããããããã¯ã¼ã¯ä¸ã®å¨ã¦ã®ãã¹ããæå®ããã ãã«ãã‐
       ã£ã¹ãã¢ãã¬ã¹ã¯ããã«ããã£ã¹ãã°ã«ã¼ãã«æå±ãã å¨ã¦ã®ãã¹ããæå®ãããããã¼ãã‐
       ã£ã¹ãã¢ãã¬ã¹ã¸ã®ãã¼ã¿ã°ã©ã ã¯ã SO_BROADCAST
       ã½ã±ãããã©ã°ãã»ããããã¦ããªãã¨éä¿¡ã»åä¿¡ã§ããªãã
       ç¾å¨ã®å®è£ã§ã¯ãæ¥ç¶æåã®ã½ã±ããã«ã¯ã¦ããã£ã¹ãã¢ãã¬ã¹ãã使ããªãã

       ã¢ãã¬ã¹ã¨ãã¼ãã¯å¸¸ã«ãããã¯ã¼ã¯ãã¤ããªã¼ãã¼ã§æ ¼ç´ããããã¨ã«æ³¨æããã
       å·ä½çã«ã¯ããã¼ããæå®ããæ°å¤ã«ã¯ htons(3) ãå¼ã³åºãå¿è¦ãããã
       æ¨æºã©ã¤ãã©ãªã«ããã¢ãã¬ã¹/ãã¼ãæä½é¢æ°ã¯
       ãã¹ã¦ãããã¯ã¼ã¯ãã¤ããªã¼ãã¼ã§åä½ããã

       ç¹å¥ãªã¢ãã¬ã¹ãããã¤ãåå¨ãã: INADDR_LOOPBACK(127.0.0.1)  㯠loopback
       ããã¤ã¹ãéãã¦å¸¸ã«ãã¼ã«ã«ãªãã¹ããåç§ããã INADDR_ANY(0.0.0.0)
       ã¯ä»»æã®ã¢ãã¬ã¹ãæå³ãããã¤ã³ãç¨ã§ããã INADDR_BROADCAST(255.255.255.255)
       ã¯ä»»æã®ãã¹ããæå³ããæ´å²ççç±ããããã¤ã³ãã®éã«ã¯ INADDR_ANY ã¨åãå¹æã«ãªãã

   ã½ã±ãããªãã·ã§ã³
       IP ã«ã¯ãããã³ã«åºæã®ã½ã±ãããªãã·ã§ã³ãããã¤ãåå¨ãã setsockopt(2)  ã§è¨å®ãã
       getsockopt(2) ã§åå¾ãã§ããã IP ã®ã½ã±ãããªãã·ã§ã³ã¬ãã«ã¯ IPPROTO_IP ã§ããã
       ãã¼ã«æ´æ°å¤ã®ãã©ã°ã§ã¯ã 0 ã¯å½ããã以å¤ã¯çãæå³ããã

       IP_ADD_MEMBERSHIP (Linux 1.2 以é)
              ãã«ããã£ã¹ãã°ã«ã¼ãã«åå ããã å¼ãæ°ã¯ ip_mreqn æ§é ä½ã§ããã

                  struct ip_mreqn {
                      struct in_addr imr_multiaddr; /* IP multicast group
                                                       address */
                      struct in_addr imr_address;   /* IP address of local
                                                       interface */
                      int            imr_ifindex;   /* interface index */
                  };

              imr_multiaddr ã«ã¯ãã¢ããªã±ã¼ã·ã§ã³ãåå ã¾ãã¯æ¤éããã ãã«ãã‐
              ã£ã¹ãã°ã«ã¼ãã®ã¢ãã¬ã¹ãå¥ãã æå®ããã¢ãã¬ã¹ã¯æå¹ãªãã«ãã‐
              ã£ã¹ãã¢ãã¬ã¹ã§ãªããã°ãªããªã (ãããªããã° setsockopt(2)  ãã¨ã©ã¼
              EINVAL ã§å¤±æãã)ã imr_address ã¯ã·ã¹ãã ããã«ãã‐
              ã£ã¹ãã°ã«ã¼ãã«åå ããéã«ç¨ãã ã‐
              ã¼ã«ã«ãªã¤ã³ã¿ã¼ãã§ã¼ã¹ã®ã¢ãã¬ã¹ã§ããã ããã INADDR_ANY
              ã§ãã£ãå ´åã«ã¯ãé©åãªã¤ã³ã¿ã¼ãã§ã¼ã¹ãã·ã¹ãã ã«ãã£ã¦é¸æãããã
              imr_ifindex 㯠imr_multiaddr ã°ã«ã¼ãã«åå /æ¤éããã¤ã³ã¿ã¼ãã§ã¼ã¹ã®
              interface index ã§ããã ã©ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã§ãããå ´å㯠0 ã«ããã

              ip_mreqn æ§é ä½ã¯ Linux 2.2 以éã§ã®ã¿å©ç¨å¯è½ã§ãããäºææ§ã®ããã
              å¤ã ip_mreq æ§é ä½ (Linux 1.2 以éã§åå¨ãã) ãã¾ã ãµãã¼ãããã¦ããã
              ip_mreqn ã¨ã®éãã¯ã imr_ifindex ãã£ã¼ã«ããå«ã¾ãªããã¨ã ãã§ããã
              setsockopt(2) ã§ã®ã¿ä½¿ããã

       IP_ADD_SOURCE_MEMBERSHIP (Linux 2.4.22 以é / 2.5.68 以é)
              Join a multicast group and allow receiving data only from a
              specified source.  Argument is an ip_mreq_source structure.

                  struct ip_mreq_source {
                      struct in_addr imr_multiaddr;  /* IP multicast group
                                                        address */
                      struct in_addr imr_interface;  /* IP address of local
                                                        interface */
                      struct in_addr imr_sourceaddr; /* IP address of
                                                        multicast source */
                  };

              The ip_mreq_source structure is similar to ip_mreqn described
              under IP_ADD_MEMBERSIP.  The imr_multiaddr field contains the
              address of the multicast group the application wants to join or
              leave.  The imr_interface field is the address of the local
              interface with which the system should join the multicast group.
              Finally, the imr_sourceaddr field contains the address of the
              source the application wants to receive data from.

              This option can be used multiple times to allow receiving data
              from more than one source.

       IP_BLOCK_SOURCE (since Linux 2.4.22 以é / 2.5.68 以é)
              Stop receiving multicast data from a specific source in a given
              group.  This is valid only after the application has subscribed
              to the multicast group using either IP_ADD_MEMBERSHIP or
              IP_ADD_SOURCE_MEMBERSHIP.

              Argument is an ip_mreq_source structure as described under
              IP_ADD_SOURCE_MEMBERSHIP.

       IP_DROP_MEMBERSHIP (Linux 1.2 以é)
              ãã«ããã£ã¹ãã°ã«ã¼ãããæãããå¼ãæ°ã¯ IP_ADD_MEMBERSHIP ã¨åæ§ã«
              ip_mreqn ã¾ã㯠ip_mreq æ§é ä½ã§ããã

       IP_DROP_SOURCE_MEMBERSHIP (since Linux 2.4.22 / 2.5.68)
              Leave a source-specific group—that is, stop receiving data from
              a given multicast group that come from a given source.  If the
              application has subscribed to multiple sources within the same
              group, data from the remaining sources will still be delivered.
              To stop receiving data from all sources at once, use
              IP_LEAVE_GROUP.

              Argument is an ip_mreq_source structure as described under
              IP_ADD_SOURCE_MEMBERSHIP.

       IP_FREEBIND (Linux 2.4 以é)
              ãã®ãã¼ã«å¤ã®ãªãã·ã§ã³ãæå¹ã«ããã¨ããã¼ã«ã«ã§ã¯ãªã IP ã¢ãã¬ã¹ãåå¨
              ããªã IP ã¢ãã¬ã¹ããã¤ã³ãã§ããããã«ãªããããã使ãã¨ã対å¿ããããã
              ã¯ã¼ã¯ã¤ã³ã¿ã¼ãã§ã¤ã¹ããªãã£ãããã¢ããªã±ã¼ã·ã§ã³ãã½ã±ããããã¤ã³ããããã¨
              ããæç¹ã§ç¹å®ã®åç IP ã¢ãã¬ã¹ãæå¹ã«ãªã£ã¦ããªãã£ãããã¦ããã½ã±ããã
              æ¥ç¶å¾ã¡ç¶æ (listening) ã«ã§ããããã«ãªãã
              ãã®ãªãã·ã§ã³ã¯ãä¸è¨ã«èª¬æããã ip_nonlocal_bind /proc
              ã¤ã³ã¿ã¼ãã§ã¤ã¹ ã®ã½ã±ããåä½ã®è¨å®ã§ããã

       IP_HDRINCL (Linux 2.0 以é)
              æå¹ã«ãªã£ã¦ããã¨ãã¦ã¼ã¶ã¯ IP ããããã¦ã¼ã¶ã¼ãã¼ã¿ã®åã«ä¸ããã SOCK_RAW
              ã½ã±ããã§ã®ã¿æå¹ã§ããã詳細㯠raw(7)
              ãè¦ãããã®ãã©ã°ãæå¹ã«ãªã£ã¦ããã¨ã IP_OPTIONS, IP_TTL, IP_TOS
              ã¯ç¡è¦ãããã

       IP_MSFILTER (since Linux 2.4.22 / 2.5.68)
              This option provides access to the advanced full-state filtering
              API.  Argument is an ip_msfilter structure.

                  struct ip_msfilter {
                      struct in_addr imsf_multiaddr; /* IP multicast group
                                                        address */
                      struct in_addr imsf_interface; /* IP address of local
                                                        interface */
                      uint32_t       imsf_fmode;     /* Filter-mode */

                      uint32_t       imsf_numsrc;    /* Number of sources in
                                                        the following array */
                      struct in_addr imsf_slist[1];  /* Array of source
                                                        addresses */
                  };

              There are two macros, MCAST_INCLUDE and MCAST_EXCLUDE, which can
              be used to specify the filtering mode.  Additionally, the
              IP_MSFILTER_SIZE(n)  macro exists to determine how much memory
              is needed to store ip_msfilter structure with n sources in the
              source list.

              For the full description of multicast source filtering refer to
              RFC 3376.

       IP_MTU (Linux 2.2 以é)
              ã½ã±ããã®ãæ¢ç¥ã® path MTU ãåå¾ããã
              ã½ã±ãããæ¥ç¶ãã¦ããå ´åã®ã¿æå¹ã§ããã getsockopt(2)  ã§ã®ã¿ä½¿ããã

       IP_MTU_DISCOVER (Linux 2.2 以é)
              ã½ã±ããã® Path MTU Discovery ã®è¨å®ãã»ããã»åå¾ããã
              æå¹ã«ãªã£ã¦ããã¨ãLinux 㯠SOCK_STREAM ã½ã±ããã«å¯¾ã㦠RFC 1191
              ã§å®ç¾©ããã¦ãã Path MTU Discovery ãè¡ãã SOCK_STREAM
              ã§ãªãã½ã±ããã«ã¤ãã¦ã¯ã IP_PMTUDISC_DO ãã»ããããã¨ã
              å¨ã¦ã®éä¿¡ãã±ããã§ãã©ã°ã¡ã³ãä¸è¨±å¯ãã©ã° (don't-fragment flag)
              ãå¿ã ã»ãããããããã«ãªãã SOCK_STREAM ã§ãªãã½ã±ããã§ã¯ã ãã±ããã MTU
              ã®ãµã¤ãºã®å¡ã«åå²ããããå¿è¦ã«å¿ãã¦åéãããããã®ã¯ã
              ã¦ã¼ã¶ã責任ãæã£ã¦è¡ãå¿è¦ãããã æ¢ç¥ã® Path MTU
              ããã大ããªãã¼ã¿ã°ã©ã ã®éä¿¡ãè¦æ±ãããã¨ã ã«ã¼ãã«ã¯ (EMSGSIZE ã§)
              éä¿¡ãæå¦ããã IP_PMTUDISC_WANT ã®å ´åã¯ã Path MTU
              ã«åºã¥ãã¦å¿è¦ã§ããã°ãã¼ã¿ã°ã©ã
              ã®åå²ãè¡ããããã以å¤ã®å ´åã¯ãã©ã°ã¡ã³ãä¸è¨±å¯ãã©ã°ãã»ãããããã

              ã·ã¹ãã å¨ä½ã®ããã©ã«ã㯠IP_PMTUDISC_WANT 㨠IP_PMTUDISC_DONT ã®
              ã©ã¡ããã«è¨å®ãããã¨ãã§ãããè¨å®ã®å¤æ´ã¯ã
              /proc/sys/net/ipv4/ip_no_pmtu_disc ãã¡ã¤ã«ã«ã0
              (IP_PMTUDISC_WANT) ã 0 ä»¥å¤ (IP_PMTUDISC_DONT)
              ãæ¸ãè¾¼ããã¨ã§è¡ãã

              Path MTU discovery å¤   æå³
              IP_PMTUDISC_WANT        ã«ã¼ããã¨ã®è¨å®ãç¨ããã
              IP_PMTUDISC_DONT        Path MTU Discovery ãè¡ããªãã
              IP_PMTUDISC_DO          常㫠Path MTU Discovery ãè¡ãã
              IP_PMTUDISC_PROBE       DFããããã»ããããããPath MTU ãç¡è¦ããã

              path MTU discovery ãæå¹ã«ãªã£ã¦ããã¨ãã«ã¼ãã«ã¯å®åãã¹ããã¨ã« èªåçã«
              path MTU ãå¦çãããç¹å®ã®ç¸æã« connect(2) ã§æ¥ç¶ããå ´åã«ã¯ã IP_MTU
              ã½ã±ãããªãã·ã§ã³ãç¨ããã°ãæ¢ç¥ã® path MTU ã®åå¾ã«ä¾¿å©ã§ãã (ãã¨ãã°
              EMSGSIZE ã¨ã©ã¼ãèµ·ããå¾ãªã©)ã path MTU ã¯æéã¨ã¨ãã«å¤åãã ãããããªãã
              å®åãããããããã³ãã¯ã·ã§ã³ã¬ã¹ãªã½ã±ããã§ã¯ã ä¸ãããã å®åã«å¯¾ããæ°ãã MTU
              ã«ãã ã¨ã©ã¼ãã¥ã¼ãç¨ãã¦ã¢ã¯ã»ã¹ãããã¨ãã§ãã (IP_RECVERR ãè¦ã)ã MTU
              æ´æ°ãå°çãããã¨ã«ãæ°ããªã¨ã©ã¼ããã¥ã¼ã¤ã³ã° ãããã

              MTU discovery ã®é²è¡ä¸ã«ã¯ããã¼ã¿ã°ã©ã ã½ã±ããããã®åæãã±ããã¯
              å°çããªããããããªãã UDP ãç¨ããã¢ããªã±ã¼ã·ã§ã³ã§ã¯ã ãã®ãã¨ãæ°ã«ããã¦ããã
              ãã±ããã®åéã¢ã«ã´ãªãºã ã«ãã®åãé¤å¤ãããã¹ãã§ããã

              æ¥ç¶ãã¦ããªãã½ã±ããã«å¯¾ã㦠path MTU discovery ãã‐
              ã»ã¹ãç«ã¡ä¸ããã«ã¯ã 大ããªãã¼ã¿ã°ã©ã ãµã¤ãº (æ大 64K ããããã¤ãé·)
              ããã¯ããã¦ã path MTU ãæ´æ°ãããã¾ã§ãµã¤ãºã縮ãã¦ãããã¨ãå¯è½ã§ããã

              path MTU ã®å¤ãã¾ãè¦ç©ãã£ã¦ã¿ãã«ã¯ãå®åã¢ãã¬ã¹ã« connect(2)
              ã使ã£ã¦ãã¼ã¿ã°ã©ã ã½ã±ãããæ¥ç¶ãã getsockopt(2)  ã IP_MTU
              ãªãã·ã§ã³ã¨ã¨ãã«å¼ã³ã MTU ãåå¾ãããã¨ã§ããã

              IP_PMTUDISC_PROBE (Linux 2.6.22 以éã§å©ç¨å¯è½) ãè¨å®ãããã¨ã§ã
              SOCK_DGRAM ã SOCK_RAW ã®ã½ã±ãã㧠RFC 4821 ã® MTU
              æ¢ç´¢ãå®è£ãããã¨ãå¯è½ã§ããã ã¾ãããã®æ©è½ã¯ã tracepath(8)
              ã®ãããªè¨ºæãã¼ã«ã§ç¹ã«æç¨ã§ããããããã®ãã¼ã«ã§ã¯ã 観測ããã Path MTU
              ããã大ããªæ¢ç´¢ãã±ãããæå³çã« éä¿¡ãããã¨ããã

       IP_MULTICAST_ALL (since Linux 2.6.31)
              This option can be used to modify the delivery policy of
              multicast messages to sockets bound to the wildcard INADDR_ANY
              address.  The argument is a boolean integer (defaults to 1).  If
              set to 1, the socket will receive messages from all the groups
              that have been joined globally on the whole system.  Otherwise,
              it will deliver messages only from the groups that have been
              explicitly joined (for example via the IP_ADD_MEMBERSHIP option)
              on this particular socket.

       IP_MULTICAST_IF (Linux 1.2 以é)
              ãã¼ã«ã«ããã¤ã¹ããã«ããã£ã¹ãã½ã±ããã¨ãã¦è¨å®ãããå¼ãæ°ã¯ ip_mreqn ã¾ãã¯
              in_addr æ§é ä½ã§ããã

              ä¸æ£ãªã½ã±ãããªãã·ã§ã³ã渡ãããã¨ã ENOPROTOOPT ãè¿ãããã

       IP_MULTICAST_LOOP (Linux 1.2 以é)
              ãã«ããã£ã¹ããã±ããããã¼ã«ã«ãªã½ã±ããã«ã«ã¼ãããã¯ãããã©ããã
              å®ãããã¼ã«å¤ã®æ´æ°å¼ãæ°ãè¨å®ã»åå¾ããã

       IP_MULTICAST_TTL (Linux 1.2 以é)
              ãã®ã½ã±ããããçºä¿¡ããããã«ããã£ã¹ããã±ããã® time-to-live å¤ãè¨‐
              å®ã»åå¾ããã ãã«ããã£ã¹ããã±ããã«å¯¾ãã¦ã¯ãã§ããã ãå°ã㪠TTL ã«è¨‐
              å®ãããã¨ãã¨ã¦ãéè¦ã§ãããããã©ã«ã㯠1 ã§ã ã¦ã¼ã¶ã¼ãã‐
              ã°ã©ã ãæ示çã«è¦æ±ããªãéã ãã«ããã£ã¹ããã±ããã¯ã‐
              ã¼ã«ã«ãªãããã¯ã¼ã¯ããåºãªããã¨ã«ãªãã å¼ãæ°ã«æ´æ°ãåãã

       IP_NODEFRAG (Linux 2.6.36 以é)
              æå¹ (å¼ãæ°ã 0 以å¤ã®å ´å) ã«ãªã£ã¦ããã¨ãnetfilter
              層ã§ã®åºåãã±ããã® åæ§ç¯ (reassembly) ãè¡ãããªããªãããã®ãªãã·ã§ã³ã¯
              SOCK_RAW ã½ã±ãã ã«ããã¦ã®ã¿æå¹ã§ãããå¼ãæ°ã¯æ´æ°ã§ããã

       IP_OPTIONS (Linux 2.0 以é)
              ãã®ã½ã±ããããéããããã±ããå¨ã¦ã«ä»éãã IP ãªãã·ã§ã³ã è¨‐
              å®ã»åå¾ããããªãã·ã§ã³ãä¿åãã¦ããã¡ã¢ãªãããã¡ã¸ã®ãã¤ã³ã¿ã¨
              ãªãã·ã§ã³ã®é·ãã¨ãå¼ãæ°ã«åãã setsockopt(2)
              ãå¼ã³åºãã¨ãã½ã±ããã«é¢é£ã¥ãããã IP ãªãã·ã§ã³ãè¨å®ã§ããã IPv4
              ã«ããããªãã·ã§ã³ã®ãµã¤ãºã®æ大å¤ã¯ 40 ãã¤ãã§ããã
              ç¨ãããã¨ã®ã§ãããªãã·ã§ã³ã«ã¤ãã¦ã¯ RFC 791 ãè¦ãã SOCK_STREAM
              ã½ã±ããã«å¯¾ããåææ¥ç¶è¦æ±ãã±ããã« IP ãªãã·ã§ã³ãå«ã¾ãã¦ããã¨ã
              ã«ã¼ãã£ã³ã°ããããä»ãã¦æ»ããã¦ããåæãã±ããã® IP
              ãªãã·ã§ã³ã«åããªãã·ã§ã³ãã»ããããããæ¥ç¶ã確ç«ãããå¾ã
              ãã£ã¦ãããã±ããã®ãªãã·ã§ã³ãå¤æ´ãããã¨ã¯ã§ããªãã
              ããã©ã«ãã§ã¯ãå¤é¨ããåä¿¡ãããã±ããã®å¨ã¦ã® source routing ãªãã·ã§ã³
              ã®å¦çã¯ç¡å¹ã¨ãªã£ã¦ããã /proc ã¤ã³ã¿ãã§ã¼ã¹ã® accept_source_route
              ã使ãã¨ãããæå¹ã«ã§ããããããç¡å¹ã«ãã¦ãã¦ã timestamps ãªã©
              ã®ä»ã®ãªãã·ã§ã³ã®å¦çã¯è¡ãããããã¼ã¿ã°ã©ã ã½ã±ããã§ã¯ã IP
              ãªãã·ã§ã³ã¯ãã¼ã«ã«ã¦ã¼ã¶ã¼ããè¨å®ã§ããªãã getsockopt(2)  ã
              IP_OPTIONS ãã¤ãã¦å¼ã¶ã¨ãç¾å¨éä¿¡ã«ç¨ãããã¦ãã IP ãªãã·ã§ã³ã
              å¼ãæ°ã«ä¸ãããããã¡ã«åå¾ã§ããã

       IP_PKTINFO (Linux 2.2 以é)
              IP_PKTINFO è£å©ã¡ãã»ã¼ã¸ã渡ããããã«ã¯å°çãã±ããã«é¢ããæå ±ãæä¾ãã
              pktinfo æ§é ä½ãå«ã¾ãã¦ããã ãã¼ã¿ã°ã©ã æåã®ã½ã±ããã§ããåä½ããªãã
              å¼ãæ°ã¯ IP_PKTINFO ã¡ãã»ã¼ã¸ãééããããã©ãããã½ã±ããã«ç¥ããããã©ã°ã§ããã
              ã¡ãã»ã¼ã¸èªèº«ã¯ recvmsg(2)  ã¾ã㯠sendmsg(2)
              ãç¨ãããã±ããã®å¶å¾¡ã¡ãã»ã¼ã¸ã¨ãã¦ã®ã¿éåä¿¡ã§ããã

                  struct in_pktinfo {
                      unsigned int   ipi_ifindex;  /* Interface index */
                      struct in_addr ipi_spec_dst; /* Local address */
                      struct in_addr ipi_addr;     /* Header Destination
                                                      address */
                  };

              ipi_ifindex
              ã¯ãã±ãããåä¿¡ãããã¤ã³ã¿ã¼ãã§ã¼ã¹ã®ãä»ã¨éãªããªãã¤ã³ããã¯ã¹ã§ããã
              ipi_spec_dst ã¯ãã±ããã®ãã¼ã«ã«ã¢ãã¬ã¹ã§ããã ipi_addr
              ã¯ãã±ãããããã«ããå®åã¢ãã¬ã¹ã§ããã IP_PKTINFO ã sendmsg(2)
              ã«æ¸¡ããã¦ãã㤠ipi_spec_dst ã 0 以å¤ã®å ´åã ipi_spec_dst
              ã¯ã«ã¼ãã£ã³ã°ãã¼ãã«ãæ¤ç´¢ããéã«ãã¼ã«ã«ãªéä¿¡åã¢ãã¬ã¹ã¨ãã¦ä½¿ç¨ããã
              IP source route ãªãã·ã§ã³ãè¨å®ããã®ã«ã使ç¨ãããã ipi_ifindex ã 0
              以å¤ã®å ´åããã®ã¤ã³ããã¯ã¹ã«ãã£ã¦æå®ãããã¤ã³ã¿ã¼ãã§ã¼ã¹ã®
              ãã©ã¤ããªãã¼ã«ã«ã¢ãã¬ã¹ã§ ipi_spec_dst
              ãä¸æ¸ãããã«ã¼ãã£ã³ã°ãã¼ãã«ãæ¤ç´¢ããã

       IP_RECVERR (Linux 2.2 以é)
              ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®åã渡ãã«ãä¿¡é ¼æ§ã®é«ãæ¡å¼µãããæ¹æ³ãæå¹ã«ããã
              ãã¼ã¿ã°ã©ã ã½ã±ããã«å¯¾ãã¦æå¹ã«ãªã£ã¦ããã¨ã
              çºçããã¨ã©ã¼ã¯å¨ã¦ã½ã±ãããã¨ã®ã¨ã©ã¼ãã¥ã¼ã«ä¿åãããã
              ã¦ã¼ã¶ã¼ã¯ã½ã±ããæä½ããã¨ã©ã¼ãåãåã£ãã¨ãã recvmsg(2)  ã
              MSG_ERRQUEUE ãã©ã°ã¨ã¨ãã«å¼ã¹ã°ãã®ã¨ã©ã¼ãåå¾ã§ããã
              ãã®ã¨ã©ã¼ãè¨è¿°ãã sock_extended_err æ§é ä½ããã¿ã¤ã IP_RECVERRã»
              ã¬ãã« IPPROTO_IP ã®è£å©ã¡ãã»ã¼ã¸ã¨ãã¦æ¸¡ãããã
              ããã¯æ¥ç¶å¿åã§ãªãã½ã±ããã§ä¿¡é ¼æ§ã®é«ãã¨ã©ã¼å¦çãè¡ãããå ´åã«
              æç¨ã§ãããã¨ã©ã¼ãã¥ã¼ã®åä¿¡ãã¼ã¿ãã©ã°ã¡ã³ãã«ã¯ ã¨ã©ã¼ãã±ãããå«ã¾ããã

              IP_RECVERR å¶å¾¡ã¡ãã»ã¼ã¸ã«ã¯ sock_extended_err æ§é ä½ãå«ã¾ãã:

                  #define SO_EE_ORIGIN_NONE    0
                  #define SO_EE_ORIGIN_LOCAL   1
                  #define SO_EE_ORIGIN_ICMP    2
                  #define SO_EE_ORIGIN_ICMP6   3

                  struct sock_extended_err {
                      uint32_t ee_errno;   /* error number */
                      uint8_t  ee_origin;  /* where the error originated */
                      uint8_t  ee_type;    /* type */
                      uint8_t  ee_code;    /* code */
                      uint8_t  ee_pad;
                      uint32_t ee_info;    /* additional information */
                      uint32_t ee_data;    /* other data */
                      /* More data may follow */
                  };

                  struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);

              ee_errno ã«ã¯ãã¥ã¼ã«å¥ã£ã¦ããã¨ã©ã¼ã® errno çªå·ãå¥ãã ee_origin
              ã«ã¯ã¨ã©ã¼ãçºçããå ´æã示ãã³ã¼ããå¥ãã ãã®ä»ã®ãã£ã¼ã«ãã¯ãããã³ã«ä¾å‐
              ã§ããã SO_EE_OFFENDER ãã¯ãã¯ä¸ããããè£å©ã¡ãã»ã¼ã¸ã¸ã®ãã¤ã³ã¿ãã
              ã¨ã©ã¼ã®çºçãããããã¯ã¼ã¯ãªãã¸ã§ã¯ãã®ã¢ãã¬ã¹ã¸ã®ãã¤ã³ã¿ãè¿ãã
              ã¢ãã¬ã¹ãä¸æãªå ´åã sockaddr æ§é ä½ã® sa_family ãã£ã¼ã«ãã¯
              AF_UNSPEC ã¨ãªãããã®ä»ã®ãã£ã¼ã«ãå¤ã¯ä¸å®ã§ããã

              IP ã¯ä»¥ä¸ã®ãã㪠sock_extended_err æ§é ä½ãç¨ãã: ee_origin
              ã¯ãã¨ã©ã¼ ã ICMP ãã±ããã¨ãã¦åä¿¡ãããå ´åã«ã¯ SO_EE_ORIGIN_ICMP
              ã«ã»ããããã ãã¼ã«ã«ã§èµ·ãã£ãå ´åã«ã¯ SO_EE_ORIGIN_LOCAL ã«ã»ãããããã
              ä¸æãªå¤ã¯ ç¡è¦ãããã ee_type 㨠ee_code 㯠ICMP ãããã® type
              ãã£ã¼ã«ã㨠code ãã£ã¼ã«ãã®å¤ã«ã»ãããããã ee_info ã«ã¯ EMSGSIZE
              ã¨ã©ã¼ã«å¯¾ã ã discover ããã MTU ãå¥ãã
              ã¡ãã»ã¼ã¸ã«ã¯ã¨ã©ã¼ãå¼ãèµ·ããããã¼ãã® sockaddr_in æ§é ä½ãå«ã¾ããã
              ããã«ã¯ SO_EE_OFFENDER ãã¯ãã使ã£ã¦ã¢ ã¯ã»ã¹ã§ããã
              ã½ã¼ã¹ãä¸æã®å ´åã SO_EE_OFFENDER ã¢ãã¬ã¹ã® sin_family ãã£ã¼ã«ãã¯
              AF_UNSPEC ã¨ãªãã ã¨ã©ã¼ããããã¯ã¼ã¯ã§èµ·ãã å ´åã«ã¯ã
              ã½ã±ããã§æå¹ã«ãªã£ã¦ãããã¹ã¦ã® IP ãªãã·ã§ã³ (IP_OPTIONS, IP_TTL
              ãªã©) ã¨ã¨ã©ã¼ãã±ããã«å«ã¾ãã¦ãããã¹ã¦ã® IP ãªãã·ã§ã³ã¨ãã å¶
              御ã¡ãã»ã¼ã¸ã¨ãã¦æ¸¡ãããã ã¨ã©ã¼ãèµ·ããããã±ããã®ãã¤ãã¼ã (payload)
              㯠æ®éã®ãã¤ãã¼ãã¨ãã¦è¿ãããã TCP ã«ã¯ã¨ã©ã¼ãã¥ã¼ããªããã¨ã«æ³¨æãã¦
              ã»ããã MSG_ERRQUEUE 㯠SOCK_STREAM ã½ã±ããã«å¯¾ãã¦ã¯ä½¿ããªãã TCP
              ã§ã¯ IP_RECVERR ã ããæå¹ã ããã½ã±ããé¢æ°ããè¿ãããã¨ã©ã¼ã¯ SO_ERROR
              ã ãã«ãªãã

              raw ã½ã±ããã«å¯¾ã㦠IP_RECVERR ãæå®ããã¨ãåä¿¡ãããã¹ã¦ã® ICMP
              ã¨ã©ã¼ãã¢ããªã±ã¼ã·ã§ã³ã« 渡ãããã«ãªããæå®ããªãã¨ã
              æ¥ç¶æ¸ã¿ã®ã½ã±ããã«å¯¾ããã¨ã©ã¼ã ããå ±åããã

              ãã®ãªãã·ã§ã³ã¯ãã¼ã«å¤ã®ãã©ã°ãè¨å®ã»åå¾ããã IP_RECVERR
              ã¯ããã©ã«ãã§ã¯ãªãã«ãªã£ã¦ããã

       IP_RECVOPTS (Linux 2.2 以é)
              å°çããå¨ã¦ã® IP ãªãã·ã§ã³ã IP_OPTION ã³ã³ãã‐
              ã¼ã«ã¡ãã»ã¼ã¸ã«å¥ãã¦ã¦ã¼ã¶ã¼ã«æ¸¡ãã
              ã«ã¼ãã£ã³ã°ãããã¨ãã®ä»ã®ãªãã·ã§ã³ã¨ã¯ã ã‐
              ã¼ã«ã«ãã¹ãã«å¯¾ãã¦ã¯ãããããè¨å¥ããã¦ããã SOCK_STREAM
              ã½ã±ããã§ã¯ãµãã¼ãããã¦ããªãã

       IP_RECVORIGDSTADDR (Linux 2.6.29 以é)
              ãã®ãã¼ã«å¤ã®ãªãã·ã§ã³ãã»ãããããã¨ã recvmsg(2) 㧠IP_ORIGDSTADDR
              è£å©ã¡ãã»ã¼ã¸ãæå¹ã«ãªãã
              ã«ã¼ãã«ã¯ãã¼ã¿ã°ã©ã ãåä¿¡ããåã®å®åã¢ãã¬ã¹ããã®è£å©ã¡ãã»ã¼ã¸ã§è¿ãã
              ãã®è£å©ã¡ãã»ã¼ã¸ã«ã¯ struct sockaddr_in ãæ ¼ç´ãããã

       IP_RECVTOS (Linux 2.2 以é)
              æå¹ã«ãªã£ã¦ããã¨ã IP_TOS è£å©ã¡ãã»ã¼ã¸ãå°çãã±ããã¨ã¨ãã«æ¸¡ãããã
              ããã«ã¯ãã±ãããããã® Service/Precedence
              ãã£ã¼ã«ãã®ã¿ã¤ããæå®ãããã¤ããã¼ã¿ãå«ã¾ãã¦ããã
              ãã¼ã«æ´æ°å¤ã®ãã©ã°ãã¨ãã

       IP_RECVTTL (Linux 2.2 以é)
              ãã®ãã©ã°ãã»ããããã¦ããã¨ã IP_TTL ã³ã³ããã¼ã«ã¡ãã»ã¼ã¸ãåä¿¡ãã±ããã®
              time-to-live ãã£ã¼ã«ãã®ãã¤ããã¼ã¿ã¨ã¨ãã«æ¸¡ãããã SOCK_STREAM
              ã½ã±ããã§ã¯ãµãã¼ãããã¦ããªãã

       IP_RETOPTS
              IP_RETOPTS (Linux 2.2 以é)  IP_RECVOPTS ã¨ç‐
              価ã ããæªå¦çã®çã®ãªãã·ã§ã³ãã ãã® hop ã§ã¯è¨å¥ãããªã timestamp
              ã¬ã³ã¼ã㨠route ã¬ã³ã¼ãã¨ã¨ãã«è¿ãã

       IP_ROUTER_ALERT (Linux 2.2 以é)
              ãã©ã¯ã¼ããã¹ããã±ããã IP Router Alert ãªãã·ã§ã³ãã¤ãã¦
              ãã®ã½ã±ããã«æ¸¡ãã raw
              ã½ã±ããã«å¯¾ãã¦ã®ã¿æå¹ã§ãããããã¯ãã¨ãã°ã¦ã¼ã¶ã¼ç©ºéã® RSVP
              ãã¼ã¢ã³ã«å¯¾ãã¦ä¾¿å©ã§ãããã¿ããããããã±ããã¯
              ã«ã¼ãã«ã«ãã£ã¦ã¯ãã©ã¯ã¼ããããªãã®ã§ãããããåéããã®ã¯
              ã¦ã¼ã¶ã¼ã®è²¬ä»»ã¨ãªããã½ã±ããã®ãã¤ã³ãã¯ç¡è¦ããã ãã®ãããªãã±ããã¯ãã‐
              ãã³ã«ã«ãã£ã¦ã®ã¿ãã£ã«ã¿ãªã³ã°ãããã æ´æ°å¤ã®ãã©ã°ãåãã

       IP_TOS (Linux 1.0 以é)
              ãã®ã½ã±ããããéä¿¡ããããã¹ã¦ã® IP ãã±ããã«é©ç¨ããã Type-Of-Service
              (TOS) ãã£ã¼ã«ããè¨å®ã»åå¾ããã
              ããã¯ãããã¯ã¼ã¯ä¸ã§ã®ãã±ããã®åªå度ã決ããããã«ç¨ããããã TOS
              ã¯ãã¤ããã¼ã¿ã§ãããæ¨æºã® TOS ãã©ã°ãããã¤ãå®ç¾©ããã¦ããã
              IPTOS_LOWDELAY ã¯ã¤ã³ã¿ã©ã¯ãã£ããªãã©ãã£ãã¯ã®é延ãæå°ã«ããã
              IPTOS_THROUGHPUT ã¯ã¹ã«ã¼ããããæ大ã«ããã IPTOS_RELIABILITY
              ã¯ä¿¡é ¼æ§ãæé«ã«ããã IPTOS_MINCOST
              ã¯è»¢éé度ãéãã¦ããã¾ããªãã¨ããããã¼ã¿ãè©°ãè¾¼ããã®ã«ç¨ããããã ãããã®ãã¡ã
              1 ã¤ã¾ã§ã ããè¨å®ã§ããã ä»ã®ãããã¯ç¡å¹ã§ãã¯ãªã¢ãããã Linux
              ã¯ããã©ã«ãã§ã¯ IPTOS_LOWDELAY ãã¼ã¿ã°ã©ã ãæåã«éä¿¡ããã ããããæ‐
              £ç¢ºãªæ¯ãèãã¯ãã¥ã¼å¦çã®è¨å®ã«ä¾åããã
              é«ãåªå度ã«ããã«ã¯ã¹ã¼ãã¼ã¦ã¼ã¶ã¼æ¨©é (CAP_NET_ADMIN ã±ã¼ãããªãã£)
              ãå¿è¦ã¨ãªããããããªãã åªå度㯠(SOL_SOCKET, SO_PRIORITY)
              ã½ã±ãããªãã·ã§ã³ãç¨ããã°ã ãããã³ã«ã«ä¾åããªãå½¢ã§ãè¨å®ã§ãã
              (socket(7)  ãè¦ã)ã

       IP_TRANSPARENT (Linux 2.6.24 以é)
              ãã®ãã¼ã«å¤ã®ãªãã·ã§ã³ãæå¹ã«ããã¨ã ãã®ã½ã±ããã§ééãããã· (transparent
              proxy) ãã§ããããã«ãªãã
              ãã®ã½ã±ãããªãã·ã§ã³ã使ãã¨ãå¼ã³åºããã¢ããªã±ã¼ã·ã§ã³ã¯ã ã‐
              ã¼ã«ã«ã§ã¯ãªã IP ã¢ãã¬ã¹ããã¤ã³ããã¦ããã¼ã«ã«ã®ç«¯ç¹ã¨ãã¦èªå以å¤ã®
              ã¢ãã¬ã¹ (foreign address) ãæã¤ã¯ã©ã¤ã¢ã³ãããµã¼ãã®ä¸¡æ¹ã¨ãã¦
              åä½ã§ããããã«ãªãã 注æ:
              ãã®æ©è½ãåä½ããããã«ã¯ãèªå以å¤ã®ã¢ãã¬ã¹å®ã®ãã±ããã ééããã‐
              ã·ãåä½ãããã·ã³ (TProxy box) çµç±ã§è»¢éãããããã«ã ã«ã¼ãã£ã³ã°ãè¨‐
              å®ãããå¿è¦ãããã ãã®ã½ã±ãããªãã·ã§ã³ãæå¹ã«ããã«ã¯ãã¹ã¼ãã¼ã¦ã¼ã¶ç¹æ¨©
              (CAP_NET_ADMIN ã±ã¼ãããªãã£) ãå¿è¦ã§ããã

              iptables ã® TPROXY ã¿ã¼ã²ããã§ééãããã·ãªãã¤ã¬ã¯ã·ã§ã³ (TProxy
              redirection) ãè¡ãã«ã¯ããªãã¤ã¬ã¯ããããã½ã±ããã«å¯¾ãã¦
              ãã®ãªãã·ã§ã³ãè¨å®ããå¿è¦ãããã

       IP_TTL (Linux 1.0 以é)
              time-to-live ãã£ã¼ã«ãã®å¤ãè¨å®ã¾ãã¯åå¾ããã
              ãã®å¤ã¯ãã®ã½ã±ããããéä¿¡ããããã¹ã¦ã®ãã±ããã«ç¨ããããã

       IP_UNBLOCK_SOURCE (since Linux 2.4.22 / 2.5.68)
              Unblock previously blocked multicast source.  Returns
              EADDRNOTAVAIL when given source is not being blocked.

              Argument is an ip_mreq_source structure as described under
              IP_ADD_SOURCE_MEMBERSHIP.

   /proc ã¤ã³ã¿ãã§ã¼ã¹
       IP ãããã³ã«ã§ã¯ãããã¤ãã®ã°ãã¼ãã«ãã©ã¡ã¼ã¿ãè¨å®ããããã® /proc
       ãã¡ã¤ã«ç¾¤ãç¨æããã¦ããã ãããã®ãã©ã¡ã¼ã¿ã«ã¯ã /proc/sys/net/ipv4/
       ãã£ã¬ã¯ããªåã®ãã¡ã¤ã«ã®èªã¿æ¸ãã§ã¢ã¯ã»ã¹ã§ããã Boolean
       ã¨æ¸ãããã¤ã³ã¿ãã§ã¼ã¹ã¯æ´æ°å¤ãã¨ãã 0 以å¤ã®å¤ ("true")
       ã¯å¯¾å¿ãããªãã·ã§ã³ãæå¹ã 0 å¤ ("false") ã¯ç¡å¹ãã§ãããã¨ãæå³ããã

       ip_always_defrag (Boolean; Linux 2.2.13 以é)
              [2.2.13 ã§æ°è¦ç»å ´ã以åã®ãã¼ã¸ã§ã³ã®ã«ã¼ãã«ã§ã¯ããã®æ©è½ã¯
              ã³ã³ãã¤ã«æã« CONFIG_IP_ALWAYS_DEFRAG
              ãªãã·ã§ã³ã«ãã£ã¦å¶å¾¡ããã¦ãã; ãã®ãã¡ã¤ã«ã¯ 2.4.x 以éã§ã¯åå¨ããªã]

              ãã®ãã¼ã«å¤ã®ãã©ã°ãæå¹ã«ãªã£ã¦ãã (0 以å¤ã«ãªã£ã¦ãã) ã¨ã
              å°çãããã©ã°ã¡ã³ã (IP ãã±ããã®ä¸é¨ã§ã
              çºä¿¡åã¨çºä¿¡åã®éã®ã©ããã®ãã¹ãã§ããã®ãã±ããã 大ããããã¨å¤æ‐
              ãããåå²ãããå ´åã«çãã)  ã¯ããã¨ããã©ã¯ã¼ããããå ´åã§ãã£ã¦ã å¦çåã«åæ§ç¯
              (ããã©ã°ã¡ã³ã) ãããã

              ãã¡ã¤ã¢ã¦ã©ã¼ã«ããã¼ã«ã«å´ã®ãããã¯ã¼ã¯ã«å¯ä¸ã®ãªã³ã¯ãæã£ã¦ãã
              å ´åããééããã¯ã·ã®å ´åã«éã£ã¦æå¹ã«ãã¹ãã§ããã
              é常ã®ã«ã¼ã¿ã¼ããã¹ãã§ã¯æ±ºãã¦ä½¿ç¨ãããã¨ã®ãªãããã«ã
              ãããªãã¨ãã©ã°ã¡ã³ããå¥ã®ãªã³ã¯ãçµç±ãã¦ä¼ããå ´åã«ã
              éä¿¡ã®ãã©ã°ã¡ã³ãåãã§ããªããªã£ã¦ãã¾ãã
              ã¾ããã©ã°ã¡ã³ãåæ§ç¯å¦çã¯ã¡ã¢ãªã¨ CPU æéã®ã³ã¹ããé常ã«å¤§ããã

              ããã¯ãã¹ã«ã¬ã¼ããééããã¯ã·ãè¨å®ãããã¨ã ä¸æè‐
              °ãªä»çµã¿ã«ãã£ã¦èªåçã«æå¹ã«ãªãã

       ip_autoconfig (Linux 2.2 以é 2.6.17 ã¾ã§)
              ã¾ã è¨è¿°ãã¦ããªãã

       ip_default_ttl (integer; default: 64; Linux 2.2 以é)
              éåºããããã±ããã® time-to-live å¤ã®ããã©ã«ããã»ããããã ãã㯠IP_TTL
              ãªãã·ã§ã³ãç¨ããã°ããã±ãããã¨ã«å¤ãããã¨ãã§ããã

       ip_dynaddr (Boolean; default: disabled; Linux 2.0.31 以é)
              åçã½ã±ããã¢ãã¬ã¹ã¨ãã¤ã³ã¿ã¼ãã§ã¼ã¹ã¢ãã¬ã¹ãå¤æ´ãããéã®
              ãã¹ã«ã¬ã¼ãã¨ã³ããªã®åæ¸ãè¾¼ã¿ãæå¹ã«ããã
              ãã¤ã¢ã«ã¢ããã¤ã³ã¿ã¼ãã§ã¼ã¹ã§ã IP ã¢ãã¬ã¹ãå¤æ´ãããå ´åã«ä¾¿å©ã§ããã

       ip_forward (Boolean; default: disabled; Linux 1.2 以é)
              IP forwarding ãæå¹ã«ãããã©ããã®ãã¼ã«å¤ãã©ã°ã IP forwarding
              ãããã©ããã¯ã¤ã³ã¿ã¼ãã§ã¼ã¹ãã¨ã«ãè¨å®ã§ããã

       ip_local_port_range (Linux 2.2 以é)
              ã½ã±ããã«å²ãå½ã¦ããã¦ããããã©ã«ãã®ãã¼ã«ã«ãã¼ãã®ç¯å²ãå®ãã
              äºã¤ã®æ´æ°ãä¸ãããå²ãå½ã¦ã¯ 1 çªç®ã®çªå·ããå§ã¾ãã 2
              çªç®ã®çªå·ã§çµããã
              ãããã¯ãã¹ã«ã¬ã¼ãã§ç¨ãããã¦ãããã¼ãã¨éãªã£ã¦ã¯ãªããªã
              (ãã®å ´åãåãæ±ãããã)ã ãã¡ã¤ã¢ã¦ã©ã¼ã«ã®ãã±ãããã£ã«ã¿ã¼ããå©ç¨ä¸ã®ã‐
              ã¼ã«ã«ãã¼ãã ã«ã¤ãã¦ä½ããã®ä»®å®ããã¦ããå ´åã«ã¯ã
              çªå·ãåæã«æ±ºãã¦ãã¾ãã¨åé¡ãèµ·ãããããããªãã 1 çªç®ã®çªå·ã¯å°ãªãã¨ã
              1024 ãã大ãããã¹ãã§ããã
              è¯ã使ããããã¼ãã¨ã®è¡çªãé¿ãããããã¡ã¤ã¢ã¦ã©ã¼ã«ã®åé¡ã åé¿ããããã°ã
              4096 ããã大ããããã»ããè¯ãã ããã

       ip_no_pmtu_disc (Boolean; default: disabled; Linux 2.2 以é)
              æå¹ã«ãªã£ã¦ããã¨ãããã©ã«ã㧠TCP ã½ã±ããã«å¯¾ãã Path MTU Discoverty
              ãè¡ããªãã Path MTU Discovery ã¯ã æ£ããè¨å®ããã¦ããªã (ICMP
              ãã±ãããå¨ã¦ãããããã) ãã¡ã¤ã¢ã¦ã©ã¼ã«ãã (point-to-point
              ãªã³ã¯ã§åæ¹ã® MTU ãä¸è´ãã¦ããªãå ´åãªã©)  æ£ããè¨‐
              å®ããã¦ããªãã¤ã³ã¿ã¼ãã§ã¼ã¹ãçµè·¯ä¸ã«åå¨ããã¨å¤±æãã¦ãã¾ãã Path MTU
              Discovery ãã°ãã¼ãã«ã«ç¡å¹ã«ããããã¯ã å£ãã¦ããã«ã¼ã¿ãç´ãã»ããè¯ãã
              Path MTU Discovery ãç¡å¹ã«ããã¨ãããã¯ã¼ã¯ã®ã³ã¹ãã
              大ãããªã£ã¦ãã¾ãããã§ããã

       ip_nonlocal_bind (Boolean; default: disabled; Linux 2.4 以é)
              ã»ããããã¦ããã°ãããã»ã¹ãèªå以å¤ã® IP ã¢ãã¬ã¹ã bind(2)
              ã§ããããã«ãªããããã¯ããªã便å©ã ãããã¾ãåããªãã¢ããªã±ã¼ã·ã§ã³ãããã

       ip6frag_time (integer; default: 30)
              IPv6 ãã©ã°ã¡ã³ããã¡ã¢ãªã«ä¿æãã¦ããæé (ç§åä½)ã

       ip6frag_secret_interval (integer; default: 600)
              IPv6 ãã©ã°ã¡ã³ãã® hash secret ã®çæéé (hash secret ã®å¯¿å½)
              (ç§åä½)ã

       ipfrag_high_thresh (integer), ipfrag_low_thresh (integer)
              ãã¥ã¼ã¤ã³ã°ããã¦ãã IP ãã©ã°ã¡ã³ãã®éã ipfrag_high_thresh
              ã«éããã¨ããã¥ã¼ã®å容㯠ipfrag_low_thresh
              ã«ã¾ã§åãæ¨ã¦ããããããããã®å¤§ããã ãã¤ãåä½ã§è¡¨ãæ´æ°å¤ãå¥ã£ã¦ããã

       neigh/*
              arp(7)  ãè¦ãã

   ioctl
       socket(7)  ã«è¨è¿°ããã¦ãã ioctl ã¯ããã¹ã¦ ip ã«ãé©ç¨ãããã

       ã¸ã§ããªãã¯ããã¤ã¹ã®ãã©ã¡ã¼ã¿ãè¨å®ãã ioctl ã«ã¤ãã¦ã¯ netdevice(7)
       ã«è¨è¿°ããã¦ããã

ã¨ã©ã¼
       EACCES å¿è¦ãªæ¨©éã®ãªãã¦ã¼ã¶ã¼ãæä½ãå®è¡ãããã¨ããã 以ä¸ã®ãããªå ´åãèãããã:
              SO_BROADCAST ãã©ã°ãè¨å®ãã¦ããªãç¶æã§ããã¼ããã£ã¹ãã¢ãã¬ã¹ã«
              ãã±ãããéããã¨ããã prohibit ãªã«ã¼ããéãã¦ãã±ãããéããã¨ããã
              ã¹ã¼ãã¼ã¦ã¼ã¶ã¼æ¨©é (CAP_NET_ADMIN ã±ã¼ãããªãã£)
              ãªãã§ãã¡ã¤ã¢ã¦ã©ã¼ã«ã®è¨å®ãå¤æ´ãããã¨ããã ã¹ã¼ãã¼ã¦ã¼ã¶ã¼æ¨©é
              (CAP_NET_BIND_SERVICE ã±ã¼ãããªãã£)
              ãªãã§ç¹æ¨©ãã¼ãã«ãã¤ã³ããããã¨ããã

       EADDRINUSE
              æ¢ã«ä½¿ç¨ããã¦ããã¢ãã¬ã¹ã«ãã¤ã³ããããã¨ããã

       EADDRNOTAVAIL
              åå¨ããªãã¤ã³ã¿ã¼ãã§ã¼ã¹ãè¦æ±ããããã¾ã㯠è¦æ±ãããã½ã¼ã¹ã¢ãã¬ã¹ãã‐
              ã¼ã«ã«ã§ãªãã

       EAGAIN éããããã³ã°ã½ã±ããã«å¯¾ãã¦ãããã¯ããæä½ãè¡ã£ãã

       EALREADY
              éããããã³ã°ã½ã±ããã«å¯¾ããæ¥ç¶æä½ãæ¢ã«å®è¡ä¸ã§ããã

       ECONNABORTED
              accept(2)  ã®éä¸ã§æ¥ç¶ãã¯ãã¼ãºãããã

       EHOSTUNREACH
              å®åã¢ãã¬ã¹ã«ãããããæå¹ãªã¨ã³ããªãã«ã¼ãã£ã³ã°ãã¼ãã«ã« å‐
              å¨ããªãããã®ã¨ã©ã¼ã¯ãªã¢ã¼ãã«ã¼ã¿ããã®ã ãããã¯ã‐
              ã¼ã«ã«ã«ã¼ãã£ã³ã°ãã¼ãã«ã¸ã® ICMP
              ã¡ãã»ã¼ã¸ã«ãã£ã¦å¼ãèµ·ãããããã¨ãããã

       EINVAL ä¸æ£ãªå¼ãæ°ã渡ããããéä¿¡æä½ã«ããã¦ã blackhole
              ã«ã¼ãã«éä¿¡ãããã¨ããã¨ãã®ã¨ã©ã¼ãèµ·ãããã¨ãããã

       EISCONN
              æ¥ç¶æ¸ã¿ã®ã½ã±ããã«å¯¾ã㦠connect(2)  ãå¼ã°ããã

       EMSGSIZE
              ãã¼ã¿ã°ã©ã ã path MTU ããã大ããããã©ã°ã¡ã³ãåãã§ããªãã

       ENOBUFS, ENOMEM
              空ãã¡ã¢ãªã足ããªãã ãã®ã¨ã©ã¼ã¯ãã¡ã¢ãªã¢ã‐
              ã±ã¼ã·ã§ã³ãã½ã±ãããããã¡ã®
              大ããã«ãã£ã¦å¶éããã¦ãããã¨ãæå³ãã¦ããã®ãé常ã§ãããã 100%
              ããã ã¨ããããã§ã¯ãªãã

       ENOENT ãã±ãããå°çãã¦ããªãã½ã±ããã«å¯¾ã㦠SIOCGSTAMP ãå¼ã°ããã

       ENOPKG ã«ã¼ãã«ãµãã·ã¹ãã ãè¨å®ããã¦ããªãã

       ENOPROTOOPT 㨠EOPNOTSUPP
              ç¡å¹ãªã½ã±ãããªãã·ã§ã³ã渡ãããã

       ENOTCONN
              æ¥ç¶ããã¦ããªãã½ã±ããã«å¯¾ãã¦ã
              æ¥ç¶ç¶æã§ããå®ç¾©ããã¦ããªãæä½ãè¡ããã¨ããã

       EPERM  é«ãåªå度ãè¨å®ããããè¨å®ãå¤æ´ããããè¦æ±ãããããã»ã¹ã ãã‐
              ã»ã¹ã°ã«ã¼ãã«ã·ã°ãã«ãéã£ããããã®ã«å¿è¦ãªæ¨©éãã ã¦ã¼ã¶ã¼ãæã£ã¦ããªãã

       EPIPE  æ¥ç¶ãæ¥ç¶ç¸æã«ãã£ã¦ãäºæããªãããæ¹ã§ã¯ãã¼ãºã¾ãã¯ã·ã£ãããã¦ã³ãããã

       ESOCKTNOSUPPORT
              ã½ã±ãããæªè¨å®ã§ããããç¥ããªãã½ã±ããã¿ã¤ããè¦æ±ãããã

       ä»ã®ã¨ã©ã¼ãä¸å±¤ã®ãããã³ã«ã«ãã£ã¦çãããããããªãã tcp(7), raw(7), udp(7),
       socket(7) ãªã©ãåç§ã®ãã¨ã

注æ
       IP_FREEBIND, IP_MSFILTER, IP_MTU, IP_MTU_DISCOVER, IP_RECVORIGDSTADDR,
       IP_PKTINFO, IP_RECVERR, IP_ROUTER_ALERT, and IP_TRANSPARENT 㯠Linux
       åºæã§ããã

       SO_BROADCAST ãªãã·ã§ã³ã®å©ç¨ã«ã¯ãããããã注æãããã¨ã ãã㯠Linux
       ã§ã¯ç¹æ¨©æä½ã§ã¯ãªãã ä¸æ³¨æãªããã¼ãã‐
       ã£ã¹ããè¡ãã¨ããããã¯ã¼ã¯ã¯ç°¡åã«éè² è·ç¶æã«ãªãã æ°ããã¢ããªã±ã¼ã·ã§ã³ãã‐
       ãã³ã«ã«ã¯ãããã¼ããã£ã¹ãã§ã¯ãªã ãã«ããã£ã¹ãã°ã«ã¼ããç¨ããã»ããããã ããã¼ãã‐
       ã£ã¹ãã¯æ¨å¥¨ãããªãã

       ä»ã® BSD ã®ã½ã±ããå®è£ã§ã¯ã IP_RCVDSTADDR 㨠IP_RECVIF
       ã¨ãã£ãã½ã±ãããªãã·ã§ã³ããµãã¼ãããã¦ããã
       å®åã¢ãã¬ã¹ãåä¿¡ãã¼ã¿ã°ã©ã ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ãåå¾ã§ããããã« ãªã£ã¦ãããã¨ãããã
       Linux ã§åããã¨ãããããã«ã¯ãããä¸è¬ç㪠IP_PKTINFO ã使ããã

       ããã¤ãã® BSD ã®ã½ã±ããå®è£ã§ã¯ IP_RECVTTL ãªãã·ã§ã³ãæä¾ããã¦ããããã¿ã¤ã
       IP_RECVTTL ã®è£å©ã¡ãã»ã¼ã¸ã¯åä¿¡ãã±ããã¨ã¨ãã«æ¸¡ãããã ãã㯠Linux
       ã§ä½¿ããã¦ãã IP_TTL ãªãã·ã§ã³ã¨ã¯ç°ãªãåä½ã§ããã

       SOL_IP ã½ã±ãããªãã·ã§ã³ã¬ãã«ã¯ç§»æ¤æ§ããªãã BSD ãã¼ã¹ã®ãããã³ã«ã¹ã¿ãã¯ã§ã¯
       IPPROTO_IP ã¬ãã«ã使ç¨ããã¦ããã

   移æ¤æ§
       Linux 2.0 ã¨ã®äºææ§ã®ããã«ã obsolete 㪠socket(AF_INET, SOCK_PACKET,
       protocol) ã¨ããæ¸å¼ã§ã packet(7)
       ããªã¼ãã³ã§ããããã«ãªã£ã¦ããããããã¯ãå§ãã§ããªããä»å¾ã¯ socket(AF_PACKET,
       SOCK_RAW, protocol)
       ã代ããã«ç¨ããã¹ãã§ããã主ãªéãã¯ãã¸ã§ããªãã¯ãªãªã³ã¯å±¤ç¨ã® sockaddr_ll
       ã¢ãã¬ã¹æ§é ä½ããå¤ã sockaddr_pkt ã«å¤ãã£ã¦ç¨ããããããã«ãªã£ããã¨ã§ããã

ãã°
       ã¨ã©ã¼ã®å¤ãã¾ã£ããé¦å°¾ä¸è²«ãã¦ããªãã

       IP åºæã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ãªãã·ã§ã³ãæå®ããããã® ioctl 㨠ARP
       ãã¼ãã«ã®ãã¨ãè¨è¿°ããã¦ããªãã

       glibc ã®ãã¼ã¸ã§ã³ã«ãã£ã¦ã¯ in_pktinfo ã®å®ç¾©ãå¿ãã¦ãããã®ãããã
       ç¾æç¹ã§ã®ã¨ããããã®å¯¾çã¨ãã¦ã¯ããã® man ãã¼ã¸ã«ããå®ç¾©ãããã°ã©ã ä¸ã«
       ã³ãã¼ãããã¨ã§ããã

       recvmsg(2)  㧠msg_name 㫠MSG_ERRQUEUE
       ãæå®ãã¦ãåä¿¡ãã±ããã«å¥ã£ã¦ããå®åã¢ãã¬ã¹ãåå¾ããæ¹æ³ã¯ 2.2
       ã«ã¼ãã«ã®ä¸é¨ã§ãã¾ãåããªãã

é¢é£é ç®
       recvmsg(2), sendmsg(2), byteorder(3), ipfw(4), capabilities(7),
       icmp(7), ipv6(7), netlink(7), raw(7), socket(7), tcp(7), udp(7)

       RFC 791 for the original IP specification.  RFC 1122 for the IPv4 host
       requirements.  RFC 1812 for the IPv4 router requirements.

ãã®ææ¸ã«ã¤ãã¦
       ãã® man ãã¼ã¸ã¯ Linux man-pages ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.51 ã®ä¸é¨
       ã§ãããããã¸ã§ã¯ãã®èª¬æã¨ãã°å ±åã«é¢ããæå ±ã¯
       http://www.kernel.org/doc/man-pages/ ã«æ¸ããã¦ããã



Linux                             2013-04-16                             IP(7)