199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifndef _EFI_IP_H
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _EFI_IP_H
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*++
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCopyright (c) 2013 Intel Corporation
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome--*/
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EFI_IP4_SERVICE_BINDING_PROTOCOL \
199767f8919635c4928607450d9e0abb932109ceToomas Soome {0xc51711e7,0xb4bf,0x404a,{0xbf,0xb8,0x0a,0x04, 0x8e,0xf1,0xff,0xe4}}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EFI_IP4_PROTOCOL \
199767f8919635c4928607450d9e0abb932109ceToomas Soome {0x41d94cd2,0x35b6,0x455a,{0x82,0x58,0xd4,0xe5,0x13,0x34,0xaa,0xdd}}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EFI_IP6_SERVICE_BINDING_PROTOCOL \
199767f8919635c4928607450d9e0abb932109ceToomas Soome {0xec835dd3,0xfe0f,0x617b,{0xa6,0x21,0xb3,0x50,0xc3,0xe1,0x33,0x88}}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EFI_IP6_PROTOCOL \
199767f8919635c4928607450d9e0abb932109ceToomas Soome {0x2c8759d5,0x5c2d,0x66ef,{0x92,0x5f,0xb6,0x6c,0x10,0x19,0x57,0xe2}}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeINTERFACE_DECL(_EFI_IP4);
199767f8919635c4928607450d9e0abb932109ceToomas SoomeINTERFACE_DECL(_EFI_IP6);
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_HANDLE InstanceHandle;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS Ip4Address;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS SubnetMask;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_ADDRESS_PAIR;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_HANDLE DriverHandle;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 AddressCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_ADDRESS_PAIR AddressPairs[1];
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_VARIABLE_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 DefaultProtocol;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN AcceptAnyProtocol;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN AcceptIcmpErrors;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN AcceptBroadcast;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN AcceptPromiscuous;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN UseDefaultAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS StationAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS SubnetMask;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TypeOfService;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TimeToLive;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN DoNotFragment;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN RawData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 ReceiveTimeout;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 TransmitTimeout;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_CONFIG_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS SubnetAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS SubnetMask;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS GatewayAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_ROUTE_TABLE;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Type;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Code;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_ICMP_TYPE;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN IsStarted;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 MaxPacketSize;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_CONFIG_DATA ConfigData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN IsConfigured;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 GroupCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS *GroupTable;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 RouteCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_ROUTE_TABLE *RouteTable;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 IcmpTypeCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_ICMP_TYPE *IcmpTypeList;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_MODE_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_GET_MODE_DATA) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
199767f8919635c4928607450d9e0abb932109ceToomas Soome OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
199767f8919635c4928607450d9e0abb932109ceToomas Soome OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_CONFIGURE) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP4_CONFIG_DATA *IpConfigData OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_GROUPS) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN BOOLEAN JoinFlag,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv4_ADDRESS *GroupAddress OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_ROUTES) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN BOOLEAN DeleteRoute,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv4_ADDRESS *SubnetAddress,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv4_ADDRESS *SubnetMask,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv4_ADDRESS *GatewayAddress
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#pragma pack(1)
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 HeaderLength:4;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Version:4;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TypeOfService;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT16 TotalLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT16 Identification;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT16 Fragmentation;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TimeToLive;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Protocol;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT16 Checksum;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS SourceAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS DestinationAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_HEADER;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#pragma pack()
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FragmentLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome VOID *FragmentBuffer;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_FRAGMENT_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_TIME TimeStamp;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_EVENT RecycleSignal;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 HeaderLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_HEADER *Header;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 OptionsLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome VOID *Options;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 DataLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FragmentCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_FRAGMENT_DATA FragmentTable[1];
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_RECEIVE_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS SourceAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS GatewayAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Protocol;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TypeOfService;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TimeToLive;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN DoNotFragment;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_OVERRIDE_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv4_ADDRESS DestinationAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_OVERRIDE_DATA *OverrideData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 OptionsLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome VOID *OptionsBuffer;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 TotalDataLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FragmentCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_FRAGMENT_DATA FragmentTable[1];
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_TRANSMIT_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_EVENT Event;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_STATUS Status;
199767f8919635c4928607450d9e0abb932109ceToomas Soome union {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_RECEIVE_DATA *RxData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_TRANSMIT_DATA *TxData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome } Packet;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4_COMPLETION_TOKEN;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_TRANSMIT) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP4_COMPLETION_TOKEN *Token
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_RECEIVE) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP4_COMPLETION_TOKEN *Token
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_CANCEL)(
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP4_COMPLETION_TOKEN *Token OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP4_POLL) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP4 *This
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct _EFI_IP4 {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_GET_MODE_DATA GetModeData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_CONFIGURE Configure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_GROUPS Groups;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_ROUTES Routes;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_TRANSMIT Transmit;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_RECEIVE Receive;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_CANCEL Cancel;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP4_POLL Poll;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP4;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 DefaultProtocol;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN AcceptAnyProtocol;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN AcceptIcmpErrors;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN AcceptPromiscuous;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS DestinationAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS StationAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TrafficClass;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 HopLimit;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FlowLabel;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 ReceiveTimeout;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 TransmitTimeout;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_CONFIG_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS Address;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 PrefixLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_ADDRESS_INFO;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS Gateway;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS Destination;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 PrefixLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_ROUTE_TABLE;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef enum {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EfiNeighborInComplete,
199767f8919635c4928607450d9e0abb932109ceToomas Soome EfiNeighborReachable,
199767f8919635c4928607450d9e0abb932109ceToomas Soome EfiNeighborStale,
199767f8919635c4928607450d9e0abb932109ceToomas Soome EfiNeighborDelay,
199767f8919635c4928607450d9e0abb932109ceToomas Soome EfiNeighborProbe
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_NEIGHBOR_STATE;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS Neighbor;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_MAC_ADDRESS LinkAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_NEIGHBOR_STATE State;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_NEIGHBOR_CACHE;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Type;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Code;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_ICMP_TYPE;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome// ICMPv6 type definitions for error messages
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_DEST_UNREACHABLE 0x1
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_PACKET_TOO_BIG 0x2
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_TIME_EXCEEDED 0x3
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_PARAMETER_PROBLEM 0x4
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome// ICMPv6 type definition for informational messages
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_ECHO_REQUEST 0x80
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_ECHO_REPLY 0x81
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_LISTENER_QUERY 0x82
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_LISTENER_REPORT 0x83
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_LISTENER_DONE 0x84
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_ROUTER_SOLICIT 0x85
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_ROUTER_ADVERTISE 0x86
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_NEIGHBOR_SOLICIT 0x87
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_NEIGHBOR_ADVERTISE 0x88
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_REDIRECT 0x89
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_LISTENER_REPORT_2 0x8F
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome// ICMPv6 code definitions for ICMP_V6_DEST_UNREACHABLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_NO_ROUTE_TO_DEST 0x0
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_COMM_PROHIBITED 0x1
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_BEYOND_SCOPE 0x2
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_ADDR_UNREACHABLE 0x3
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_PORT_UNREACHABLE 0x4
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_SOURCE_ADDR_FAILED 0x5
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_ROUTE_REJECTED 0x6
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome// ICMPv6 code definitions for ICMP_V6_TIME_EXCEEDED
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_TIMEOUT_HOP_LIMIT 0x0
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_TIMEOUT_REASSEMBLE 0x1
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome// ICMPv6 code definitions for ICMP_V6_PARAMETER_PROBLEM
199767f8919635c4928607450d9e0abb932109ceToomas Soome//***********************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_ERRONEOUS_HEADER 0x0
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_UNRECOGNIZE_NEXT_HDR 0x1
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ICMP_V6_UNRECOGNIZE_OPTION 0x2
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN IsStarted;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 MaxPacketSize;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_CONFIG_DATA ConfigData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome BOOLEAN IsConfigured;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 AddressCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_ADDRESS_INFO *AddressList;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 GroupCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS *GroupTable;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 RouteCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_ROUTE_TABLE *RouteTable;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 NeighborCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_NEIGHBOR_CACHE *NeighborCache;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 PrefixCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_ADDRESS_INFO *PrefixTable;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 IcmpTypeCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_ICMP_TYPE *IcmpTypeList;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_MODE_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_GET_MODE_DATA) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
199767f8919635c4928607450d9e0abb932109ceToomas Soome OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
199767f8919635c4928607450d9e0abb932109ceToomas Soome OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_CONFIGURE) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP6_CONFIG_DATA *Ip6ConfigData OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_GROUPS) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN BOOLEAN JoinFlag,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv6_ADDRESS *GroupAddress OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_ROUTES) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN BOOLEAN DeleteRoute,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN UINT8 PrefixLength,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_NEIGHBORS) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN BOOLEAN DeleteFlag,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IPv6_ADDRESS *TargetIp6Address,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN UINT32 Timeout,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN BOOLEAN Override
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct _EFI_IP6_FRAGMENT_DATA {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FragmentLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome VOID *FragmentBuffer;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_FRAGMENT_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct _EFI_IP6_OVERRIDE_DATA {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Protocol;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 HopLimit;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FlowLabel;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_OVERRIDE_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct _EFI_IP6_TRANSMIT_DATA {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS DestinationAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_OVERRIDE_DATA *OverrideData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 ExtHdrsLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome VOID *ExtHdrs;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 NextHeader;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 DataLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FragmentCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_FRAGMENT_DATA FragmentTable[1];
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_TRANSMIT_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#pragma pack(1)
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct _EFI_IP6_HEADER {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TrafficClassH:4;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 Version:4;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 FlowLabelH:4;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 TrafficClassL:4;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT16 FlowLabelL;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT16 PayloadLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 NextHeader;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT8 HopLimit;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS SourceAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IPv6_ADDRESS DestinationAddress;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_HEADER;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#pragma pack()
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct _EFI_IP6_RECEIVE_DATA {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_TIME TimeStamp;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_EVENT RecycleSignal;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 HeaderLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_HEADER *Header;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 DataLength;
199767f8919635c4928607450d9e0abb932109ceToomas Soome UINT32 FragmentCount;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_FRAGMENT_DATA FragmentTable[1];
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_RECEIVE_DATA;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_EVENT Event;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_STATUS Status;
199767f8919635c4928607450d9e0abb932109ceToomas Soome union {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_RECEIVE_DATA *RxData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_TRANSMIT_DATA *TxData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome } Packet;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6_COMPLETION_TOKEN;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_TRANSMIT) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP6_COMPLETION_TOKEN *Token
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_RECEIVE) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP6_COMPLETION_TOKEN *Token
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_CANCEL)(
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This,
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef
199767f8919635c4928607450d9e0abb932109ceToomas SoomeEFI_STATUS
199767f8919635c4928607450d9e0abb932109ceToomas Soome(EFIAPI *EFI_IP6_POLL) (
199767f8919635c4928607450d9e0abb932109ceToomas Soome IN struct _EFI_IP6 *This
199767f8919635c4928607450d9e0abb932109ceToomas Soome );
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct _EFI_IP6 {
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_GET_MODE_DATA GetModeData;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_CONFIGURE Configure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_GROUPS Groups;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_ROUTES Routes;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_NEIGHBORS Neighbors;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_TRANSMIT Transmit;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_RECEIVE Receive;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_CANCEL Cancel;
199767f8919635c4928607450d9e0abb932109ceToomas Soome EFI_IP6_POLL Poll;
199767f8919635c4928607450d9e0abb932109ceToomas Soome} EFI_IP6;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* _EFI_IP_H */