]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h
2 Routines to process MTFTP4 options.
4 Copyright (c) 2006 - 2018, 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<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__
19 #define MTFTP4_SUPPORTED_OPTIONS 5
20 #define MTFTP4_OPCODE_LEN 2
21 #define MTFTP4_ERRCODE_LEN 2
22 #define MTFTP4_BLKNO_LEN 2
23 #define MTFTP4_DATA_HEAD_LEN 4
25 #define MTFTP4_BLKSIZE_EXIST 0x01
26 #define MTFTP4_TIMEOUT_EXIST 0x02
27 #define MTFTP4_TSIZE_EXIST 0x04
28 #define MTFTP4_MCAST_EXIST 0x08
29 #define MTFTP4_WINDOWSIZE_EXIST 0x10
43 Allocate and fill in a array of Mtftp options from the Packet.
45 It first calls Mtftp4FillOption to get the option number, then allocate
46 the array, at last, call Mtftp4FillOption again to save the options.
48 @param Packet The packet to parse
49 @param PacketLen The length of the packet
50 @param OptionCount The number of options in the packet
51 @param OptionList The point to get the option array.
53 @retval EFI_INVALID_PARAMETER The parametera are invalid or packet isn't a
54 well-formated OACK packet.
55 @retval EFI_SUCCESS The option array is build
56 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the array
60 Mtftp4ExtractOptions (
61 IN EFI_MTFTP4_PACKET
*Packet
,
63 OUT UINT32
*OptionCount
,
64 OUT EFI_MTFTP4_OPTION
**OptionList OPTIONAL
68 Parse the option in Options array to MTFTP4_OPTION which program
71 @param Options The option array, which contains addresses of each
72 option's name/value string.
73 @param Count The number of options in the Options
74 @param Request Whether this is a request or OACK. The format of
75 multicast is different according to this setting.
76 @param Operation The current performed operation.
77 @param MtftpOption The MTFTP4_OPTION for easy access.
79 @retval EFI_INVALID_PARAMETER The option is mal-formated
80 @retval EFI_UNSUPPORTED Some option isn't supported
81 @retval EFI_SUCCESS The option are OK and has been parsed.
86 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 Operation The current performed operation.
100 @param MtftpOption The MTFTP_OPTION for easy access.
102 @retval EFI_INVALID_PARAMETER The packet option is mal-formated
103 @retval EFI_UNSUPPORTED Some option isn't supported
104 @retval EFI_SUCCESS The option are OK and has been parsed.
108 Mtftp4ParseOptionOack (
109 IN EFI_MTFTP4_PACKET
*Packet
,
112 OUT MTFTP4_OPTION
*MtftpOption
115 extern CHAR8
*mMtftp4SupportedOptions
[MTFTP4_SUPPORTED_OPTIONS
];