xref: /titanic_50/usr/src/lib/libipadm/common/ipadm_ndpd.h (revision b56bf881a9655cb27b53cba1468312f7c6dfb0a2)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 #ifndef _IPADM_NDPD_H
26 #define	_IPADM_NDPD_H
27 
28 #ifdef	__cplusplus
29 extern "C" {
30 #endif
31 #include <libipadm.h>
32 
33 /* File used for the AF_UNIX socket used in communicating with in.ndpd */
34 #define	IPADM_UDS_PATH	"/var/run/in.ndpd_ipadm"
35 
36 /* Types of messages sent to in.ndpd */
37 enum {
38 	IPADM_DISABLE_AUTOCONF,
39 	IPADM_ENABLE_AUTOCONF,
40 	IPADM_CREATE_ADDRS,
41 	IPADM_DELETE_ADDRS
42 };
43 
44 /* Message format sent to in.ndpd */
45 typedef struct ipadm_ndpd_msg_s {
46 	uint32_t		inm_cmd;
47 	char			inm_ifname[LIFNAMSIZ];
48 	struct sockaddr_in6	inm_intfid;
49 	int			inm_intfidlen;
50 	boolean_t		inm_stateless;
51 	boolean_t		inm_stateful;
52 	char			inm_aobjname[MAXNAMELEN];
53 } ipadm_ndpd_msg_t;
54 
55 /* Functions to send to and receive from in.ndpd */
56 extern int		ipadm_ndpd_write(int, const void *, size_t);
57 extern int		ipadm_ndpd_read(int, void *, size_t);
58 
59 /*
60  * Functions used by in.ndpd to add and delete address objects while
61  * adding/deleting each stateless/stateful autoconfigured address.
62  */
63 extern ipadm_status_t	ipadm_add_aobjname(ipadm_handle_t, const char *,
64 			    sa_family_t, const char *, ipadm_addr_type_t, int);
65 extern ipadm_status_t	ipadm_delete_aobjname(ipadm_handle_t, const char *,
66 			    sa_family_t, const char *, ipadm_addr_type_t, int);
67 
68 #ifdef	__cplusplus
69 }
70 #endif
71 
72 #endif	/* _IPADM_NDPD_H */
73