PreviousNext

Nortel


Using the third-party API

The third-party API provides you with the ability to start, monitor and stop VPN tunnels under a C/C++ program's control.

In release 10.01, you can use API on Windows Vista 64-bit systems but only through a 32-bit application. Only release 10.01 supports this API and does not support previous versions of API.

The following tabl lists third-party API 32-bit and 64-bit files.

32-bit
64-bit
Description
NvcApi.h
NvcApi.h
Defines the functions of the .dll files
NvcApi32.lib
NvcApi64.lib
Library file
NvcApi32.dll
NvcApi64.dll
Contains the functions.

You can use the following work flow whenever you are working with a third-party API:

  1. Start a VPN tunnel with NVCStart (LPWSTR commandline).
  2. Monitor the tunnel by polling NVCTunnelStatus() while performing whatever other work is required.
  3. Stop the VPN tunnel with NVCStop().

Use the following information in the following table found in the NvcApi.h file to help you use the third-party API.

Function
Synopsis
Arguments
Returns
NVCStart (LPWSTR commandline)
Start a VPN tunnel using the nvc.exe client.
Long Pointer to Wide String (LPWSTR) commandline -A null-terminated string with the command line options for nvc.exe. Do not type the program name, for example, nvc.exe. Type only the command switches.
0 - Successfully started tunnel.
-1 - Error starting nvc.exe.
other - Error starting tunnel. Error code can be interpreted by NVCGetErrorString()
NVCStop ()
Stops the VPN tunnel.
None
-1 - NVC is not running.
0 - Success, stop command is issued.
NVCTunnelStatus ()
Returns the current status of the VPN tunnel.
None
-1 - NVC is not running.
0 - Tunnel is DOWN.
1 - Tunnel is UP.
NVCTunnelStats (NVC_TUNNELSTATS *statsBuffer)
Returns the tunnel current statistics.
statsBuffer - Points to a NVC_TUNNELSTATS structure that contains the current statistics.
The GetSystemTime() is the UTC time when the system collects statistics.
The total items are total numbers of bytes and errors the VPN driver processes from the VPN start time. (total for all tunnels).
The conn items are the totals for the latest tunnel connection. These items are mirrored in the Nortel VPN Client monitor.
0 - Success
other - A Microsoft Window's RPC_STATUS code.
NVCGetErrorString (int errorCode| LPWSTR errorString| DWORD len)
Converts an error code returned by NVCStart() to a readable string.
int errorCode - The error code returned by NVCStart().
LPWSTR errorString- A character buffer where the error string is written upon successfull completion of this call.
DWORD len - The length, in bytes, of the errorString buffer.
Positive value - Success with string length.
0 - String not available.


Nortel
http://www.nortel.com
PreviousNext