2021-06-10 22:02:00 +03:00
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
// SPDX-License-Identifier: MIT
|
2021-02-11 19:15:57 +03:00
|
|
|
|
2021-01-14 23:48:48 +03:00
|
|
|
/*++
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Header file for structures/prototypes of the driver.
|
|
|
|
|
|
|
|
|
|
|
|
Environment:
|
|
|
|
|
|
|
|
Kernel mode
|
|
|
|
|
|
|
|
--*/
|
|
|
|
|
2021-03-10 01:54:03 +03:00
|
|
|
#pragma once
|
2021-02-09 04:16:52 +03:00
|
|
|
|
2021-04-28 06:39:20 +03:00
|
|
|
#include <ntddk.h>
|
|
|
|
|
2021-09-14 00:46:43 +03:00
|
|
|
#define INITGUID
|
|
|
|
|
|
|
|
#include <fwpmk.h>
|
|
|
|
|
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable : 4201) // unnamed struct/union
|
|
|
|
#include <fwpsk.h>
|
|
|
|
#pragma warning(pop)
|
|
|
|
|
|
|
|
#include <guiddef.h>
|
|
|
|
#include <netiodef.h>
|
|
|
|
#include <ntddk.h>
|
|
|
|
|
|
|
|
#include "ebpf_ext_attach_provider.h"
|
|
|
|
#include "ebpf_nethooks.h"
|
|
|
|
#include "ebpf_platform.h"
|
|
|
|
#include "ebpf_program_types.h"
|
|
|
|
#include "ebpf_windows.h"
|
|
|
|
|
2021-09-14 03:46:23 +03:00
|
|
|
#include "net_ebpf_ext_program_info.h"
|
|
|
|
|
2021-09-14 00:46:43 +03:00
|
|
|
#define NET_EBPF_EXTENSION_NPI_PROVIDER_VERSION 0
|
|
|
|
|
2021-01-14 23:48:48 +03:00
|
|
|
//
|
2021-09-14 00:46:43 +03:00
|
|
|
// Shared function prototypes.
|
2021-01-14 23:48:48 +03:00
|
|
|
//
|
|
|
|
|
2021-04-28 06:39:20 +03:00
|
|
|
/**
|
|
|
|
* @brief Register for the WFP callouts used to power hooks.
|
|
|
|
*
|
|
|
|
* @param[in] device_object Device object used by this driver.
|
|
|
|
* @retval STATUS_SUCCESS Operation succeeded.
|
|
|
|
* @retval FWP_E_* A Windows Filtering Platform (WFP) specific error.
|
|
|
|
*/
|
2021-01-14 23:48:48 +03:00
|
|
|
NTSTATUS
|
2021-05-05 00:31:12 +03:00
|
|
|
net_ebpf_ext_register_callouts(_Inout_ void* device_object);
|
2021-01-14 23:48:48 +03:00
|
|
|
|
2021-04-28 06:39:20 +03:00
|
|
|
/**
|
|
|
|
* @brief Unregister the WFP callouts.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void
|
2021-05-05 00:31:12 +03:00
|
|
|
net_ebpf_ext_unregister_callouts(void);
|
2021-04-28 06:39:20 +03:00
|
|
|
|
|
|
|
/**
|
2021-09-14 00:46:43 +03:00
|
|
|
* @brief Register network extension NPI providers with eBPF core.
|
2021-04-28 06:39:20 +03:00
|
|
|
*
|
|
|
|
* @retval STATUS_SUCCESS Operation succeeded.
|
|
|
|
* @retval STATUS_UNSUCCESSFUL Operation failed.
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
2021-05-05 00:31:12 +03:00
|
|
|
net_ebpf_ext_register_providers();
|
2021-04-28 06:39:20 +03:00
|
|
|
|
|
|
|
/**
|
2021-09-14 00:46:43 +03:00
|
|
|
* @brief Unregister network extension NPI providers from eBPF core.
|
2021-05-04 01:17:10 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
void
|
2021-09-14 00:46:43 +03:00
|
|
|
net_ebpf_ext_unregister_providers();
|