xref: /illumos-gate/usr/src/stand/lib/inet/ipv4.h (revision f3041bfa)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  *
26  * IPv4 implementation-specific definitions
27  */
28 
29 #ifndef _IPV4_H
30 #define	_IPV4_H
31 
32 #pragma ident	"%Z%%M%	%I%	%E% SMI"
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 #define	RT_UNUSED	1	/* Table entry is unused */
39 #define	RT_DEFAULT	2	/* Gateway is a default router */
40 #define	RT_HOST		4	/* Destination is a host */
41 #define	RT_NET		8	/* Destination is a network */
42 #define	RT_NG		10	/* Route is No Good */
43 #define	IPV4_ROUTE_TABLE_SIZE	(5)	/* Number of entries in the table */
44 
45 #define	IPV4_ADD_ROUTE		0
46 #define	IPV4_DEL_ROUTE		1
47 #define	IPV4_BAD_ROUTE		2
48 
49 extern char		*inet_ntoa(struct in_addr);
50 extern void		ipv4_setdefaultrouter(struct in_addr *);
51 extern int		ipv4_setpromiscuous(int);
52 extern void		ipv4_setipaddr(struct in_addr *);
53 extern void		ipv4_getipaddr(struct in_addr *);
54 extern void		ipv4_setnetmask(struct in_addr *);
55 extern void		ipv4_getnetmask(struct in_addr *);
56 extern int		ipv4_route(int, uint8_t, struct in_addr *,
57 			    struct in_addr *);
58 extern void		ipv4_setmaxttl(uint8_t);
59 extern in_addr_t	inet_addr(const char *);
60 extern void		hexdump(char *, int);
61 extern int		prom_cached_reply(int);
62 extern void		ipv4_getnetid(struct in_addr *);
63 #ifdef	__cplusplus
64 }
65 #endif
66 
67 #endif /* _IPV4_H */
68