summaryrefslogtreecommitdiff
path: root/EDK/Foundation/Protocol/Tcp/Tcp.h
blob: bfec1ccaeae3e297a4ff6ae2e44a16e9d21d47e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*++

Copyright (c) 2004, Intel Corporation                                                         
All rights reserved. This program and the accompanying materials                          
are licensed and made available under the terms and conditions of the BSD License         
which accompanies this distribution.  The full text of the license may be found at        
http://opensource.org/licenses/bsd-license.php                                            
                                                                                          
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             

Module Name:

    tcp.h

Abstract:

    EFI Transmission Control Protocol



Revision History

--*/


#ifndef _EFITCP_H
#define _EFITCP_H


#include EFI_PROTOCOL_DEFINITION(PxeBaseCode)

//
// PXE Base Code protocol
//

#define EFI_TCP_PROTOCOL_GUID \
    { 0x02b3d5f2, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }

EFI_FORWARD_DECLARATION (EFI_TCP_PROTOCOL);


typedef UINT16 EFI_PXE_BASE_CODE_TCP_PORT;

//
// Port Receive Filter definitions
//
#define EFI_PXE_BASE_CODE_MAX_PORTCNT             8
typedef struct {
    UINT8                       Filters;
    UINT8                       IpCnt;
    UINT16                      reserved;
    EFI_IP_ADDRESS              IpList[EFI_PXE_BASE_CODE_MAX_PORTCNT];
} EFI_TCP_PORT_FILTER;

typedef
EFI_STATUS
(EFIAPI *EFI_TCP_WRITE) (
    IN EFI_PXE_BASE_CODE_PROTOCOL        *This,
    IN UINT16                                    OpFlags,
    IN UINT16                                    *UrgentPointer,
    IN UINT32                                    *SequenceNumber,
    IN UINT32                                    *AckNumber,
    IN UINT16                                    *HlenResCode,
    IN UINT16                                    *Window,
    IN EFI_IP_ADDRESS                            *DestIp,
    IN UINT16                                    *DestPort,
    IN EFI_IP_ADDRESS                            *GatewayIp,  OPTIONAL
    IN EFI_IP_ADDRESS                            *SrcIp,      OPTIONAL
    IN UINT16                                    *SrcPort,    OPTIONAL
    IN UINTN                                     *HeaderSize, OPTIONAL
    IN VOID                                      *HeaderPtr,  OPTIONAL
    IN UINTN                                     *BufferSize,
    IN VOID                                      *BufferPtr
    );

typedef
EFI_STATUS
(EFIAPI *EFI_TCP_READ) (
    IN EFI_PXE_BASE_CODE_PROTOCOL        *This,
    IN UINT16                                    OpFlags,
    IN OUT EFI_IP_ADDRESS                        *DestIp,      OPTIONAL
    IN OUT UINT16                                *DestPort,    OPTIONAL
    IN OUT EFI_IP_ADDRESS                        *SrcIp,       OPTIONAL
    IN OUT UINT16                                *SrcPort,     OPTIONAL
    IN UINTN                                     *HeaderSize,  OPTIONAL
    IN VOID                                      *HeaderPtr,   OPTIONAL
    IN OUT UINTN                                 *BufferSize,
    IN VOID                                      *BufferPtr
    );

typedef
EFI_STATUS
(EFIAPI *EFI_TCP_SET_PORT_FILTER) (
    IN EFI_PXE_BASE_CODE_PROTOCOL    *This,
    IN EFI_TCP_PORT_FILTER                   *NewFilter
    );

//
// TCP Protocol structure
//
typedef struct _EFI_TCP_PROTOCOL {
    EFI_TCP_WRITE             TcpWrite;
    EFI_TCP_READ              TcpRead;
    EFI_TCP_SET_PORT_FILTER   SetPortFilter;
} EFI_TCP_PROTOCOL;

extern EFI_GUID gEfiTcpProtocolGuid;

#endif /* _EFITCP_H */