Share via


FwpmIPsecTunnelAdd0 (Compact 7)

3/12/2014

This function adds a new IPsec tunnel mode policy to the system.

Syntax

DWORD WINAPI FwpmIpsecTunnelAdd0(
  __in      HANDLE engineHandle,
  __in      UINT32 flags,
  __in_opt  const FWPM_PROVIDER_CONTEXT0* mainModePolicy,
  __in      const FWPM_PROVIDER_CONTEXT0* tunnelPolicy,
  __in      UINT32 numFilterConditions,
  __in      const FWPM_FILTER_CONDITION0* filterConditions,
  __in_opt  PSECURITY_DESCRIPTOR sd
);

Parameters

  • engineHandle
    A handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
  • flags
    When the flag value is equal to FWPM_TUNNEL_FLAG_POINT_TO_POINT, then it adds a point-to-point tunnel to the system.
  • mainModePolicy
    Constant pointer to a FWPM_PROVIDER_CONTEXT0 structure that contains the Main Mode policy for the IPsec tunnel.
  • tunnelPolicy
    Constant pointer to a FWPM_PROVIDER_CONTEXT0 structure that contains the Quick Mode policy for the IPsec tunnel.
  • numFilterConditions
    Number of filter conditions present in the filterConditions parameter.
  • filterConditions
    Array of filter conditions that describe the traffic which should be tunneled by IPsec.
  • sd
    A pointer to a SECURITY_DESCRIPTOR structure.

Return Value

Return code / value Description

ERROR_SUCCESS

0

The IPsec tunnel mode policy was successfully added.

FWP_E_INVALID_PARAMETER

0x80320035

FWPM_TUNNEL_FLAG_POINT_TO_POINT was not set and conditions other than local/remote address were specified.

FWP_E_* error code

0x80320001-0x80320039

A Windows Filtering Platform (WFP) specific error. See topic WFP Error Codes for details.

RPC_* error code

0x80010001-0x80010122

Failure to communicate with the remote or local firewall engine.

Remarks

This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN.

Requirements

Header

fwpmu.h

Library

fwpuclnt.dll

See Also

Reference

WFP IPsec Functions

Other Resources

Windows Filtering Platform