1 /** @file
2   The header file of iSCSI DHCP6 related configuration routines.
3 
4 Copyright (c) 2004 - 2012, 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_DHCP6_H_
16 #define _ISCSI_DHCP6_H_
17 
18 #define DHCP6_OPT_REQUEST_OPTION 6
19 #define DHCP6_OPT_VENDOR_INFO    17
20 #define DHCP6_OPT_DNS_SERVERS    23
21 ///
22 /// Assigned by IANA, RFC 5970
23 ///
24 #define DHCP6_OPT_BOOT_FILE_URL  59
25 #define DHCP6_OPT_BOOT_FILE_PARA 60
26 
27 #define ISCSI_ROOT_PATH_ID                   "iscsi:"
28 #define ISCSI_ROOT_PATH_FIELD_DELIMITER      ':'
29 #define ISCSI_ROOT_PATH_ADDR_START_DELIMITER '['
30 #define ISCSI_ROOT_PATH_ADDR_END_DELIMITER   ']'
31 
32 
33 /**
34   Extract the Root Path option and get the required target information from
35   Boot File Uniform Resource Locator (URL) Option.
36 
37   @param[in]       RootPath      The RootPath string.
38   @param[in]       Length        Length of the RootPath option payload.
39   @param[in, out]  ConfigData    The iSCSI session configuration data read from
40                                  nonvolatile device.
41 
42   @retval EFI_SUCCESS            All required information is extracted from the
43                                  RootPath option.
44   @retval EFI_NOT_FOUND          The RootPath is not an iSCSI RootPath.
45   @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.
46   @retval EFI_INVALID_PARAMETER  The RootPath is malformatted.
47 
48 **/
49 EFI_STATUS
50 IScsiDhcp6ExtractRootPath (
51   IN     CHAR8                        *RootPath,
52   IN     UINT16                       Length,
53   IN OUT ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData
54   );
55 
56 /**
57   Parse the DHCP ACK to get the address configuration and DNS information.
58 
59   @param[in]       Image         The handle of the driver image.
60   @param[in]       Controller    The handle of the controller;
61   @param[in, out]  ConfigData    The attempt configuration data.
62 
63   @retval EFI_SUCCESS            The DNS information is got from the DHCP ACK.
64   @retval EFI_NO_MAPPING         DHCP failed to acquire address and other
65                                  information.
66   @retval EFI_INVALID_PARAMETER  The DHCP ACK's DNS option is malformatted.
67   @retval EFI_DEVICE_ERROR       Some unexpected error happened.
68   @retval EFI_OUT_OF_RESOURCES   There is no sufficient resource to finish the
69                                  operation.
70   @retval EFI_NO_MEDIA           There was a media error.
71 
72 **/
73 EFI_STATUS
74 IScsiDoDhcp6 (
75   IN     EFI_HANDLE                  Image,
76   IN     EFI_HANDLE                  Controller,
77   IN OUT ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData
78   );
79 
80 #endif
81