14#define IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH 32
24#define HTTP_PROGRESS_SLIDER_STEPS \
25 ((sizeof (HTTP_PROGR_FRAME) / sizeof (CHAR16)) - 3)
34#define HTTP_PROGRESS_MESSAGE_SIZE \
35 ((sizeof (HTTP_PROGR_FRAME) / sizeof (CHAR16)) + 12)
40#define DEFAULT_BUF_SIZE SIZE_32KB
41#define MAX_BUF_SIZE SIZE_4MB
43#define MIN_PARAM_COUNT 2
44#define MAX_PARAM_COUNT 4
45#define NEED_REDIRECTION(Code) \
46 (((Code >= HTTP_STATUS_300_MULTIPLE_CHOICES) \
47 && (Code <= HTTP_STATUS_307_TEMPORARY_REDIRECT)) \
48 || (Code == HTTP_STATUS_308_PERMANENT_REDIRECT))
50#define CLOSE_HTTP_HANDLE(ControllerHandle, HttpChildHandle) \
52 if (HttpChildHandle) { \
53 CloseProtocolAndDestroyServiceChild ( \
55 &gEfiHttpServiceBindingProtocolGuid, \
56 &gEfiHttpProtocolGuid, \
59 HttpChildHandle = NULL; \
70#define USER_AGENT_HDR "Mozilla/5.0 (EDK2; Linux) Gecko/20100101 Firefox/79.0"
72#define TIMER_MAX_TIMEOUT_S 10
77#define DEFAULT_HTML_FILE L"index.html"
78#define DEFAULT_HTTP_PROTO L"http"
84#define HTTP_PROGRESS_DEL \
85 L"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\
86\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
88#define HTTP_KB L"\b\b\b\b\b\b\b\b\b\b"
92#define HTTP_PROGR_FRAME L"[ ]"
97#define PRINT_HII(token, ...) \
99 -1, -1, NULL, token, mHttpHiiHandle, __VA_ARGS__)
101#define PRINT_HII_APP(token, value) \
102 PRINT_HII (token, HTTP_APP_NAME, value)
112#define EPOCH_JULIAN_DATE 2440588
117#define SEC_PER_MIN ((UINTN) 60)
118#define SEC_PER_HOUR ((UINTN) 3600)
119#define SEC_PER_DAY ((UINTN) 86400)
128 L
"402 Payment required",
131 L
"405 Method not allowed",
132 L
"406 Not acceptable",
133 L
"407 Proxy authentication required",
134 L
"408 Request time out",
137 L
"411 Length required",
138 L
"412 Precondition failed",
139 L
"413 Request entity too large",
140 L
"414 Request URI to large",
141 L
"415 Unsupported media type",
142 L
"416 Requested range not satisfied",
143 L
"417 Expectation failed",
144 L
"500 Internal server error",
145 L
"501 Not implemented",
147 L
"503 Service unavailable",
148 L
"504 Gateway timeout",
149 L
"505 HTTP version not supported"
311 ASSERT (String !=
NULL);
313 if (String ==
NULL) {
314 return EFI_INVALID_PARAMETER;
322 while (*Str == L
' ' || *Str == L
'\t') {
331 if (!Len || ((Str[Len - 1] != L
' ') && (Str[Len - 1] !=
'\t'))) {
335 Str[Len - 1] = CHAR_NULL;
362 gRequestCallbackComplete =
TRUE;
378 gResponseCallbackComplete =
TRUE;
411 a = (14 - Time->Month) / 12;
412 y = Time->Year + 4800 - a;
413 m = Time->Month + (12 * a) - 3;
415 JulianDate = Time->Day + ((153 * m + 2) / 5) + (365 * y) + (y / 4) -
416 (y / 100) + (y / 400) - 32045;
418 ASSERT (JulianDate >= EPOCH_JULIAN_DATE);
419 EpochDays = JulianDate - EPOCH_JULIAN_DATE;
445 EpochSeconds = (EpochDays * SEC_PER_DAY) +
446 ((
UINTN)Time->Hour * SEC_PER_HOUR) +
447 (Time->Minute * SEC_PER_MIN) + Time->Second;
482 CHAR16 *ProblemParam;
483 CHAR16 NicName[IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH];
486 CONST CHAR16 *UserNicName;
487 CONST CHAR16 *ValueStr;
488 CONST CHAR16 *RemoteFilePath;
489 CONST CHAR16 *Walker;
497 RemoteFilePath =
NULL;
508 if (EFI_ERROR (Status)) {
513 ZeroMem (&Context,
sizeof (Context));
524 if (EFI_ERROR (Status)) {
525 if ( (Status == EFI_VOLUME_CORRUPTED)
526 && (ProblemParam !=
NULL))
528 PRINT_HII_APP (
STRING_TOKEN (STR_GEN_PROBLEM), ProblemParam);
529 SHELL_FREE_NON_NULL (ProblemParam);
540 Status = EFI_INVALID_PARAMETER;
543 if (ParamCount > MAX_PARAM_COUNT) {
548 if (ParamCount < MIN_PARAM_COUNT) {
553 ZeroMem (&Context.HttpConfigData, sizeof (Context.HttpConfigData));
554 ZeroMem (&IPv4Node,
sizeof (IPv4Node));
557 Context.HttpConfigData.
HttpVersion = HttpVersion11;
558 Context.HttpConfigData.AccessPoint.
IPv4Node = &IPv4Node;
565 PRINT_HII_APP (
STRING_TOKEN (STR_GEN_PARAM_INV), ValueStr);
570 if (!
StrStr (ValueStr, L
"://")) {
572 &Context.ServerAddrAndProto,
575 StrLen (DEFAULT_HTTP_PROTO)
578 &Context.ServerAddrAndProto,
583 VStr = (CHAR16 *)ValueStr;
588 for (Walker1 = VStr; *Walker1; Walker1++) {
589 if (*Walker1 == L
'/') {
594 if (*Walker1 == L
'/') {
596 RemoteFilePath = Walker1;
600 &Context.ServerAddrAndProto,
605 if (!Context.ServerAddrAndProto) {
606 Status = EFI_OUT_OF_RESOURCES;
611 if (!RemoteFilePath) {
613 if (!RemoteFilePath) {
617 RemoteFilePath = L
"/";
623 if (ParamCount == MAX_PARAM_COUNT - ParamOffset) {
626 MAX_PARAM_COUNT - 1 - ParamOffset
629 Walker = RemoteFilePath +
StrLen (RemoteFilePath);
630 while ((--Walker) >= RemoteFilePath) {
631 if ((*Walker == L
'\\') ||
638 mLocalFilePath = Walker + 1;
641 if (!
StrLen (mLocalFilePath)) {
642 mLocalFilePath = DEFAULT_HTML_FILE;
653 Status = EFI_OUT_OF_RESOURCES;
663 if ( (ValueStr !=
NULL)
673 Context.BufferSize = DEFAULT_BUF_SIZE;
676 if (ValueStr !=
NULL) {
678 if (!Context.BufferSize || (Context.BufferSize > MAX_BUF_SIZE)) {
679 PRINT_HII_APP (
STRING_TOKEN (STR_GEN_PARAM_INV), ValueStr);
685 if (ValueStr !=
NULL) {
692 Status =
gBS->LocateHandleBuffer (
694 &gEfiManagedNetworkServiceBindingProtocolGuid,
699 if (EFI_ERROR (Status) || (HandleCount == 0)) {
701 if (!EFI_ERROR (Status)) {
702 Status = EFI_NOT_FOUND;
708 Status = EFI_NOT_FOUND;
712 Context.Flags |= DL_FLAG_TIME;
716 Context.Flags |= DL_FLAG_KEEP_BAD;
720 (NicNumber < HandleCount) && (Status !=
EFI_SUCCESS);
723 ControllerHandle = Handles[NicNumber];
725 Status =
GetNicName (ControllerHandle, NicNumber, NicName);
726 if (EFI_ERROR (Status)) {
727 PRINT_HII (
STRING_TOKEN (STR_HTTP_ERR_NIC_NAME), NicNumber, Status);
731 if (UserNicName !=
NULL) {
732 if (
StrCmp (NicName, UserNicName) != 0) {
733 Status = EFI_NOT_FOUND;
740 Status =
DownloadFile (&Context, ControllerHandle, NicName);
743 if (EFI_ERROR (Status)) {
754 if (Status == EFI_ABORTED) {
768 if ((UserNicName !=
NULL) && (!NicFound)) {
769 PRINT_HII (
STRING_TOKEN (STR_HTTP_ERR_NIC_NOT_FOUND), UserNicName);
774 SHELL_FREE_NON_NULL (Handles);
775 SHELL_FREE_NON_NULL (Context.ServerAddrAndProto);
776 SHELL_FREE_NON_NULL (Context.Uri);
778 return Status & ~MAX_BIT;
800 if (Val > MAX_UINT16) {
801 PRINT_HII_APP (
STRING_TOKEN (STR_GEN_PARAM_INV), ValueStr);
805 *Value = (UINT16)Val;
842 &gEfiManagedNetworkServiceBindingProtocolGuid,
843 &gEfiManagedNetworkProtocolGuid,
847 if (EFI_ERROR (Status)) {
851 Status = Mnp->GetModeData (Mnp,
NULL, &SnpMode);
852 if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
858 IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH,
859 SnpMode.
IfType == NET_IFTYPE_ETHERNET ? L
"eth%d" : L
"unk%d",
867 if (MnpHandle !=
NULL) {
870 &gEfiManagedNetworkServiceBindingProtocolGuid,
871 &gEfiManagedNetworkProtocolGuid,
914 ServiceBindingProtocolGuid,
917 if (!EFI_ERROR (Status)) {
918 Status =
gBS->OpenProtocol (
924 EFI_OPEN_PROTOCOL_GET_PROTOCOL
926 if (EFI_ERROR (Status)) {
930 ServiceBindingProtocolGuid,
970 ServiceBindingProtocolGuid,
991 IN OUT BOOLEAN *CallBackComplete
1002 Status =
gBS->CreateEvent (
1011 if (!EFI_ERROR (Status)) {
1012 Status =
gBS->SetTimer (
1021 while ( !*CallBackComplete
1022 && (!EFI_ERROR (Status))
1023 && EFI_ERROR (
gBS->CheckEvent (WaitEvt)))
1025 Status = Context->Http->Poll (Context->Http);
1026 if ( !Context->ContentDownloaded
1027 && (CallBackComplete == &gResponseCallbackComplete))
1036 if ( Context->ResponseToken.Message
1037 && Context->ResponseToken.Message->Data.Response
1038 && (NEED_REDIRECTION (
1039 Context->ResponseToken.Message->Data.Response->StatusCode
1049 gBS->CloseEvent (WaitEvt);
1051 if (*CallBackComplete) {
1055 if (!EFI_ERROR (Status)) {
1056 Status = EFI_TIMEOUT;
1080 IN CHAR16 *DownloadUrl
1090 ZeroMem (&RequestData,
sizeof (RequestData));
1091 ZeroMem (&RequestHeader,
sizeof (RequestHeader));
1092 ZeroMem (&RequestMessage,
sizeof (RequestMessage));
1093 ZeroMem (&Context->RequestToken, sizeof (Context->RequestToken));
1095 RequestHeader[HdrHost].
FieldName =
"Host";
1096 RequestHeader[HdrConn].
FieldName =
"Connection";
1097 RequestHeader[HdrAgent].
FieldName =
"User-Agent";
1099 Host = (CHAR16 *)Context->ServerAddrAndProto;
1100 while (*Host != CHAR_NULL && *Host != L
'/') {
1104 if (*Host == CHAR_NULL) {
1105 return EFI_INVALID_PARAMETER;
1117 StringSize =
StrLen (Host) + 1;
1119 if (!RequestHeader[HdrHost].FieldValue) {
1120 return EFI_OUT_OF_RESOURCES;
1125 RequestHeader[HdrHost].FieldValue,
1130 RequestHeader[HdrAgent].
FieldValue = USER_AGENT_HDR;
1133 RequestData.
Method = HttpMethodGet;
1134 RequestData.
Url = DownloadUrl;
1137 RequestMessage.
Headers = RequestHeader;
1140 Context->RequestToken.Event =
NULL;
1145 Status =
gBS->CreateEvent (
1150 &Context->RequestToken.Event
1155 Context->RequestToken.Message = &RequestMessage;
1156 gRequestCallbackComplete =
FALSE;
1157 Status = Context->Http->Request (Context->Http, &Context->RequestToken);
1158 if (EFI_ERROR (Status)) {
1163 if (EFI_ERROR (Status)) {
1164 Context->Http->Cancel (Context->Http, &Context->RequestToken);
1168 SHELL_FREE_NON_NULL (RequestHeader[HdrHost].FieldValue);
1169 if (Context->RequestToken.Event) {
1170 gBS->CloseEvent (Context->RequestToken.Event);
1171 ZeroMem (&Context->RequestToken, sizeof (Context->RequestToken));
1197 CHAR16 Progress[HTTP_PROGRESS_MESSAGE_SIZE];
1209 if (EFI_ERROR (Status)) {
1210 if (Context->ContentDownloaded > 0) {
1214 PRINT_HII (
STRING_TOKEN (STR_HTTP_ERR_WRITE), mLocalFilePath, Status);
1218 if (Context->ContentDownloaded == 0) {
1222 Context->ContentDownloaded += DownloadLen;
1223 NbOfKb = Context->ContentDownloaded >> 10;
1225 Progress[0] = L
'\0';
1226 if (Context->ContentLength) {
1227 LastStep = (Context->LastReportedNbOfBytes * HTTP_PROGRESS_SLIDER_STEPS) /
1228 Context->ContentLength;
1229 Step = (Context->ContentDownloaded * HTTP_PROGRESS_SLIDER_STEPS) /
1230 Context->ContentLength;
1233 Context->LastReportedNbOfBytes = Context->ContentDownloaded;
1235 if (Step <= LastStep) {
1236 if (!Context->ContentLength) {
1249 Status =
StrCpyS (Progress, HTTP_PROGRESS_MESSAGE_SIZE, HTTP_PROGR_FRAME);
1250 if (EFI_ERROR (Status)) {
1254 for (Index = 1; Index < Step; Index++) {
1255 Progress[Index] = L
'=';
1259 Progress[Step] = L
'>';
1263 Progress + (
sizeof (HTTP_PROGR_FRAME) /
sizeof (CHAR16)) - 1,
1264 sizeof (Progress) -
sizeof (HTTP_PROGR_FRAME),
1291 IN CHAR16 *DownloadUrl
1303 BOOLEAN IsAbEmptyUrl;
1307 IsAbEmptyUrl =
FALSE;
1310 StringSize = (
AsciiStrSize (Location) *
sizeof (CHAR16));
1313 return EFI_OUT_OF_RESOURCES;
1317 (
CONST CHAR8 *)Location,
1322 if (EFI_ERROR (Status)) {
1330 if (!
StrCmp (Url, DownloadUrl)) {
1331 Status = EFI_NO_MAPPING;
1339 IsAbEmptyUrl = (Location[0] ==
'/') && (Location[1] ==
'/');
1349 if (
AsciiStrStr (Location,
"://") || IsAbEmptyUrl) {
1353 for (Step = FirstStep; Step < 2; Step++) {
1354 for ( ; *Walker !=
'/' && *Walker !=
'\0'; Walker++) {
1369 Status = EFI_OUT_OF_RESOURCES;
1379 StringSize = (Idx + 1) *
sizeof (CHAR16);
1381 SHELL_FREE_NON_NULL (Context->ServerAddrAndProto);
1385 Status = EFI_OUT_OF_RESOURCES;
1394 if (EFI_ERROR (Status)) {
1395 SHELL_FREE_NON_NULL (Temp);
1402 &Context->ServerAddrAndProto,
1410 &Context->ServerAddrAndProto,
1415 SHELL_FREE_NON_NULL (Temp);
1416 if (!Context->ServerAddrAndProto) {
1417 Status = EFI_OUT_OF_RESOURCES;
1422 SHELL_FREE_NON_NULL (Context->Uri);
1424 StringSize =
AsciiStrSize (Location) *
sizeof (CHAR16);
1426 if (!Context->Uri) {
1427 Status = EFI_OUT_OF_RESOURCES;
1435 (
CONST CHAR8 *)Location,
1440 SHELL_FREE_NON_NULL (Tmp);
1441 SHELL_FREE_NON_NULL (Url);
1463 IN HTTP_BODY_PARSE_EVENT EventType,
1470 || (EventType == BodyParseEventOnComplete)
1471 || (Context ==
NULL))
1501 IN CHAR16 *DownloadUrl
1512 UINTN ElapsedSeconds;
1514 BOOLEAN CanMeasureTime;
1516 ZeroMem (&ResponseData,
sizeof (ResponseData));
1517 ZeroMem (&ResponseMessage,
sizeof (ResponseMessage));
1518 ZeroMem (&Context->ResponseToken, sizeof (Context->ResponseToken));
1521 ResponseMessage.
Body = Context->Buffer;
1523 Context->ResponseToken.Message = &ResponseMessage;
1524 Context->ContentLength = 0;
1525 Context->Status = REQ_OK;
1528 ResponseData.
StatusCode = HTTP_STATUS_UNSUPPORTED_STATUS;
1530 Context->ResponseToken.Event =
NULL;
1531 CanMeasureTime =
FALSE;
1532 if (Context->Flags & DL_FLAG_TIME) {
1533 ZeroMem (&StartTime,
sizeof (StartTime));
1534 CanMeasureTime = !EFI_ERROR (
gRT->GetTime (&StartTime,
NULL));
1538 SHELL_FREE_NON_NULL (ResponseMessage.
Headers);
1540 gResponseCallbackComplete =
FALSE;
1541 ResponseMessage.
BodyLength = Context->BufferSize;
1544 Status = EFI_ABORTED;
1548 if (!Context->ContentDownloaded && !Context->ResponseToken.Event) {
1549 Status =
gBS->CreateEvent (
1554 &Context->ResponseToken.Event
1561 if (EFI_ERROR (Status)) {
1565 Status = Context->Http->Response (Context->Http, &Context->ResponseToken);
1566 if (EFI_ERROR (Status)) {
1571 if (EFI_ERROR (Status) && ResponseMessage.
HeaderCount) {
1575 if (EFI_ERROR (Status)) {
1576 Context->Http->Cancel (Context->Http, &Context->ResponseToken);
1580 if (!Context->ContentDownloaded) {
1581 if (NEED_REDIRECTION (ResponseData.
StatusCode)) {
1585 Context->Status = REQ_NEED_REPEAT;
1593 Status =
SetHostURI (Header->FieldValue, Context, DownloadUrl);
1594 if (Status == EFI_NO_MAPPING) {
1597 Context->ServerAddrAndProto,
1598 L
"Recursive HTTP server relocation",
1607 Status = EFI_NOT_FOUND;
1610 Context->Http->Cancel (Context->Http, &Context->ResponseToken);
1627 if (EFI_ERROR (Status)) {
1640 IsTrunked = (Header && !
AsciiStrCmp (Header->FieldValue,
"chunked"));
1644 if ( (ResponseData.
StatusCode >= HTTP_STATUS_400_BAD_REQUEST)
1645 && (ResponseData.
StatusCode != HTTP_STATUS_308_PERMANENT_REDIRECT))
1654 Desc = ErrStatusDesc[ResponseData.
StatusCode -
1655 HTTP_STATUS_400_BAD_REQUEST];
1658 Context->ServerAddrAndProto,
1675 if (ResponseMessage.
BodyLength || IsTrunked) {
1679 ResponseMessage.
Body
1683 && !EFI_ERROR (Status)
1686 if ( (Context->Status != REQ_NEED_REPEAT)
1690 if (!EFI_ERROR (
gRT->GetTime (&EndTime,
NULL))) {
1694 ElapsedSeconds ?
" " :
" < ",
1695 ElapsedSeconds > 1 ? (UINT64)ElapsedSeconds : 1
1700 SHELL_FREE_NON_NULL (MsgParser);
1701 if (Context->ResponseToken.Event) {
1702 gBS->CloseEvent (Context->ResponseToken.Event);
1703 ZeroMem (&Context->ResponseToken, sizeof (Context->ResponseToken));
1734 CHAR16 *DownloadUrl;
1739 if (Context ==
NULL) {
1740 return EFI_INVALID_PARAMETER;
1744 HttpChildHandle =
NULL;
1747 if (Context->Buffer ==
NULL) {
1748 Status = EFI_OUT_OF_RESOURCES;
1762 EFI_FILE_MODE_CREATE |
1763 EFI_FILE_MODE_WRITE |
1767 if (EFI_ERROR (Status)) {
1768 PRINT_HII_APP (
STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), mLocalFilePath);
1773 SHELL_FREE_NON_NULL (DownloadUrl);
1775 CLOSE_HTTP_HANDLE (ControllerHandle, HttpChildHandle);
1779 &gEfiHttpServiceBindingProtocolGuid,
1780 &gEfiHttpProtocolGuid,
1782 (VOID **)&Context->Http
1785 if (EFI_ERROR (Status)) {
1786 PRINT_HII (
STRING_TOKEN (STR_HTTP_ERR_OPEN_PROTOCOL), NicName, Status);
1790 Status = Context->Http->Configure (Context->Http, &Context->HttpConfigData);
1791 if (EFI_ERROR (Status)) {
1792 PRINT_HII (
STRING_TOKEN (STR_HTTP_ERR_CONFIGURE), NicName, Status);
1800 Context->ServerAddrAndProto,
1801 StrLen (Context->ServerAddrAndProto)
1803 if (Context->Uri[0] != L
'/') {
1808 StrLen (Context->ServerAddrAndProto)
1818 if (DownloadUrl ==
NULL) {
1819 Status = EFI_OUT_OF_RESOURCES;
1823 PRINT_HII (
STRING_TOKEN (STR_HTTP_DOWNLOADING), DownloadUrl);
1835 }
while (Context->Status == REQ_NEED_REPEAT);
1837 if (Context->Status) {
1845 if (mFileHandle !=
NULL) {
1846 if (EFI_ERROR (Status) && !(Context->Flags & DL_FLAG_KEEP_BAD)) {
1853 SHELL_FREE_NON_NULL (DownloadUrl);
1854 SHELL_FREE_NON_NULL (Context->Buffer);
1856 CLOSE_HTTP_HANDLE (ControllerHandle, HttpChildHandle);
1880 Status =
gBS->OpenProtocol (
1882 &gEfiHiiPackageListProtocolGuid,
1883 (VOID **)&PackageList,
1886 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1889 if (EFI_ERROR (Status)) {
1903 if (EFI_ERROR (Status)) {
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
RETURN_STATUS EFIAPI UnicodeStrToAsciiStrS(IN CONST CHAR16 *Source, OUT CHAR8 *Destination, IN UINTN DestMax)
RETURN_STATUS EFIAPI AsciiStrToUnicodeStrS(IN CONST CHAR8 *Source, OUT CHAR16 *Destination, IN UINTN DestMax)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
CHAR8 *EFIAPI AsciiStrStr(IN CONST CHAR8 *String, IN CONST CHAR8 *SearchString)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
STATIC VOID CloseProtocolAndDestroyServiceChild(IN EFI_HANDLE ControllerHandle, IN EFI_GUID *ServiceBindingProtocolGuid, IN EFI_GUID *ProtocolGuid, IN EFI_HANDLE ChildHandle)
STATIC UINTN EFIAPI EfiTimeToEpoch(IN EFI_TIME *Time)
STATIC BOOLEAN StringToUint16(IN CONST CHAR16 *ValueStr, OUT UINT16 *Value)
STATIC EFI_STATUS DownloadFile(IN HTTP_DOWNLOAD_CONTEXT *Context, IN EFI_HANDLE ControllerHandle, IN CHAR16 *NicName)
STATIC EFI_STATUS GetResponse(IN HTTP_DOWNLOAD_CONTEXT *Context, IN CHAR16 *DownloadUrl)
STATIC EFI_STATUS WaitForCompletion(IN HTTP_DOWNLOAD_CONTEXT *Context, IN OUT BOOLEAN *CallBackComplete)
STATIC EFI_STATUS SendRequest(IN HTTP_DOWNLOAD_CONTEXT *Context, IN CHAR16 *DownloadUrl)
STATIC EFI_STATUS CreateServiceChildAndOpenProtocol(IN EFI_HANDLE ControllerHandle, IN EFI_GUID *ServiceBindingProtocolGuid, IN EFI_GUID *ProtocolGuid, OUT EFI_HANDLE *ChildHandle, OUT VOID **Interface)
STATIC VOID EFIAPI ResponseCallback(IN EFI_EVENT Event, IN VOID *Context)
STATIC EFI_STATUS GetNicName(IN EFI_HANDLE ControllerHandle, IN UINTN NicNumber, OUT CHAR16 *NicName)
STATIC EFI_STATUS TrimSpaces(IN CHAR16 *String)
STATIC EFI_STATUS SetHostURI(IN CHAR8 *Location, IN HTTP_DOWNLOAD_CONTEXT *Context, IN CHAR16 *DownloadUrl)
EFI_HII_HANDLE InitializeHiiPackage(IN EFI_HANDLE ImageHandle)
STATIC UINTN EfiGetEpochDays(IN EFI_TIME *Time)
STATIC VOID EFIAPI RequestCallback(IN EFI_EVENT Event, IN VOID *Context)
STATIC EFI_STATUS EFIAPI ParseMsg(IN HTTP_BODY_PARSE_EVENT EventType, IN CHAR8 *Data, IN UINTN Length, IN VOID *Context)
SHELL_STATUS RunHttp(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC EFI_STATUS EFIAPI SavePortion(IN HTTP_DOWNLOAD_CONTEXT *Context, IN UINTN DownloadLen, IN CHAR8 *Buffer)
EFI_STATUS EFIAPI HttpInitMsgParser(IN EFI_HTTP_METHOD Method, IN EFI_HTTP_STATUS_CODE StatusCode, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN HTTP_BODY_PARSER_CALLBACK Callback, IN VOID *Context, OUT VOID **MsgParser)
EFI_HTTP_HEADER *EFIAPI HttpFindHeader(IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN CHAR8 *FieldName)
EFI_STATUS EFIAPI HttpParseMessageBody(IN OUT VOID *MsgParser, IN UINTN BodyLength, IN CHAR8 *Body)
EFI_STATUS EFIAPI HttpGetEntityLength(IN VOID *MsgParser, OUT UINTN *ContentLength)
BOOLEAN EFIAPI HttpIsMessageComplete(IN VOID *MsgParser)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
#define ENCODE_ERROR(StatusCode)
#define ASSERT_EFI_ERROR(StatusParameter)
EFI_STATUS EFIAPI NetLibCreateServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN OUT EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI NetLibDestroyServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN EFI_HANDLE ChildHandle)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
CONST CHAR16 *EFIAPI ShellCommandLineGetValue(IN CONST LIST_ENTRY *CheckPackage, IN CHAR16 *KeyString)
EFI_STATUS EFIAPI ShellDeleteFile(IN SHELL_FILE_HANDLE *FileHandle)
UINTN EFIAPI ShellStrToUintn(IN CONST CHAR16 *String)
BOOLEAN EFIAPI ShellGetExecutionBreakFlag(VOID)
EFI_STATUS EFIAPI ShellDeleteFileByName(IN CONST CHAR16 *FileName)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
@ TypeFlag
A flag that is present or not present only (IE "-a").
EFI_STATUS EFIAPI ShellOpenFileByName(IN CONST CHAR16 *FileName, OUT SHELL_FILE_HANDLE *FileHandle, IN UINT64 OpenMode, IN UINT64 Attributes)
CHAR16 *EFIAPI StrnCatGrow(IN OUT CHAR16 **Destination, IN OUT UINTN *CurrentSize, IN CONST CHAR16 *Source, IN UINTN Count)
EFI_STATUS EFIAPI ShellFileExists(IN CONST CHAR16 *Name)
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
EFI_STATUS EFIAPI ShellSetFilePosition(IN SHELL_FILE_HANDLE FileHandle, IN UINT64 Position)
EFI_STATUS EFIAPI ShellPrintEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR16 *Format,...)
CONST CHAR16 *EFIAPI ShellCommandLineGetRawValue(IN CONST LIST_ENTRY *CONST CheckPackage, IN UINTN Position)
UINTN EFIAPI ShellCommandLineGetCount(IN CONST LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellWriteFile(IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI ShellCloseFile(IN SHELL_FILE_HANDLE *FileHandle)
EFI_HII_DATABASE_PROTOCOL * gHiiDatabase
#define EFI_TIMER_PERIOD_SECONDS(Seconds)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
EFI_HTTP_VERSION HttpVersion
EFI_HTTPv4_ACCESS_POINT * IPv4Node
EFI_HTTP_HEADER * Headers
union EFI_HTTP_MESSAGE::@577 Data
EFI_HTTP_RESPONSE_DATA * Response
EFI_HTTP_REQUEST_DATA * Request
EFI_HTTP_STATUS_CODE StatusCode
BOOLEAN UseDefaultAddress