| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: ip.4,v 1.22 2006/12/23 06:58:20 wiz Exp $ | | 1 | .\" $NetBSD: ip.4,v 1.23 2008/09/23 14:58:05 briggs Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1983, 1991, 1993 | | 3 | .\" Copyright (c) 1983, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" 3. Neither the name of the University nor the names of its contributors | | 14 | .\" 3. Neither the name of the University nor the names of its contributors |
| @@ -19,27 +19,27 @@ | | | @@ -19,27 +19,27 @@ |
19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 | .\" SUCH DAMAGE. | | 28 | .\" SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 | | 30 | .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 |
31 | .\" | | 31 | .\" |
32 | .Dd December 5, 2006 | | 32 | .Dd September 23, 2008 |
33 | .Dt IP 4 | | 33 | .Dt IP 4 |
34 | .Os | | 34 | .Os |
35 | .Sh NAME | | 35 | .Sh NAME |
36 | .Nm ip | | 36 | .Nm ip |
37 | .Nd Internet Protocol | | 37 | .Nd Internet Protocol |
38 | .Sh SYNOPSIS | | 38 | .Sh SYNOPSIS |
39 | .In sys/socket.h | | 39 | .In sys/socket.h |
40 | .In netinet/in.h | | 40 | .In netinet/in.h |
41 | .Ft int | | 41 | .Ft int |
42 | .Fn socket AF_INET SOCK_RAW proto | | 42 | .Fn socket AF_INET SOCK_RAW proto |
43 | .Sh DESCRIPTION | | 43 | .Sh DESCRIPTION |
44 | .Tn IP | | 44 | .Tn IP |
45 | is the network layer protocol used by the Internet protocol family. | | 45 | is the network layer protocol used by the Internet protocol family. |
| @@ -84,27 +84,27 @@ setsockopt(s, IPPROTO_IP, IP_OPTIONS, NU | | | @@ -84,27 +84,27 @@ setsockopt(s, IPPROTO_IP, IP_OPTIONS, NU |
84 | .Pp | | 84 | .Pp |
85 | .Dv IP_TOS | | 85 | .Dv IP_TOS |
86 | and | | 86 | and |
87 | .Dv IP_TTL | | 87 | .Dv IP_TTL |
88 | may be used to set the type-of-service and time-to-live fields in the | | 88 | may be used to set the type-of-service and time-to-live fields in the |
89 | .Tn IP | | 89 | .Tn IP |
90 | header for | | 90 | header for |
91 | .Dv SOCK_STREAM | | 91 | .Dv SOCK_STREAM |
92 | and | | 92 | and |
93 | .Dv SOCK_DGRAM | | 93 | .Dv SOCK_DGRAM |
94 | sockets. | | 94 | sockets. |
95 | For example, | | 95 | For example, |
96 | .Bd -literal | | 96 | .Bd -literal |
97 | int tos = IPTOS_LOWDELAY; /* see \*[Lt]netinet/in.h\*[Gt] */ | | 97 | int tos = IPTOS_LOWDELAY; /* see \*[Lt]netinet/ip.h\*[Gt] */ |
98 | setsockopt(s, IPPROTO_IP, IP_TOS, \*[Am]tos, sizeof(tos)); | | 98 | setsockopt(s, IPPROTO_IP, IP_TOS, \*[Am]tos, sizeof(tos)); |
99 | | | 99 | |
100 | int ttl = 60; /* max = 255 */ | | 100 | int ttl = 60; /* max = 255 */ |
101 | setsockopt(s, IPPROTO_IP, IP_TTL, \*[Am]ttl, sizeof(ttl)); | | 101 | setsockopt(s, IPPROTO_IP, IP_TTL, \*[Am]ttl, sizeof(ttl)); |
102 | .Ed | | 102 | .Ed |
103 | .Pp | | 103 | .Pp |
104 | .Dv IP_IPSEC_POLICY | | 104 | .Dv IP_IPSEC_POLICY |
105 | controls IPSec policy for sockets. | | 105 | controls IPSec policy for sockets. |
106 | For example, | | 106 | For example, |
107 | .Bd -literal | | 107 | .Bd -literal |
108 | const char *policy = "in ipsec ah/transport//require"; | | 108 | const char *policy = "in ipsec ah/transport//require"; |
109 | char *buf = ipsec_set_policy(policy, strlen(policy)); | | 109 | char *buf = ipsec_set_policy(policy, strlen(policy)); |
110 | setsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY, buf, ipsec_get_policylen(buf)); | | 110 | setsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY, buf, ipsec_get_policylen(buf)); |