Home | History | Annotate | Download | only in IScsiDxe
      1 /** @file
      2   Define NVData structures used by the iSCSI configuration component
      3 
      4 Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
      5 This program and the accompanying materials
      6 are licensed and made available under the terms and conditions of the BSD License
      7 which accompanies this distribution.  The full text of the license may be found at
      8 http://opensource.org/licenses/bsd-license.php
      9 
     10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     12 
     13 **/
     14 
     15 #ifndef _ISCSI_NVDATASTRUC_H_
     16 #define _ISCSI_NVDATASTRUC_H_
     17 
     18 #include <Guid/Ip4IScsiConfigHii.h>
     19 
     20 #define VAR_EQ_TEST_NAME    0x100
     21 
     22 #define FORMID_MAIN_FORM    1
     23 #define FORMID_DEVICE_FORM  2
     24 
     25 #define ISCSI_NAME_MAX_SIZE 224
     26 
     27 //
     28 // Vfr has a limit on the size, it's 255 bytes.
     29 //
     30 #define ISCSI_NAME_IFR_MIN_SIZE   4
     31 #define ISCSI_NAME_IFR_MAX_SIZE   223
     32 
     33 #define IP_MIN_SIZE               7
     34 #define IP_MAX_SIZE               15
     35 #define IP4_STR_MAX_SIZE          16
     36 
     37 #define LUN_MIN_SIZE              1
     38 #define LUN_MAX_SIZE              20
     39 
     40 #define ISCSI_CHAP_NONE           0
     41 #define ISCSI_CHAP_UNI            1
     42 #define ISCSI_CHAP_MUTUAL         2
     43 
     44 #define TARGET_PORT_MIN_NUM       0
     45 #define TARGET_PORT_MAX_NUM       65535
     46 
     47 #define DEVICE_ENTRY_LABEL        0x1234
     48 #define LABEL_END                 0xffff
     49 
     50 #define KEY_INITIATOR_NAME        0x101
     51 #define KEY_DHCP_ENABLE           0x102
     52 #define KEY_LOCAL_IP              0x103
     53 #define KEY_SUBNET_MASK           0x104
     54 #define KEY_GATE_WAY              0x105
     55 #define KEY_TARGET_IP             0x106
     56 #define KEY_CHAP_NAME             0x107
     57 #define KEY_CHAP_SECRET           0x108
     58 #define KEY_REVERSE_CHAP_NAME     0x109
     59 #define KEY_REVERSE_CHAP_SECRET   0x10a
     60 #define KEY_SAVE_CHANGES          0x10b
     61 #define KEY_TARGET_NAME           0x10c
     62 #define KEY_BOOT_LUN              0x10d
     63 #define KEY_CONFIG_ISID           0x10e
     64 
     65 #define KEY_DEVICE_ENTRY_BASE     0x1000
     66 
     67 #define ISCSI_LUN_STR_MAX_LEN     21
     68 #define ISCSI_CHAP_SECRET_MIN_LEN 12
     69 #define ISCSI_CHAP_SECRET_MAX_LEN 16
     70 //
     71 //  ISCSI_CHAP_SECRET_STORAGE = ISCSI_CHAP_SECRET_MAX_LEN + sizeof (NULL-Terminator)
     72 //
     73 #define ISCSI_CHAP_SECRET_STORAGE 17
     74 
     75 #define ISCSI_CHAP_NAME_MAX_LEN   126
     76 #define ISCSI_CHAP_NAME_STORAGE   127
     77 
     78 #define ISID_CONFIGURABLE_MIN_LEN 6
     79 #define ISID_CONFIGURABLE_MAX_LEN 12
     80 #define ISID_CONFIGURABLE_STORAGE 13
     81 
     82 #pragma pack(1)
     83 typedef struct {
     84   CHAR16  InitiatorName[ISCSI_NAME_MAX_SIZE];
     85 
     86   UINT8   Enabled;
     87 
     88   UINT8   InitiatorInfoFromDhcp;
     89   CHAR16  LocalIp[IP4_STR_MAX_SIZE];
     90   CHAR16  SubnetMask[IP4_STR_MAX_SIZE];
     91   CHAR16  Gateway[IP4_STR_MAX_SIZE];
     92 
     93   CHAR16  TargetName[ISCSI_NAME_MAX_SIZE];
     94   CHAR16  TargetIp[IP4_STR_MAX_SIZE];
     95   UINT16  TargetPort;
     96   CHAR16  BootLun[ISCSI_LUN_STR_MAX_LEN];
     97   UINT8   TargetInfoFromDhcp;
     98 
     99   UINT8   CHAPType;
    100   CHAR16  CHAPName[ISCSI_CHAP_NAME_STORAGE];
    101   CHAR16  CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
    102   CHAR16  ReverseCHAPName[ISCSI_CHAP_NAME_STORAGE];
    103   CHAR16  ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
    104 
    105   CHAR16  IsId[ISID_CONFIGURABLE_STORAGE];
    106 } ISCSI_CONFIG_IFR_NVDATA;
    107 #pragma pack()
    108 
    109 #endif
    110