tfPolicySetOptions

Jump to: navigation, search

Table of Contents >> IPsec/IKE Programmer's Reference >> IPsec/IKE Function Reference


#include <trsocket.h>


int tfPolicySetOptions (
ttPolicyEntryPtr plcyPtr,
ttUser32Bit option,
ttUser8Bit value
);


Function Description

Similar to tfIpsecSetOptions(), except this function sets an IPsec option for a specific policy. Options are described below.



Parameters

  • plcyPtr
    Pointer to the IPsec policy on which to set the option.
  • option
    The policy option to set (see the table below).
  • value
    The value to set.


IPsec policy options
Option Description
TM_IPSEC_PLCYOPT_ONLY_WHEN_REQD Control policy strictness. By default, IPsec policies enforce strict adherence on any peer that matches the policy selector. Set a non-zero value for this option if you want the policy to be used only when a peer requires IPsec (by initiating IKE). If this option is set, the IPsec policy will be bypassed in all other cases. This option allows a Treck application to communicate with IPsec and non-IPsec peers whose IP addresses are not known in advance.

Note: This feature must also be enabled globally by defining TM_IPSEC_ONLY_WHEN_REQUIRED in trsystem.h and calling tfIpsecSetOptions() to set option TM_IPSECOPT_ONLY_WHEN_REQUIRED.


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    The option was not valid or the policy entry pointer was NULL.


Table of Contents >> IPsec/IKE Programmer's Reference >> IPsec/IKE Function Reference