xref: /illumos-gate/usr/src/cmd/cmd-inet/lib/nwamd/llp.h (revision 6ba597c5)
1*6ba597c5SAnurag S. Maskey /*
2*6ba597c5SAnurag S. Maskey  * CDDL HEADER START
3*6ba597c5SAnurag S. Maskey  *
4*6ba597c5SAnurag S. Maskey  * The contents of this file are subject to the terms of the
5*6ba597c5SAnurag S. Maskey  * Common Development and Distribution License (the "License").
6*6ba597c5SAnurag S. Maskey  * You may not use this file except in compliance with the License.
7*6ba597c5SAnurag S. Maskey  *
8*6ba597c5SAnurag S. Maskey  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*6ba597c5SAnurag S. Maskey  * or http://www.opensolaris.org/os/licensing.
10*6ba597c5SAnurag S. Maskey  * See the License for the specific language governing permissions
11*6ba597c5SAnurag S. Maskey  * and limitations under the License.
12*6ba597c5SAnurag S. Maskey  *
13*6ba597c5SAnurag S. Maskey  * When distributing Covered Code, include this CDDL HEADER in each
14*6ba597c5SAnurag S. Maskey  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*6ba597c5SAnurag S. Maskey  * If applicable, add the following below this CDDL HEADER, with the
16*6ba597c5SAnurag S. Maskey  * fields enclosed by brackets "[]" replaced with your own identifying
17*6ba597c5SAnurag S. Maskey  * information: Portions Copyright [yyyy] [name of copyright owner]
18*6ba597c5SAnurag S. Maskey  *
19*6ba597c5SAnurag S. Maskey  * CDDL HEADER END
20*6ba597c5SAnurag S. Maskey  */
21*6ba597c5SAnurag S. Maskey 
22*6ba597c5SAnurag S. Maskey /*
23*6ba597c5SAnurag S. Maskey  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24*6ba597c5SAnurag S. Maskey  * Use is subject to license terms.
25*6ba597c5SAnurag S. Maskey  */
26*6ba597c5SAnurag S. Maskey 
27*6ba597c5SAnurag S. Maskey #ifndef _LLP_H
28*6ba597c5SAnurag S. Maskey #define	_LLP_H
29*6ba597c5SAnurag S. Maskey 
30*6ba597c5SAnurag S. Maskey #include <search.h>
31*6ba597c5SAnurag S. Maskey #include <libnwam.h>
32*6ba597c5SAnurag S. Maskey #include <syslog.h>
33*6ba597c5SAnurag S. Maskey 
34*6ba597c5SAnurag S. Maskey #include "events.h"
35*6ba597c5SAnurag S. Maskey 
36*6ba597c5SAnurag S. Maskey /*
37*6ba597c5SAnurag S. Maskey  * This file is here for legacy support.
38*6ba597c5SAnurag S. Maskey  */
39*6ba597c5SAnurag S. Maskey 
40*6ba597c5SAnurag S. Maskey #define	LLPDIR		"/etc/nwam"
41*6ba597c5SAnurag S. Maskey #define	LLPFILE		LLPDIR"/llp"
42*6ba597c5SAnurag S. Maskey 
43*6ba597c5SAnurag S. Maskey enum interface_type {
44*6ba597c5SAnurag S. Maskey     IF_UNKNOWN, IF_WIRED, IF_WIRELESS, IF_TUN
45*6ba597c5SAnurag S. Maskey };
46*6ba597c5SAnurag S. Maskey 
47*6ba597c5SAnurag S. Maskey typedef enum {
48*6ba597c5SAnurag S. Maskey 	IPV4SRC_STATIC,
49*6ba597c5SAnurag S. Maskey 	IPV4SRC_DHCP
50*6ba597c5SAnurag S. Maskey } ipv4src_t;
51*6ba597c5SAnurag S. Maskey 
52*6ba597c5SAnurag S. Maskey /*
53*6ba597c5SAnurag S. Maskey  * This structure contains a representation of legacy LLP configuration
54*6ba597c5SAnurag S. Maskey  * which previously represented the intended configuration of the system as
55*6ba597c5SAnurag S. Maskey  * differentiated from the actual IPv4 configuration of the system represented
56*6ba597c5SAnurag S. Maskey  * by the interface structures.
57*6ba597c5SAnurag S. Maskey  *
58*6ba597c5SAnurag S. Maskey  * llp structures are held on the list llp_head.
59*6ba597c5SAnurag S. Maskey  */
60*6ba597c5SAnurag S. Maskey typedef struct llp {
61*6ba597c5SAnurag S. Maskey 	struct qelem llp_links;
62*6ba597c5SAnurag S. Maskey 	char	llp_lname[LIFNAMSIZ];
63*6ba597c5SAnurag S. Maskey 	uint32_t llp_pri;		/* lower number => higher priority */
64*6ba597c5SAnurag S. Maskey 	int	llp_fileorder;
65*6ba597c5SAnurag S. Maskey 	enum interface_type llp_type;
66*6ba597c5SAnurag S. Maskey 	ipv4src_t llp_ipv4src;
67*6ba597c5SAnurag S. Maskey 	char	*llp_ipv4addrstr;	/* if ipsrc is STATIC */
68*6ba597c5SAnurag S. Maskey 	char	*llp_ipv6addrstr;	/* if the user provided a static addr */
69*6ba597c5SAnurag S. Maskey 	boolean_t llp_ipv6onlink;	/* true if we plumb up a v6 interface */
70*6ba597c5SAnurag S. Maskey } llp_t;
71*6ba597c5SAnurag S. Maskey 
72*6ba597c5SAnurag S. Maskey extern llp_t *link_layer_profile;
73*6ba597c5SAnurag S. Maskey 
74*6ba597c5SAnurag S. Maskey void nwamd_handle_upgrade(nwamd_event_t);
75*6ba597c5SAnurag S. Maskey 
76*6ba597c5SAnurag S. Maskey #endif /* _LLP_H */
77