pcapif: add option PCAPIF_RX_READONLY to simulate readonly RX

This uses VirtualAlloc/VirtualProtect on windows to simulate RX buffers
that are readonly to lwIP (see task #14807).

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Simon Goldschmidt
2020-02-16 20:43:33 +01:00
parent ea9726056c
commit 04cf6bbe66
3 changed files with 72 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
#ifndef LWIP_PCAPIF_HELPER_H
#define LWIP_PCAPIF_HELPER_H
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -17,6 +19,8 @@ struct pcapifh_linkstate* pcapifh_linkstate_init(char *adapter_name);
enum pcapifh_link_event pcapifh_linkstate_get(struct pcapifh_linkstate* state);
void pcapifh_linkstate_close(struct pcapifh_linkstate* state);
void *pcapifh_alloc_readonly_copy(void *data, size_t len);
void pcapifh_free_readonly_mem(void *data);
#ifdef __cplusplus
}