Cisco Support Community

How to connect and disconnect the VPN Client driver without the launch of the VPN Client GUI


The ApiConnect class can be used to initiate a VPN connection.There are required and optional authentication attributes which can be set.  After these attributes are set as desired, the connection is initiated with the use of the \ref ApiConnect::connect method. Once the connect action is initiated, the optional attributes, which can possibly be required as part of subsequent authentication, are requested from this class by the VPN service.The API connect functionality supports the setting of these additional authentication credentials

There are three methods available to set these values.The credential, for example, UserName, can remain unset. If it is required for authentication, an authentication callback requests it. This callback calls the virtual method \ref ApiConnect::getUserString. It is expected that a client program replaces this method.  If it does not, the prompt for this authentication attribute appears on stdout with the a read from stdin to accept input.  The method which prompts for the authentication attribute also delivers any saved value which can be present.

The second method to set an authentication attribute is to use the provided setter found in the \ref ApiConnect class.  When the authentication callback is called, the value is used to set the desired attribute.

The third method to set an attribute is to have the software use the already saved value. Use the attribute setter and pass the string ApiConnect::DEFAULT in order to do this.

Note: The required parameters are needed prior to the attea connection. The paramaters are Profile, Group and Group password. If any of these are not set, the connect method which is the API call used to initiate the VPN connection returns false.

Download the file for VPN Client C++ API, Code sample, API documentation from Software Download Windows VPN Clients.

In order to access the provided documentation, point your browser at html/index.html.

In order to run the example programs, open a DOS prompt or terminal window and execute them from the command line.

Note: The VPN Client C++ API is for VPN client versions 4.6.x and later only.