Looking For API To Start VPN Connection With Java

Unanswered Question
Jul 14th, 2006
User Badges:

I am looking for a Cisco API that will allow me to programatically initiate a VPN connection through the Cisco software. I have the software and am able to use the Cisco user interface to create a VPN. Now, I want to be able to write a Java program that will do the same.


I am looking to have my Java program create the VPN connection - through the Cisco software. Then another program will be able to transfer it's data to the main data center. I need my own program to initiate the VPN connection because this will be done unmanned on a regular, scheduled, basis.


Thoughts?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
edward.fultz Thu, 07/27/2006 - 10:38
User Badges:

I have the API and have been working on building a Java JNI process. I have the Java parts working but I seem to be having a problem with the C++ program that will call the Cisco API. I am getting the following link errors when I do the following code. This has to be something simple. If I comment the setProfile statement the program compiles and links fine. I am assuming I need some link setting that I am just missing.


Ed


============source code==========================

const char *pProfile = env->GetStringUTFChars(strProfile, &iscopy);

connect.setProfile(pProfile);


===============Link errors =========================

msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string,class std::allocator >::_Copy(unsigned int)" (?_Copy@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@[email protected])

already defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string,class std::allocator >::_Tidy(bool)" (?_Tidy@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@[email protected]) alread

y defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_string@

DU?$char_traits@[email protected]@@[email protected]@2@@std@@[email protected]) already defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::assign(class s

td::basic_string,class std::allocator > const &,unsigned int,unsigned int)" (?assign@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@QAEAAV12@[email protected]@Z) already defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::assign(char co

nst *,unsigned int)" (?assign@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@[email protected]@Z) already defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string,class std::allocator >::_Eos(unsigned int)" (?_Eos@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@[email protected]) a

lready defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: bool __thiscall std::basic_string,class std::allocator >::_Grow(unsigned int,bool)" (?_Grow@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@AAE

[email protected]) already defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::erase(unsigned

int,unsigned int)" (?erase@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@[email protected]@Z) already defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string,class std::allocator >::_Split(void)" (?_Split@?$[email protected]?$char_traits@[email protected]@@[email protected]@2@@std@@AAEXXZ) alread

y defined in NativeVPNChannel.obj


edward.fultz Thu, 07/27/2006 - 11:45
User Badges:

After further research it seems this is something to do with linking a static library with a dynamic library. I am trying to create a DLL that can be used more than one time with the parameters passed in. I assume this is not compatible with the API? The only example is an executable that calls the API. Surely there must be a way to have my DLL call the Cisco API without getting link errors? As mentioned before, if I remove the setprofile statement and only have a connect it works fine - no link errors. So what is unique about the setProfile method?


This is very frustrating since it feels I am so close.

Actions

This Discussion