netlink-socket: Use read/write ioctl instead of ReadFile/WriteFile.
[cascardo/ovs.git] / datapath-windows / ovsext / OvsPacketIO.h
1 /*
2  * Copyright (c) 2014 VMware, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __OVS_PACKETIO_H_
18 #define __OVS_PACKETIO_H_ 1
19
20 typedef union _OVS_PACKET_HDR_INFO OVS_PACKET_HDR_INFO;
21
22 /*
23  * Data structures and utility functions to help manage a list of packets to be
24  * completed (dropped).
25  */
26 typedef struct OvsCompletionList {
27     PNET_BUFFER_LIST dropNbl;
28     PNET_BUFFER_LIST *dropNblNext;
29     POVS_SWITCH_CONTEXT switchContext;
30     ULONG sendCompleteFlags;
31 } OvsCompletionList;
32
33 VOID OvsInitCompletionList(OvsCompletionList *completionList,
34                            POVS_SWITCH_CONTEXT switchContext,
35                            ULONG sendCompleteFlags);
36 VOID OvsAddPktCompletionList(OvsCompletionList *completionList,
37                              BOOLEAN incoming,
38                              NDIS_SWITCH_PORT_ID sourcePort,
39                              PNET_BUFFER_LIST netBufferList,
40                              UINT32 netBufferListCount,
41                              PNDIS_STRING filterReason);
42
43
44 /*
45  * Functions related to packet processing.
46  */
47 VOID OvsSendNBLIngress(POVS_SWITCH_CONTEXT switchContext,
48                        PNET_BUFFER_LIST netBufferLists,
49                        ULONG sendFlags);
50
51 NDIS_STATUS OvsActionsExecute(POVS_SWITCH_CONTEXT switchContext,
52                             OvsCompletionList *completionList,
53                             PNET_BUFFER_LIST curNbl, UINT32 srcVportNo,
54                             ULONG sendFlags, OvsFlowKey *key, UINT64 *hash,
55                             OVS_PACKET_HDR_INFO *layers,
56                             const PNL_ATTR actions, int actionsLen);
57
58 VOID OvsLookupFlowOutput(POVS_SWITCH_CONTEXT switchContext,
59                          VOID *compList, PNET_BUFFER_LIST curNbl);
60
61 #endif /* __OVS_PACKETIO_H_ */