12CHAR8 *mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM] = {
52 return EFI_OUT_OF_RESOURCES;
59 while ((*TempStr !=
'\0') && (*TempStr !=
',')) {
68 if (EFI_ERROR (Status)) {
72 while ((*Str !=
'\0') && (*Str !=
',')) {
78 return EFI_INVALID_PARAMETER;
88 ExtInfo->McastPort = 0;
93 return EFI_INVALID_PARAMETER;
96 ExtInfo->McastPort = (UINT16)Num;
98 while (NET_IS_DIGIT (*Str)) {
104 return EFI_INVALID_PARAMETER;
114 if ((Num != 0) && (Num != 1)) {
115 return EFI_INVALID_PARAMETER;
118 ExtInfo->IsMaster = (BOOLEAN)(Num == 1);
120 while (NET_IS_DIGIT (*Str)) {
125 return EFI_INVALID_PARAMETER;
150 IN BOOLEAN IsRequest,
162 for (Index = 0; Index < Count; Index++) {
163 Opt = Options + Index;
166 return EFI_INVALID_PARAMETER;
175 if ((Value < 8) || (Value > 65464)) {
176 return EFI_INVALID_PARAMETER;
179 ExtInfo->BlkSize = (UINT16)Value;
180 ExtInfo->BitMap |= MTFTP6_OPT_BLKSIZE_BIT;
187 if ((Value < 1) || (Value > 255)) {
188 return EFI_INVALID_PARAMETER;
191 ExtInfo->Timeout = (UINT8)Value;
192 ExtInfo->BitMap |= MTFTP6_OPT_TIMEOUT_BIT;
198 ExtInfo->BitMap |= MTFTP6_OPT_TSIZE_BIT;
207 if (EFI_ERROR (Status)) {
210 }
else if (*(Opt->
ValueStr) !=
'\0') {
211 return EFI_INVALID_PARAMETER;
214 ExtInfo->BitMap |= MTFTP6_OPT_MCAST_BIT;
220 return EFI_UNSUPPORTED;
226 return EFI_INVALID_PARAMETER;
229 ExtInfo->WindowSize = (UINT16)Value;
230 ExtInfo->BitMap |= MTFTP6_OPT_WINDOWSIZE_BIT;
231 }
else if (IsRequest) {
235 return EFI_UNSUPPORTED;
263 IN OUT UINT32 *Count,
274 Cur = (UINT8 *)Packet + MTFTP6_OPCODE_LEN;
275 Last = (UINT8 *)Packet + PacketLen - 1;
289 return EFI_PROTOCOL_ERROR;
300 if ((Options !=
NULL) && (Num <= *Count)) {
301 Options[Num - 1].OptionStr = Name;
302 Options[Num - 1].ValueStr = Value;
311 if ((*Count < Num) || (Options ==
NULL)) {
313 return EFI_BUFFER_TOO_SMALL;
343 IN OUT UINT32 *OptionCount,
349 if ((PacketLen == 0) || (Packet ==
NULL) || (OptionCount ==
NULL)) {
350 return EFI_INVALID_PARAMETER;
355 if (OptionList !=
NULL) {
360 return EFI_INVALID_PARAMETER;
366 if (*((UINT8 *)Packet + PacketLen - 1) != 0) {
367 return EFI_PROTOCOL_ERROR;
376 if (Status != EFI_BUFFER_TOO_SMALL) {
383 if (*OptionCount == 0) {
384 return EFI_NOT_FOUND;
390 if (OptionList ==
NULL) {
399 if (*OptionList ==
NULL) {
400 return EFI_OUT_OF_RESOURCES;
409 if (EFI_ERROR (Status)) {
INTN EFIAPI AsciiStriCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
UINTN EFIAPI AsciiStrDecimalToUintn(IN CONST CHAR8 *String)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define EFI_MTFTP6_OPCODE_OACK
The MTFTPv6 packet is an option acknowledgement packet.
#define EFI_MTFTP6_OPCODE_WRQ
The MTFTPv6 packet is a write request.
EFI_STATUS Mtftp6ParsePacketOption(IN EFI_MTFTP6_PACKET *Packet, IN UINT32 PacketLen, IN OUT UINT32 *Count, IN EFI_MTFTP6_OPTION *Options OPTIONAL)
EFI_STATUS Mtftp6ParseMcastOption(IN UINT8 *Str, IN MTFTP6_EXT_OPTION_INFO *ExtInfo)
EFI_STATUS Mtftp6ParseExtensionOption(IN EFI_MTFTP6_OPTION *Options, IN UINT32 Count, IN BOOLEAN IsRequest, IN UINT16 Operation, IN MTFTP6_EXT_OPTION_INFO *ExtInfo)
EFI_STATUS Mtftp6ParseStart(IN EFI_MTFTP6_PACKET *Packet, IN UINT32 PacketLen, IN OUT UINT32 *OptionCount, OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL)
EFI_STATUS EFIAPI NetLibAsciiStrToIp6(IN CONST CHAR8 *String, OUT EFI_IPv6_ADDRESS *Ip6Address)
UINT8 * ValueStr
Pointer to the null-terminated ASCII MTFTPv6 value string.
UINT8 * OptionStr
Pointer to the null-terminated ASCII MTFTPv6 option string.