2 Routines to process MTFTP4 options.
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>
5 All rights reserved. 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<BR>
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.
16 #ifndef __EFI_MTFTP4_OPTION_H__
17 #define __EFI_MTFTP4_OPTION_H__
22 MTFTP4_SUPPORTED_OPTIONS
= 4,
23 MTFTP4_OPCODE_LEN
= 2,
24 MTFTP4_ERRCODE_LEN
= 2,
26 MTFTP4_DATA_HEAD_LEN
= 4,
28 MTFTP4_BLKSIZE_EXIST
= 0x01,
29 MTFTP4_TIMEOUT_EXIST
= 0x02,
30 MTFTP4_TSIZE_EXIST
= 0x04,
31 MTFTP4_MCAST_EXIST
= 0x08
32 } MTFTP4_OPTION_CONST_VALUE
;
45 Allocate and fill in a array of Mtftp options from the Packet.
47 It first calls Mtftp4FillOption to get the option number, then allocate
48 the array, at last, call Mtftp4FillOption again to save the options.
50 @param Packet The packet to parse
51 @param PacketLen The length of the packet
52 @param OptionCount The number of options in the packet
53 @param OptionList The point to get the option array.
55 @retval EFI_INVALID_PARAMETER The parametera are invalid or packet isn't a
56 well-formated OACK packet.
57 @retval EFI_SUCCESS The option array is build
58 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the array
62 Mtftp4ExtractOptions (
63 IN EFI_MTFTP4_PACKET
*Packet
,
65 OUT UINT32
*OptionCount
,
66 OUT EFI_MTFTP4_OPTION
**OptionList OPTIONAL
70 Parse the option in Options array to MTFTP4_OPTION which program
73 @param Options The option array, which contains addresses of each
74 option's name/value string.
75 @param Count The number of options in the Options
76 @param Request Whether this is a request or OACK. The format of
77 multicast is different according to this setting.
78 @param MtftpOption The MTFTP4_OPTION for easy access.
80 @retval EFI_INVALID_PARAMETER The option is mal-formated
81 @retval EFI_UNSUPPORTED Some option isn't supported
82 @retval EFI_SUCCESS The option are OK and has been parsed.
87 IN EFI_MTFTP4_OPTION
*Options
,
90 OUT MTFTP4_OPTION
*MtftpOption
94 Parse the options in the OACK packet to MTFTP4_OPTION which program
97 @param Packet The OACK packet to parse
98 @param PacketLen The length of the packet
99 @param MtftpOption The MTFTP_OPTION for easy access.
101 @retval EFI_INVALID_PARAMETER The packet option is mal-formated
102 @retval EFI_UNSUPPORTED Some option isn't supported
103 @retval EFI_SUCCESS The option are OK and has been parsed.
107 Mtftp4ParseOptionOack (
108 IN EFI_MTFTP4_PACKET
*Packet
,
110 OUT MTFTP4_OPTION
*MtftpOption
113 extern CHAR8
*mMtftp4SupportedOptions
[MTFTP4_SUPPORTED_OPTIONS
];