xref: /onnv-gate/usr/src/uts/common/sys/bootprops.h (revision 10822:2a6b5dc1374c)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
53446Smrj  * Common Development and Distribution License (the "License").
63446Smrj  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*10822SJack.Meng@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_BOOTPROPS_H
270Sstevel@tonic-gate #define	_BOOTPROPS_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #include <sys/types.h>
308194SJack.Meng@Sun.COM #include <netinet/in.h>
318194SJack.Meng@Sun.COM #include <sys/t_kuser.h>
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #ifdef	__cplusplus
340Sstevel@tonic-gate extern "C" {
350Sstevel@tonic-gate #endif
360Sstevel@tonic-gate 
370Sstevel@tonic-gate /*
380Sstevel@tonic-gate  * Boot properties related to netboot:
390Sstevel@tonic-gate  */
400Sstevel@tonic-gate #define	BP_HOST_IP			"host-ip"
410Sstevel@tonic-gate #define	BP_SUBNET_MASK			"subnet-mask"
420Sstevel@tonic-gate #define	BP_ROUTER_IP			"router-ip"
430Sstevel@tonic-gate #define	BP_BOOT_MAC			"boot-mac"
440Sstevel@tonic-gate #define	BP_SERVER_IP			"server-ip"
450Sstevel@tonic-gate #define	BP_SERVER_NAME			"server-name"
460Sstevel@tonic-gate #define	BP_SERVER_PATH			"server-path"
470Sstevel@tonic-gate #define	BP_SERVER_ROOTOPTS		"server-rootopts"
480Sstevel@tonic-gate #define	BP_BOOTP_RESPONSE		"bootp-response"
49*10822SJack.Meng@Sun.COM 
50*10822SJack.Meng@Sun.COM /*
51*10822SJack.Meng@Sun.COM  * Boot properties related to iscsiboot:
52*10822SJack.Meng@Sun.COM  */
533446Smrj #define	BP_NETWORK_INTERFACE		"network-interface"
54*10822SJack.Meng@Sun.COM #define	BP_ISCSI_TARGET_NAME		"iscsi-target-name"
55*10822SJack.Meng@Sun.COM #define	BP_ISCSI_TARGET_IP		"iscsi-target-ip"
56*10822SJack.Meng@Sun.COM #define	BP_ISCSI_INITIATOR_ID		"iscsi-initiator-id"
57*10822SJack.Meng@Sun.COM #define	BP_ISCSI_PORT			"iscsi-port"
58*10822SJack.Meng@Sun.COM #define	BP_ISCSI_TPGT			"iscsi-tpgt"
59*10822SJack.Meng@Sun.COM #define	BP_ISCSI_LUN			"iscsi-lun"
60*10822SJack.Meng@Sun.COM #define	BP_ISCSI_PAR			"iscsi-partition"
61*10822SJack.Meng@Sun.COM #define	BP_ISCSI_NETWORK_BOOTPATH	"iscsi-network-bootpath"
62*10822SJack.Meng@Sun.COM #define	BP_ISCSI_DISK			"/iscsi-hba/disk"
63*10822SJack.Meng@Sun.COM #define	BP_BOOTPATH			"bootpath"
64*10822SJack.Meng@Sun.COM #define	BP_CHAP_USER			"chap-user"
65*10822SJack.Meng@Sun.COM #define	BP_CHAP_PASSWORD		"chap-password"
66*10822SJack.Meng@Sun.COM #define	BP_LOCAL_MAC_ADDRESS		"local-mac-address"
670Sstevel@tonic-gate 
688194SJack.Meng@Sun.COM /*
698194SJack.Meng@Sun.COM  * kifconf prototypes
708194SJack.Meng@Sun.COM  */
718194SJack.Meng@Sun.COM int
728194SJack.Meng@Sun.COM kdlifconfig(TIUSER *tiptr, int af, void *myIPaddr, void *mymask,
738194SJack.Meng@Sun.COM     struct in_addr *mybraddr, struct in_addr *gateway, char *ifname);
748194SJack.Meng@Sun.COM int
758194SJack.Meng@Sun.COM ksetifflags(TIUSER *tiptr, uint_t value, char *ifname);
768194SJack.Meng@Sun.COM int
778194SJack.Meng@Sun.COM kifioctl(TIUSER *tiptr, int cmd, struct netbuf *nbuf, char *ifname);
788194SJack.Meng@Sun.COM 
798194SJack.Meng@Sun.COM /*
808194SJack.Meng@Sun.COM  * Boot properties related to iscsi boot:
818194SJack.Meng@Sun.COM  */
828194SJack.Meng@Sun.COM #define	IB_BOOT_MACLEN		6
838194SJack.Meng@Sun.COM #define	IB_IP_BUFLEN		16
848194SJack.Meng@Sun.COM 
858194SJack.Meng@Sun.COM /*
868194SJack.Meng@Sun.COM  * iSCSI boot initiator's properties
878194SJack.Meng@Sun.COM  */
888194SJack.Meng@Sun.COM typedef struct _ib_ini_prop {
898194SJack.Meng@Sun.COM 	uchar_t		*ini_name;
90*10822SJack.Meng@Sun.COM 	size_t		ini_name_len;
918194SJack.Meng@Sun.COM 	uchar_t		*ini_chap_name;
92*10822SJack.Meng@Sun.COM 	size_t		ini_chap_name_len;
938194SJack.Meng@Sun.COM 	uchar_t		*ini_chap_sec;
94*10822SJack.Meng@Sun.COM 	size_t		ini_chap_sec_len;
958194SJack.Meng@Sun.COM } ib_ini_prop_t;
968194SJack.Meng@Sun.COM 
978194SJack.Meng@Sun.COM /*
988194SJack.Meng@Sun.COM  * iSCSI boot nic's properties
998194SJack.Meng@Sun.COM  */
1008194SJack.Meng@Sun.COM typedef struct _ib_nic_prop {
1018194SJack.Meng@Sun.COM 	uchar_t		nic_mac[6];
1028194SJack.Meng@Sun.COM 	uchar_t		nic_vlan[2];
1038194SJack.Meng@Sun.COM 	union {
1048194SJack.Meng@Sun.COM 		struct in_addr	u_in4;
1058194SJack.Meng@Sun.COM 		struct in6_addr	u_in6;
1068194SJack.Meng@Sun.COM 	} nic_ip_u;
1078194SJack.Meng@Sun.COM 	union {
1088194SJack.Meng@Sun.COM 		struct in_addr	u_in4;
1098194SJack.Meng@Sun.COM 		struct in6_addr	u_in6;
1108194SJack.Meng@Sun.COM 	} nic_gw_u;
1118194SJack.Meng@Sun.COM 	union {
1128194SJack.Meng@Sun.COM 		struct in_addr	u_in4;
1138194SJack.Meng@Sun.COM 		struct in6_addr	u_in6;
1148194SJack.Meng@Sun.COM 	} nic_dhcp_u;
1158194SJack.Meng@Sun.COM 	int		sin_family;
1168194SJack.Meng@Sun.COM 	uchar_t		sub_mask_prefix;
1178194SJack.Meng@Sun.COM 
1188194SJack.Meng@Sun.COM } ib_nic_prop_t;
1198194SJack.Meng@Sun.COM 
1208194SJack.Meng@Sun.COM /*
1218194SJack.Meng@Sun.COM  * iSCSI boot target's properties
1228194SJack.Meng@Sun.COM  */
1238194SJack.Meng@Sun.COM typedef struct _ib_tgt_prop {
1248194SJack.Meng@Sun.COM 	union {
1258194SJack.Meng@Sun.COM 		struct in_addr	u_in4;
1268194SJack.Meng@Sun.COM 		struct in6_addr	u_in6;
1278194SJack.Meng@Sun.COM 	}tgt_ip_u;
1288194SJack.Meng@Sun.COM 	int		sin_family;
1298194SJack.Meng@Sun.COM 	uint32_t	tgt_port;
1308194SJack.Meng@Sun.COM 	uchar_t		tgt_boot_lun[8];
1318194SJack.Meng@Sun.COM 	uchar_t		*tgt_name;
132*10822SJack.Meng@Sun.COM 	size_t		tgt_name_len;
1338194SJack.Meng@Sun.COM 	uchar_t		*tgt_chap_name;
134*10822SJack.Meng@Sun.COM 	size_t		tgt_chap_name_len;
1358194SJack.Meng@Sun.COM 	uchar_t		*tgt_chap_sec;
136*10822SJack.Meng@Sun.COM 	size_t		tgt_chap_sec_len;
1378194SJack.Meng@Sun.COM 	int		lun_online;
138*10822SJack.Meng@Sun.COM 	uchar_t		*tgt_boot_par;
139*10822SJack.Meng@Sun.COM 	size_t		tgt_boot_par_len;
140*10822SJack.Meng@Sun.COM 	uint16_t	tgt_tpgt;
1418194SJack.Meng@Sun.COM } ib_tgt_prop_t;
1428194SJack.Meng@Sun.COM 
1438194SJack.Meng@Sun.COM /*
1448194SJack.Meng@Sun.COM  * iSCSI boot properties
1458194SJack.Meng@Sun.COM  */
1468194SJack.Meng@Sun.COM typedef struct _ib_boot_prop {
1478194SJack.Meng@Sun.COM 	ib_ini_prop_t	boot_init;
1488194SJack.Meng@Sun.COM 	ib_nic_prop_t	boot_nic;
1498194SJack.Meng@Sun.COM 	ib_tgt_prop_t	boot_tgt;
1508194SJack.Meng@Sun.COM } ib_boot_prop_t;
1518194SJack.Meng@Sun.COM 
1528194SJack.Meng@Sun.COM void
1538194SJack.Meng@Sun.COM ld_ib_prop();
1548194SJack.Meng@Sun.COM 
155*10822SJack.Meng@Sun.COM void
156*10822SJack.Meng@Sun.COM iscsi_boot_prop_free();
157*10822SJack.Meng@Sun.COM 
158*10822SJack.Meng@Sun.COM void
159*10822SJack.Meng@Sun.COM get_iscsi_bootpath_vhci(char *bootpath);
160*10822SJack.Meng@Sun.COM 
161*10822SJack.Meng@Sun.COM void
162*10822SJack.Meng@Sun.COM get_iscsi_bootpath_phy(char *bootpath);
163*10822SJack.Meng@Sun.COM 
1640Sstevel@tonic-gate #ifdef	__cplusplus
1650Sstevel@tonic-gate }
1660Sstevel@tonic-gate #endif
1670Sstevel@tonic-gate 
1680Sstevel@tonic-gate #endif	/* _BOOTPROPS_H */
169