tfPresharedKeyDelete

Jump to: navigation, search

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


#include <trsocket.h>


int tfPresharedKeyDelete (
char TM_FAR * idPtr,
int options
);


Function Description

Deletes the pre-shared key for peer idPtr. After the deleting, it is no longer able to negotiate with peer idPtr using pre-shared key authentication.


Parameters

  • idPtr
    Pointer to the identity of the IKE peer, with which we are going to use the preshared key. The idPtr should be string format of an IPv4 address, IPv6 address, a domain name or a username.
  • keyDataPtr
    Pointer to the pre-shared key null-ended string. Although pre-shared key is not necessarily ASCII string, there is no obvious disadvantage to use ASCII string to be pre-shared key.
  • options
    Not currently used


Returns

  • TM_ENOERROR
    Success.
  • -1
    The Identification showed in idPtr is not found in the pre-shared key database


Example This example deletes the pre-shared key for peer "2.2.2.1"

 
{
    ...
    errorCode = tfPresharedKeyDelete ("2.2.2.1", 0);
    ... 
}
 

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