From eeb9affb239f86f22ff0f4967391bf9d7aecc0e0 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sun, 10 Jan 2021 01:34:36 -0800 Subject: [PATCH] Add service_binding proto and the http proto which uses it, and related types --- protos.yaml | 27 ++++++++++++++++++++++++++ uefi/types.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/protos.yaml b/protos.yaml index a73d6d2..cd86ba9 100644 --- a/protos.yaml +++ b/protos.yaml @@ -226,3 +226,30 @@ type: uint64_t - name: file_name[] type: wchar_t + +- name: service_binding + methods: + - name: create_child + args: + - name: child_handle + type: uefi::handle * + - name: destroy_child + args: + - name: child_handle + type: uefi::handle + +- name: http + guid: "0x7a59b29b,0x910b,0x4171,{0x82,0x42,0xa8,0x5a,0x0d,0xf2,0x5b,0x5b}" + bindings: + - name: service_binding + guid: "0xbdc8e6af,0xd9bc,0x4379,{0xa7,0x2a,0xe0,0xc4,0xe7,0x5d,0xae,0x1c}" + methods: + - name: get_mode_data + args: + - name: http_config_data + type: uefi::http_config_data * + - name: configure + - name: request + - name: cancel + - name: response + - name: poll diff --git a/uefi/types.h b/uefi/types.h index 3e37595..b1a4300 100644 --- a/uefi/types.h +++ b/uefi/types.h @@ -152,6 +152,60 @@ enum class file_attr : uint64_t archive = 0x0000000000000020ull }; +// +// IP definitions +// +struct ipv4_address +{ + uint8_t addr[4]; +}; + +struct ipv6_address +{ + uint8_t addr[16]; +}; + +union ip_address +{ + uint8_t addr[4]; + ipv4_address v4; + ipv6_address v6; +}; + +// +// HTTP definitions +// +struct httpv4_access_point +{ + bool use_default_address; + ipv4_address local_address; + ipv4_address local_subnet; + uint16_t local_port; +}; + +struct httpv6_access_point +{ + ipv6_address local_address; + uint16_t local_port; +}; + +enum class http_version : int { + v10, + v11, + unsupported, +}; + +struct http_config_data +{ + http_version http_version; + uint32_t time_out_millisec; + bool local_address_is_ipv6; + union { + httpv4_access_point *ipv4_node; + httpv6_access_point *ipv6_node; + } access_point; +}; + } // namespace uefi #endif