1 /* $OpenBSD: in.h,v 1.23 1999/04/11 19:41:36 niklas Exp $ */
2 /* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */
5 * Copyright (c) 1982, 1986, 1990, 1993
6 * The Regents of the University of California. All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * @(#)in.h 8.3 (Berkeley) 1/3/94
40 * Constants and structures defined by the internet system,
41 * Per RFC 790, September 1981, and numerous additions.
44 #ifndef _NETINET_IN_H_
45 #define _NETINET_IN_H_
50 #define IPPROTO_IP 0 /* dummy for IP */
51 #define IPPROTO_HOPOPTS IPPROTO_IP /* Hop-by-hop option header. */
52 #define IPPROTO_ICMP 1 /* control message protocol */
53 #define IPPROTO_IGMP 2 /* group mgmt protocol */
54 #define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
55 #define IPPROTO_IPIP 4 /* IP inside IP */
56 #define IPPROTO_IPV4 IPPROTO_IPIP /* IP inside IP */
57 #define IPPROTO_TCP 6 /* tcp */
58 #define IPPROTO_EGP 8 /* exterior gateway protocol */
59 #define IPPROTO_PUP 12 /* pup */
60 #define IPPROTO_UDP 17 /* user datagram protocol */
61 #define IPPROTO_IDP 22 /* xns idp */
62 #define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
63 #define IPPROTO_IPV6 41 /* IPv6 in IPv6 */
64 #define IPPROTO_ROUTING 43 /* Routing header. */
65 #define IPPROTO_FRAGMENT 44 /* Fragmentation/reassembly header. */
66 #define IPPROTO_ESP 50 /* Encap. Security Payload */
67 #define IPPROTO_AH 51 /* Authentication header */
68 #define IPPROTO_ICMPV6 58 /* ICMP for IPv6 */
69 #define IPPROTO_NONE 59 /* No next header */
70 #define IPPROTO_DSTOPTS 60 /* Destination options header. */
71 #define IPPROTO_EON 80 /* ISO cnlp */
72 #define IPPROTO_ENCAP 98 /* encapsulation header */
73 #define IPPROTO_RAW 255 /* raw IP packet */
75 #define IPPROTO_MAX 256
80 * Local port number conventions:
82 * When a user does a bind(2) or connect(2) with a port number of zero,
83 * a non-conflicting local port address is chosen.
84 * The default range is IPPORT_RESERVED through
85 * IPPORT_USERRESERVED, although that is settable by sysctl.
87 * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
88 * default assignment range.
90 * The value IP_PORTRANGE_DEFAULT causes the default behavior.
92 * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
93 * into the "high" range. These are reserved for client outbound connections
94 * which do not want to be filtered by any firewalls.
96 * The value IP_PORTRANGE_LOW changes the range to the "low" are
97 * that is (by convention) restricted to privileged processes. This
98 * convention is based on "vouchsafe" principles only. It is only secure
99 * if you trust the remote host to restrict these ports.
101 * The default range of ports and the high range can be changed by
102 * sysctl(3). (net.inet.ip.port{hi}{first,last})
104 * Changing those values has bad security implications if you are
105 * using a a stateless firewall that is allowing packets outside of that
106 * range in order to allow transparent outgoing connections.
108 * Such a firewall configuration will generally depend on the use of these
109 * default values. If you change them, you may find your Security
110 * Administrator looking for you with a heavy object.
114 * Ports < IPPORT_RESERVED are reserved for
115 * privileged processes (e.g. root).
116 * Ports > IPPORT_USERRESERVED are reserved
117 * for servers, not necessarily privileged.
119 #define IPPORT_RESERVED 1024
120 #define IPPORT_USERRESERVED 49151
123 * Default local port range to use by setting IP_PORTRANGE_HIGH
125 #define IPPORT_HIFIRSTAUTO 49152
126 #define IPPORT_HILASTAUTO 65535
129 * IP Version 4 Internet address (a structure for historical reasons)
136 * IP Version 6 Internet address
140 u_int8_t s6u_addr8
[16];
141 u_int16_t s6u_addr16
[8];
142 u_int32_t s6u_addr32
[4];
144 #define s6_addr s6_u.s6u_addr8
146 * The rest are common, but not guaranteed to be portable. 64 bit access are
147 * not available because the in6_addr in a sockaddr_in6 is not 64 bit aligned.
149 #define s6_addr8 s6_u.s6u_addr8
150 #define s6_addr16 s6_u.s6u_addr16
151 #define s6_addr32 s6_u.s6u_addr32
155 * Definitions of bits in internet address integers.
156 * On subnets, the decomposition of addresses to host and net parts
157 * is done according to subnet mask, not the masks here.
159 * By byte-swapping the constants, we avoid ever having to byte-swap IP
160 * addresses inside the kernel. Unfortunately, user-level programs rely
161 * on these macros not doing byte-swapping.
164 #define __IPADDR(x) ((u_int32_t) htonl((u_int32_t)(x)))
166 #define __IPADDR(x) ((u_int32_t)(x))
169 #define IN_CLASSA(i) (((u_int32_t)(i) & __IPADDR(0x80000000)) == \
170 __IPADDR(0x00000000))
171 #define IN_CLASSA_NET __IPADDR(0xff000000)
172 #define IN_CLASSA_NSHIFT 24
173 #define IN_CLASSA_HOST __IPADDR(0x00ffffff)
174 #define IN_CLASSA_MAX 128
176 #define IN_CLASSB(i) (((u_int32_t)(i) & __IPADDR(0xc0000000)) == \
177 __IPADDR(0x80000000))
178 #define IN_CLASSB_NET __IPADDR(0xffff0000)
179 #define IN_CLASSB_NSHIFT 16
180 #define IN_CLASSB_HOST __IPADDR(0x0000ffff)
181 #define IN_CLASSB_MAX 65536
183 #define IN_CLASSC(i) (((u_int32_t)(i) & __IPADDR(0xe0000000)) == \
184 __IPADDR(0xc0000000))
185 #define IN_CLASSC_NET __IPADDR(0xffffff00)
186 #define IN_CLASSC_NSHIFT 8
187 #define IN_CLASSC_HOST __IPADDR(0x000000ff)
189 #define IN_CLASSD(i) (((u_int32_t)(i) & __IPADDR(0xf0000000)) == \
190 __IPADDR(0xe0000000))
191 /* These ones aren't really net and host fields, but routing needn't know. */
192 #define IN_CLASSD_NET __IPADDR(0xf0000000)
193 #define IN_CLASSD_NSHIFT 28
194 #define IN_CLASSD_HOST __IPADDR(0x0fffffff)
195 #define IN_MULTICAST(i) IN_CLASSD(i)
197 #define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & __IPADDR(0xf0000000)) == \
198 __IPADDR(0xf0000000))
199 #define IN_BADCLASS(i) (((u_int32_t)(i) & __IPADDR(0xf0000000)) == \
200 __IPADDR(0xf0000000))
202 #define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & __IPADDR(0xffffff00)) == \
203 __IPADDR(0xe0000000))
205 #define INADDR_ANY __IPADDR(0x00000000)
206 #define INADDR_LOOPBACK __IPADDR(0x7f000001)
207 #define INADDR_BROADCAST __IPADDR(0xffffffff) /* must be masked */
209 #define INADDR_NONE __IPADDR(0xffffffff) /* -1 return */
212 #define INADDR_UNSPEC_GROUP __IPADDR(0xe0000000) /* 224.0.0.0 */
213 #define INADDR_ALLHOSTS_GROUP __IPADDR(0xe0000001) /* 224.0.0.1 */
214 #define INADDR_MAX_LOCAL_GROUP __IPADDR(0xe00000ff) /* 224.0.0.255 */
216 #define IN_LOOPBACKNET 127 /* official! */
219 * Tests for IPv6 address types
222 #define IN6_IS_ADDR_LINKLOCAL(addr) \
223 (((addr)->s6_addr32[0] & htonl(0xffc00000)) == htonl(0xfe800000))
225 #define IN6_IS_ADDR_LOOPBACK(addr) \
226 (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
227 ((addr)->s6_addr32[2] == 0) && ((addr)->s6_addr32[3] == htonl(1)))
229 #define IN6_IS_ADDR_MULTICAST(addr) \
230 ((addr)->s6_addr8[0] == 0xff)
232 #define IN6_IS_ADDR_SITELOCAL(addr) \
233 (((addr)->s6_addr32[0] & htonl(0xffc00000)) == htonl(0xfec00000))
235 #define IN6_IS_ADDR_UNSPECIFIED(addr) \
236 (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
237 ((addr)->s6_addr32[2] == 0) && ((addr)->s6_addr32[3] == 0))
239 #define IN6_IS_ADDR_V4COMPAT(addr) \
240 (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
241 ((addr)->s6_addr32[2] == 0) && ((addr)->s6_addr32[3] & ~htonl(1)))
243 #define IN6_IS_ADDR_V4MAPPED(addr) \
244 (((addr)->s6_addr32[0] == 0) && ((addr)->s6_addr32[1] == 0) && \
245 ((addr)->s6_addr32[2] == htonl(0xffff)))
247 #define IN6_ARE_ADDR_EQUAL(addr1, addr2) \
248 (((addr1)->s6_addr32[0] == (addr2)->s6_addr32[0]) && \
249 ((addr1)->s6_addr32[1] == (addr2)->s6_addr32[1]) && \
250 ((addr1)->s6_addr32[2] == (addr2)->s6_addr32[2]) && \
251 ((addr1)->s6_addr32[3] == (addr2)->s6_addr32[3]))
254 * IPv6 Multicast scoping. The scope is stored
255 * in the bottom 4 bits of the second byte of the
258 /* 0x0 */ /* reserved */
259 #define IN6_NODE_LOCAL 0x1 /* node-local scope */
260 #define IN6_LINK_LOCAL 0x2 /* link-local scope */
261 /* 0x3 */ /* (unassigned) */
262 /* 0x4 */ /* (unassigned) */
263 #define IN6_SITE_LOCAL 0x5 /* site-local scope */
264 /* 0x6 */ /* (unassigned) */
265 /* 0x7 */ /* (unassigned) */
266 #define IN6_ORG_LOCAL 0x8 /* organization-local scope */
267 /* 0x9 */ /* (unassigned) */
268 /* 0xA */ /* (unassigned) */
269 /* 0xB */ /* (unassigned) */
270 /* 0xC */ /* (unassigned) */
271 /* 0xD */ /* (unassigned) */
272 #define IN6_GLOBAL 0xE /* global scope */
273 /* 0xF */ /* reserved */
275 #define IN6_MSCOPE(addr) ((addr)->s6_addr8[1] & 0x0f)
277 #define IN6_IS_ADDR_MC_NODELOCAL(addr) \
278 (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_NODE_LOCAL))
279 #define IN6_IS_ADDR_MC_LINKLOCAL(addr) \
280 (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_LINK_LOCAL))
281 #define IN6_IS_ADDR_MC_SITELOCAL(addr) \
282 (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_SITE_LOCAL))
283 #define IN6_IS_ADDR_MC_ORGLOCAL(addr) \
284 (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_ORG_LOCAL))
285 #define IN6_IS_ADDR_MC_GLOBAL(addr) \
286 (IN6_IS_ADDR_MULTICAST(addr) && (IN6_MSCOPE(addr) == IN6_GLOBAL))
289 * Definitions of the IPv6 special addresses
291 extern const struct in6_addr in6addr_any
;
292 #define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}}
294 extern const struct in6_addr in6addr_loopback
;
295 #define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}}
298 * IP Version 4 socket address.
302 sa_family_t sin_family
;
304 struct in_addr sin_addr
;
309 * IP Version 6 socket address.
312 struct sockaddr_in6
{
314 sa_family_t sin6_family
;
316 u_int32_t sin6_flowinfo
;
317 struct in6_addr sin6_addr
;
318 u_int32_t sin6_scope_id
;
322 * Structure used to describe IP options.
323 * Used to store options internally, to pass them to a process,
324 * or to restore options retrieved earlier.
325 * The ip_dst is used for the first-hop gateway when using a source route
326 * (this gets put into the header proper).
329 struct in_addr ip_dst
; /* first hop, 0 w/o src rt */
330 #if defined(__cplusplus)
331 int8_t Ip_opts
[40]; /* cannot have same name as class */
333 int8_t ip_opts
[40]; /* actually variable in size */
338 * Options for use with [gs]etsockopt at the IP level.
339 * First word of comment is data type; bool is stored in int.
341 #define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
342 #define IP_HDRINCL 2 /* int; header is included with data */
343 #define IP_TOS 3 /* int; IP type of service and preced. */
344 #define IP_TTL 4 /* int; IP time to live */
345 #define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
346 #define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
347 #define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
348 #define IP_RETOPTS 8 /* ip_opts; set/get IP options */
349 #define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */
350 #define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
351 #define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
352 #define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
353 #define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
355 /* 14-17 left empty for future compatibility with FreeBSD */
357 #define IP_PORTRANGE 19 /* int; range to choose for unspec port */
358 #define IP_AUTH_LEVEL 20 /* u_char; authentication used */
359 #define IP_ESP_TRANS_LEVEL 21 /* u_char; transport encryption */
360 #define IP_ESP_NETWORK_LEVEL 22 /* u_char; full-packet encryption */
362 #define IPV6_MULTICAST_IF 23 /* u_int; set/get multicast interface */
363 #define IPV6_MULTICAST_HOPS 24 /* int; set/get multicast hop limit */
364 #define IPV6_MULTICAST_LOOP 25 /* u_int; set/get multicast loopback */
365 #define IPV6_JOIN_GROUP 26 /* ipv6_mreq; join multicast group */
366 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP /* XXX - for compatibility */
367 #define IPV6_LEAVE_GROUP 27 /* ipv6_mreq: leave multicast group */
368 #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP /* XXX - for compatibility */
369 #define IPV6_ADDRFORM 28 /* int; get/set form of returned addrs */
370 #define IPV6_UNICAST_HOPS 29 /* int; get/set unicast hop limit */
371 #define IPV6_PKTINFO 30 /* int; receive in6_pktinfo as cmsg */
372 #define IPV6_HOPLIMIT 31 /* int; receive int hoplimit as cmsg */
373 #define IPV6_NEXTHOP 32 /* int; receive sockaddr_in6 as cmsg */
374 #define IPV6_HOPOPTS 33 /* int; receive hop options as cmsg */
375 #define IPV6_DSTOPTS 34 /* int; receive dst options as cmsg */
376 #define IPV6_RTHDR 35 /* int; receive routing header as cmsg */
377 #define IPV6_PKTOPTIONS 36 /* int; send/receive cmsgs for TCP */
378 #define IPV6_CHECKSUM 37 /* int; offset to place send checksum */
379 #define ICMPV6_FILTER 38 /* struct icmpv6_filter; get/set filter */
380 #define ICMP6_FILTER ICMP6_FILTER
382 #define IPSEC_OUTSA 39 /* set the outbound SA for a socket */
385 * Security levels - IPsec, not IPSO
388 #define IPSEC_LEVEL_BYPASS 0x00 /* Bypass policy altogether */
389 #define IPSEC_LEVEL_NONE 0x00 /* Send clear, accept any */
390 #define IPSEC_LEVEL_AVAIL 0x01 /* Send secure if SA available */
391 #define IPSEC_LEVEL_USE 0x02 /* Send secure, accept any */
392 #define IPSEC_LEVEL_REQUIRE 0x03 /* Require secure inbound, also use */
393 #define IPSEC_LEVEL_UNIQUE 0x04 /* Use outbound SA that is unique */
394 #define IPSEC_LEVEL_DEFAULT IPSEC_LEVEL_AVAIL
396 #define IPSEC_AUTH_LEVEL_DEFAULT IPSEC_LEVEL_DEFAULT
397 #define IPSEC_ESP_TRANS_LEVEL_DEFAULT IPSEC_LEVEL_DEFAULT
398 #define IPSEC_ESP_NETWORK_LEVEL_DEFAULT IPSEC_LEVEL_DEFAULT
401 * IPv6 Routing header types
403 #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0 */
405 #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor */
406 #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor */
409 * Defaults and limits for options
411 #define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
412 #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
413 #define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */
416 * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
419 struct in_addr imr_multiaddr
; /* IP multicast address of group */
420 struct in_addr imr_interface
; /* local IP address of interface */
424 * Argument structure for IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP.
427 struct in6_addr ipv6mr_multiaddr
; /* IPv6 multicast addr */
428 unsigned int ipv6mr_interface
; /* Interface index */
432 * Argument structure for IPV6_PKTINFO control messages
435 struct in6_addr ipi6_addr
;
436 unsigned int ipi6_ifindex
;
440 * Argument for IP_PORTRANGE:
441 * - which range to search when port is unspecified at bind() or connect()
443 #define IP_PORTRANGE_DEFAULT 0 /* default range */
444 #define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
445 #define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
448 * Buffer lengths for strings containing printable IP addresses
450 #define INET_ADDRSTRLEN 16
451 #define INET6_ADDRSTRLEN 46
454 * Definitions for inet sysctl operations.
456 * Third level is protocol number.
457 * Fourth level is desired variable within that protocol.
459 #define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */
461 #define CTL_IPPROTO_NAMES { \
462 { "ip", CTLTYPE_NODE }, \
463 { "icmp", CTLTYPE_NODE }, \
464 { "igmp", CTLTYPE_NODE }, \
465 { "ggp", CTLTYPE_NODE }, \
466 { "ip4", CTLTYPE_NODE }, \
468 { "tcp", CTLTYPE_NODE }, \
470 { "egp", CTLTYPE_NODE }, \
474 { "pup", CTLTYPE_NODE }, \
479 { "udp", CTLTYPE_NODE }, \
512 { "esp", CTLTYPE_NODE }, \
513 { "ah", CTLTYPE_NODE }, \
517 * Names for IP sysctl objects
519 #define IPCTL_FORWARDING 1 /* act as router */
520 #define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
521 #define IPCTL_DEFTTL 3 /* default TTL */
523 #define IPCTL_DEFMTU 4 /* default MTU */
525 #define IPCTL_SOURCEROUTE 5 /* may perform source routes */
526 #define IPCTL_DIRECTEDBCAST 6 /* default broadcast behavior */
527 #define IPCTL_IPPORT_FIRSTAUTO 7
528 #define IPCTL_IPPORT_LASTAUTO 8
529 #define IPCTL_IPPORT_HIFIRSTAUTO 9
530 #define IPCTL_IPPORT_HILASTAUTO 10
531 #define IPCTL_IPPORT_MAXQUEUE 11
532 #define IPCTL_ENCDEBUG 12
533 #define IPCTL_MAXID 13
535 #define IPCTL_NAMES { \
537 { "forwarding", CTLTYPE_INT }, \
538 { "redirect", CTLTYPE_INT }, \
539 { "ttl", CTLTYPE_INT }, \
540 /* { "mtu", CTLTYPE_INT }, */ { 0, 0 }, \
541 { "sourceroute", CTLTYPE_INT }, \
542 { "directed-broadcast", CTLTYPE_INT }, \
543 { "portfirst", CTLTYPE_INT }, \
544 { "portlast", CTLTYPE_INT }, \
545 { "porthifirst", CTLTYPE_INT }, \
546 { "porthilast", CTLTYPE_INT }, \
547 { "maxqueue", CTLTYPE_INT }, \
548 { "encdebug", CTLTYPE_INT }, \
553 #include <sys/cdefs.h>
556 int bindresvport
__P((int, struct sockaddr_in
*));
560 int in_broadcast
__P((struct in_addr
, struct ifnet
*));
561 int in_canforward
__P((struct in_addr
));
562 int in_cksum
__P((struct mbuf
*, int));
563 int in_localaddr
__P((struct in_addr
));
564 void in_socktrim
__P((struct sockaddr_in
*));
565 char *inet_ntoa
__P((struct in_addr
));
567 #define satosin(sa) ((struct sockaddr_in *)(sa))
568 #define sintosa(sin) ((struct sockaddr *)(sin))
569 #define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
571 #endif /* !_NETINET_IN_H_ */