17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5ae115bc7Smrj * Common Development and Distribution License (the "License"). 6ae115bc7Smrj * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*6cefaae1SJack Meng * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _BOOTPROPS_H 277c478bd9Sstevel@tonic-gate #define _BOOTPROPS_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #include <sys/types.h> 30*6cefaae1SJack Meng #include <netinet/in.h> 31*6cefaae1SJack Meng #include <sys/t_kuser.h> 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #ifdef __cplusplus 347c478bd9Sstevel@tonic-gate extern "C" { 357c478bd9Sstevel@tonic-gate #endif 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate /* 387c478bd9Sstevel@tonic-gate * Boot properties related to netboot: 397c478bd9Sstevel@tonic-gate */ 407c478bd9Sstevel@tonic-gate #define BP_HOST_IP "host-ip" 417c478bd9Sstevel@tonic-gate #define BP_SUBNET_MASK "subnet-mask" 427c478bd9Sstevel@tonic-gate #define BP_ROUTER_IP "router-ip" 437c478bd9Sstevel@tonic-gate #define BP_BOOT_MAC "boot-mac" 447c478bd9Sstevel@tonic-gate #define BP_SERVER_IP "server-ip" 457c478bd9Sstevel@tonic-gate #define BP_SERVER_NAME "server-name" 467c478bd9Sstevel@tonic-gate #define BP_SERVER_PATH "server-path" 477c478bd9Sstevel@tonic-gate #define BP_SERVER_ROOTOPTS "server-rootopts" 487c478bd9Sstevel@tonic-gate #define BP_BOOTP_RESPONSE "bootp-response" 49ae115bc7Smrj #define BP_NETWORK_INTERFACE "network-interface" 507c478bd9Sstevel@tonic-gate 51*6cefaae1SJack Meng /* 52*6cefaae1SJack Meng * kifconf prototypes 53*6cefaae1SJack Meng */ 54*6cefaae1SJack Meng int 55*6cefaae1SJack Meng kdlifconfig(TIUSER *tiptr, int af, void *myIPaddr, void *mymask, 56*6cefaae1SJack Meng struct in_addr *mybraddr, struct in_addr *gateway, char *ifname); 57*6cefaae1SJack Meng int 58*6cefaae1SJack Meng ksetifflags(TIUSER *tiptr, uint_t value, char *ifname); 59*6cefaae1SJack Meng int 60*6cefaae1SJack Meng kifioctl(TIUSER *tiptr, int cmd, struct netbuf *nbuf, char *ifname); 61*6cefaae1SJack Meng 62*6cefaae1SJack Meng /* 63*6cefaae1SJack Meng * Boot properties related to iscsi boot: 64*6cefaae1SJack Meng */ 65*6cefaae1SJack Meng #define IB_BOOT_MACLEN 6 66*6cefaae1SJack Meng #define IB_IP_BUFLEN 16 67*6cefaae1SJack Meng 68*6cefaae1SJack Meng /* 69*6cefaae1SJack Meng * iSCSI boot initiator's properties 70*6cefaae1SJack Meng */ 71*6cefaae1SJack Meng typedef struct _ib_ini_prop { 72*6cefaae1SJack Meng uchar_t *ini_name; 73*6cefaae1SJack Meng uchar_t *ini_chap_name; 74*6cefaae1SJack Meng uchar_t *ini_chap_sec; 75*6cefaae1SJack Meng } ib_ini_prop_t; 76*6cefaae1SJack Meng 77*6cefaae1SJack Meng /* 78*6cefaae1SJack Meng * iSCSI boot nic's properties 79*6cefaae1SJack Meng */ 80*6cefaae1SJack Meng typedef struct _ib_nic_prop { 81*6cefaae1SJack Meng uchar_t nic_mac[6]; 82*6cefaae1SJack Meng uchar_t nic_vlan[2]; 83*6cefaae1SJack Meng union { 84*6cefaae1SJack Meng struct in_addr u_in4; 85*6cefaae1SJack Meng struct in6_addr u_in6; 86*6cefaae1SJack Meng } nic_ip_u; 87*6cefaae1SJack Meng union { 88*6cefaae1SJack Meng struct in_addr u_in4; 89*6cefaae1SJack Meng struct in6_addr u_in6; 90*6cefaae1SJack Meng } nic_gw_u; 91*6cefaae1SJack Meng union { 92*6cefaae1SJack Meng struct in_addr u_in4; 93*6cefaae1SJack Meng struct in6_addr u_in6; 94*6cefaae1SJack Meng } nic_dhcp_u; 95*6cefaae1SJack Meng int sin_family; 96*6cefaae1SJack Meng uchar_t sub_mask_prefix; 97*6cefaae1SJack Meng 98*6cefaae1SJack Meng } ib_nic_prop_t; 99*6cefaae1SJack Meng 100*6cefaae1SJack Meng /* 101*6cefaae1SJack Meng * iSCSI boot target's properties 102*6cefaae1SJack Meng */ 103*6cefaae1SJack Meng typedef struct _ib_tgt_prop { 104*6cefaae1SJack Meng union { 105*6cefaae1SJack Meng struct in_addr u_in4; 106*6cefaae1SJack Meng struct in6_addr u_in6; 107*6cefaae1SJack Meng }tgt_ip_u; 108*6cefaae1SJack Meng int sin_family; 109*6cefaae1SJack Meng uint32_t tgt_port; 110*6cefaae1SJack Meng uchar_t tgt_boot_lun[8]; 111*6cefaae1SJack Meng uchar_t *tgt_name; 112*6cefaae1SJack Meng uchar_t *tgt_chap_name; 113*6cefaae1SJack Meng uchar_t *tgt_chap_sec; 114*6cefaae1SJack Meng int lun_online; 115*6cefaae1SJack Meng } ib_tgt_prop_t; 116*6cefaae1SJack Meng 117*6cefaae1SJack Meng /* 118*6cefaae1SJack Meng * iSCSI boot properties 119*6cefaae1SJack Meng */ 120*6cefaae1SJack Meng typedef struct _ib_boot_prop { 121*6cefaae1SJack Meng ib_ini_prop_t boot_init; 122*6cefaae1SJack Meng ib_nic_prop_t boot_nic; 123*6cefaae1SJack Meng ib_tgt_prop_t boot_tgt; 124*6cefaae1SJack Meng } ib_boot_prop_t; 125*6cefaae1SJack Meng 126*6cefaae1SJack Meng void 127*6cefaae1SJack Meng ld_ib_prop(); 128*6cefaae1SJack Meng 1297c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1307c478bd9Sstevel@tonic-gate } 1317c478bd9Sstevel@tonic-gate #endif 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gate #endif /* _BOOTPROPS_H */ 134