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