forked from microsoft/ebpf-for-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
net_ebpf_ext_sock_addr.h
154 lines (137 loc) · 3.62 KB
/
net_ebpf_ext_sock_addr.h
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Copyright (c) eBPF for Windows contributors
// SPDX-License-Identifier: MIT
#pragma once
#include "net_ebpf_ext.h"
// Callout and sublayer GUIDs
// 98849e0b-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_ALE_AUTH_CONNECT_V4_CALLOUT, 0x98849e0b, 0xb07d, 0x11ec, 0x9a, 0x30, 0x18, 0x60, 0x24, 0x89, 0xbe, 0xee);
// 98849e0c-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_ALE_AUTH_RECV_ACCEPT_V4_CALLOUT,
0x98849e0c,
0xb07d,
0x11ec,
0x9a,
0x30,
0x18,
0x60,
0x24,
0x89,
0xbe,
0xee);
// 98849e0d-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_ALE_AUTH_CONNECT_V6_CALLOUT, 0x98849e0d, 0xb07d, 0x11ec, 0x9a, 0x30, 0x18, 0x60, 0x24, 0x89, 0xbe, 0xee);
// 98849e0e-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_ALE_AUTH_RECV_ACCEPT_V6_CALLOUT,
0x98849e0e,
0xb07d,
0x11ec,
0x9a,
0x30,
0x18,
0x60,
0x24,
0x89,
0xbe,
0xee);
// 98849e0f-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_ALE_CONNECT_REDIRECT_V4_CALLOUT,
0x98849e0f,
0xb07d,
0x11ec,
0x9a,
0x30,
0x18,
0x60,
0x24,
0x89,
0xbe,
0xee);
// 98849e10-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_ALE_CONNECT_REDIRECT_V6_CALLOUT,
0x98849e10,
0xb07d,
0x11ec,
0x9a,
0x30,
0x18,
0x60,
0x24,
0x89,
0xbe,
0xee);
// 98849e11-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_ALE_CONNECT_REDIRECT_PROVIDER,
0x98849e11,
0xb07d,
0x11ec,
0x9a,
0x30,
0x18,
0x60,
0x24,
0x89,
0xbe,
0xee);
// 98849e12-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_CGROUP_CONNECT_V4_SUBLAYER, 0x98849e12, 0xb07d, 0x11ec, 0x9a, 0x30, 0x18, 0x60, 0x24, 0x89, 0xbe, 0xee);
// 98849e13-b07d-11ec-9a30-18602489beee
DEFINE_GUID(
EBPF_HOOK_CGROUP_CONNECT_V6_SUBLAYER, 0x98849e13, 0xb07d, 0x11ec, 0x9a, 0x30, 0x18, 0x60, 0x24, 0x89, 0xbe, 0xee);
/**
* @brief WFP classifyFn callback for EBPF_HOOK_ALE_AUTH_RECV_ACCEPT_V4/6_CALLOUT.
*/
void
net_ebpf_extension_sock_addr_authorize_recv_accept_classify(
_In_ const FWPS_INCOMING_VALUES* incoming_fixed_values,
_In_ const FWPS_INCOMING_METADATA_VALUES* incoming_metadata_values,
_Inout_opt_ void* layer_data,
_In_opt_ const void* classify_context,
_In_ const FWPS_FILTER* filter,
uint64_t flow_context,
_Inout_ FWPS_CLASSIFY_OUT* classify_output);
/**
* @brief WFP classifyFn callback for EBPF_HOOK_ALE_AUTH_CONNECT_V4/6_CALLOUT
*/
void
net_ebpf_extension_sock_addr_authorize_connection_classify(
_In_ const FWPS_INCOMING_VALUES* incoming_fixed_values,
_In_ const FWPS_INCOMING_METADATA_VALUES* incoming_metadata_values,
_Inout_opt_ void* layer_data,
_In_opt_ const void* classify_context,
_In_ const FWPS_FILTER* filter,
uint64_t flow_context,
_Inout_ FWPS_CLASSIFY_OUT* classify_output);
/**
* @brief WFP classifyFn callback for EBPF_HOOK_ALE_CONNECT_REDIRECT_V4/6_CALLOUT
*/
void
net_ebpf_extension_sock_addr_redirect_connection_classify(
_In_ const FWPS_INCOMING_VALUES* incoming_fixed_values,
_In_ const FWPS_INCOMING_METADATA_VALUES* incoming_metadata_values,
_Inout_opt_ void* layer_data,
_In_opt_ const void* classify_context,
_In_ const FWPS_FILTER* filter,
uint64_t flow_context,
_Inout_ FWPS_CLASSIFY_OUT* classify_output);
/**
* @brief Unregister CGROUP_SOCK_ADDR NPI providers.
*
*/
void
net_ebpf_ext_sock_addr_unregister_providers();
/**
* @brief Register CGROUP_SOCK_ADDR NPI providers.
*
* @retval STATUS_SUCCESS Operation succeeded.
* @retval STATUS_UNSUCCESSFUL Operation failed.
*/
NTSTATUS
net_ebpf_ext_sock_addr_register_providers();