kernel-wfp: Fix/Complete some fwpuclnt functionality in MinGW
While MinGW declares all the required symbols, some of them are missing in the library files. We provide missing variables locally, functions get a stub that call the GetProcAddress()ed function from the DLL. Also some MinGW headers define some enum values incorrectly, we overload these using defines.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Martin Willi
|
||||
* Copyright (C) 2013 revosec AG
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup kernel_wfp_compat kernel_wfp_compat
|
||||
* @{ @ingroup kernel_wfp
|
||||
*/
|
||||
|
||||
#ifndef KERNEL_WFP_COMPAT_H_
|
||||
#define KERNEL_WFP_COMPAT_H_
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <ipsectypes.h>
|
||||
|
||||
/* MinGW defines CIPHERs incorrectly starting at 0 */
|
||||
#define IPSEC_CIPHER_TYPE_DES 1
|
||||
#define IPSEC_CIPHER_TYPE_3DES 2
|
||||
#define IPSEC_CIPHER_TYPE_AES_128 3
|
||||
#define IPSEC_CIPHER_TYPE_AES_192 4
|
||||
#define IPSEC_CIPHER_TYPE_AES_256 5
|
||||
#define IPSEC_CIPHER_TYPE_MAX 6
|
||||
|
||||
#include <fwpmtypes.h>
|
||||
#include <fwpmu.h>
|
||||
#undef interface
|
||||
|
||||
/* MinGW defines TRANSFORMs incorrectly starting at 0 */
|
||||
#define IPSEC_TRANSFORM_AH 1
|
||||
#define IPSEC_TRANSFORM_ESP_AUTH 2
|
||||
#define IPSEC_TRANSFORM_ESP_CIPHER 3
|
||||
#define IPSEC_TRANSFORM_ESP_AUTH_AND_CIPHER 4
|
||||
#define IPSEC_TRANSFORM_ESP_AUTH_FW 5
|
||||
#define IPSEC_TRANSFORM_TYPE_MAX 6
|
||||
|
||||
#endif /** KERNEL_WFP_COMPAT_H_ @}*/
|
||||
Reference in New Issue
Block a user