]>
git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Mtftp4Dxe/Mtftp4Option.h
2 Routines to process MTFTP4 options.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EFI_MTFTP4_OPTION_H__
11 #define __EFI_MTFTP4_OPTION_H__
13 #define MTFTP4_SUPPORTED_OPTIONS 5
14 #define MTFTP4_OPCODE_LEN 2
15 #define MTFTP4_ERRCODE_LEN 2
16 #define MTFTP4_BLKNO_LEN 2
17 #define MTFTP4_DATA_HEAD_LEN 4
19 #define MTFTP4_BLKSIZE_EXIST 0x01
20 #define MTFTP4_TIMEOUT_EXIST 0x02
21 #define MTFTP4_TSIZE_EXIST 0x04
22 #define MTFTP4_MCAST_EXIST 0x08
23 #define MTFTP4_WINDOWSIZE_EXIST 0x10
37 Allocate and fill in a array of Mtftp options from the Packet.
39 It first calls Mtftp4FillOption to get the option number, then allocate
40 the array, at last, call Mtftp4FillOption again to save the options.
42 @param Packet The packet to parse
43 @param PacketLen The length of the packet
44 @param OptionCount The number of options in the packet
45 @param OptionList The point to get the option array.
47 @retval EFI_INVALID_PARAMETER The parametera are invalid or packet isn't a
48 well-formatted OACK packet.
49 @retval EFI_SUCCESS The option array is build
50 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the array
54 Mtftp4ExtractOptions (
55 IN EFI_MTFTP4_PACKET
*Packet
,
57 OUT UINT32
*OptionCount
,
58 OUT EFI_MTFTP4_OPTION
**OptionList OPTIONAL
62 Parse the option in Options array to MTFTP4_OPTION which program
65 @param Options The option array, which contains addresses of each
66 option's name/value string.
67 @param Count The number of options in the Options
68 @param Request Whether this is a request or OACK. The format of
69 multicast is different according to this setting.
70 @param Operation The current performed operation.
71 @param MtftpOption The MTFTP4_OPTION for easy access.
73 @retval EFI_INVALID_PARAMETER The option is malformatted
74 @retval EFI_UNSUPPORTED Some option isn't supported
75 @retval EFI_SUCCESS The option are OK and has been parsed.
80 IN EFI_MTFTP4_OPTION
*Options
,
84 OUT MTFTP4_OPTION
*MtftpOption
88 Parse the options in the OACK packet to MTFTP4_OPTION which program
91 @param Packet The OACK packet to parse
92 @param PacketLen The length of the packet
93 @param Operation The current performed operation.
94 @param MtftpOption The MTFTP_OPTION for easy access.
96 @retval EFI_INVALID_PARAMETER The packet option is malformatted
97 @retval EFI_UNSUPPORTED Some option isn't supported
98 @retval EFI_SUCCESS The option are OK and has been parsed.
102 Mtftp4ParseOptionOack (
103 IN EFI_MTFTP4_PACKET
*Packet
,
106 OUT MTFTP4_OPTION
*MtftpOption
109 extern CHAR8
*mMtftp4SupportedOptions
[MTFTP4_SUPPORTED_OPTIONS
];