NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg
Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
This commit is contained in:
2084
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c
Normal file
2084
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c
Normal file
File diff suppressed because it is too large
Load Diff
85
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.h
Normal file
85
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/** @file
|
||||
Header file for HttpLib.
|
||||
|
||||
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _DXE_HTTP_LIB_H_
|
||||
#define _DXE_HTTP_LIB_H_
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <Library/NetLib.h>
|
||||
#include <Library/HttpLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <IndustryStandard/Http11.h>
|
||||
#include <Protocol/HttpUtilities.h>
|
||||
|
||||
#define BIT(x) (1 << x)
|
||||
|
||||
#define HTTP_VERSION_CRLF_STR " HTTP/1.1\r\n"
|
||||
#define EMPTY_SPACE " "
|
||||
|
||||
#define NET_IS_HEX_CHAR(Ch) \
|
||||
((('0' <= (Ch)) && ((Ch) <= '9')) || \
|
||||
(('A' <= (Ch)) && ((Ch) <= 'F')) || \
|
||||
(('a' <= (Ch)) && ((Ch) <= 'f')))
|
||||
|
||||
//
|
||||
// Field index of the HTTP URL parse result.
|
||||
//
|
||||
#define HTTP_URI_FIELD_SCHEME 0
|
||||
#define HTTP_URI_FIELD_AUTHORITY 1
|
||||
#define HTTP_URI_FIELD_PATH 2
|
||||
#define HTTP_URI_FIELD_QUERY 3
|
||||
#define HTTP_URI_FIELD_FRAGMENT 4
|
||||
#define HTTP_URI_FIELD_USERINFO 5
|
||||
#define HTTP_URI_FIELD_HOST 6
|
||||
#define HTTP_URI_FIELD_PORT 7
|
||||
#define HTTP_URI_FIELD_MAX 8
|
||||
|
||||
#define HTTP_URI_PORT_MAX_NUM 65535
|
||||
|
||||
//
|
||||
// Structure to store the parse result of a HTTP URL.
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 Offset;
|
||||
UINT32 Length;
|
||||
} HTTP_URL_FILED_DATA;
|
||||
|
||||
typedef struct {
|
||||
UINT16 FieldBitMap;
|
||||
HTTP_URL_FILED_DATA FieldData[HTTP_URI_FIELD_MAX];
|
||||
} HTTP_URL_PARSER;
|
||||
|
||||
typedef enum {
|
||||
UrlParserUrlStart,
|
||||
UrlParserScheme,
|
||||
UrlParserSchemeColon, // ":"
|
||||
UrlParserSchemeColonSlash, // ":/"
|
||||
UrlParserSchemeColonSlashSlash, // "://"
|
||||
UrlParserAuthority,
|
||||
UrlParserAtInAuthority,
|
||||
UrlParserPath,
|
||||
UrlParserQueryStart, // "?"
|
||||
UrlParserQuery,
|
||||
UrlParserFragmentStart, // "#"
|
||||
UrlParserFragment,
|
||||
UrlParserUserInfo,
|
||||
UrlParserHostStart, // "@"
|
||||
UrlParserHost,
|
||||
UrlParserHostIpv6, // "["(Ipv6 address) "]"
|
||||
UrlParserPortStart, // ":"
|
||||
UrlParserPort,
|
||||
UrlParserStateMax
|
||||
} HTTP_URL_PARSE_STATE;
|
||||
|
||||
#endif
|
||||
|
42
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf
Normal file
42
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf
Normal file
@@ -0,0 +1,42 @@
|
||||
## @file
|
||||
# It provides the helper routines to parse the HTTP message byte stream.
|
||||
#
|
||||
# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = DxeHttpLib
|
||||
MODULE_UNI_FILE = DxeHttpLib.uni
|
||||
FILE_GUID = ABBAB4CD-EA88-45b9-8234-C8A7450531FC
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = HttpLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 EBC
|
||||
#
|
||||
|
||||
[Sources]
|
||||
DxeHttpLib.c
|
||||
DxeHttpLib.h
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
DebugLib
|
||||
UefiBootServicesTableLib
|
||||
MemoryAllocationLib
|
||||
NetLib
|
||||
|
||||
[Protocols]
|
||||
gEfiHttpUtilitiesProtocolGuid ## SOMETIMES_CONSUMES
|
16
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.uni
Normal file
16
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.uni
Normal file
@@ -0,0 +1,16 @@
|
||||
// /** @file
|
||||
// Provides the helper routines for HTTP.
|
||||
//
|
||||
// This library instance provides the helper routines to parse the HTTP message byte stream.
|
||||
//
|
||||
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
//
|
||||
// **/
|
||||
|
||||
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Provides the helper routines for HTTP"
|
||||
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "This library instance provides the helper routines to parse the HTTP message byte stream."
|
||||
|
Reference in New Issue
Block a user