Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Looking For API To Start VPN Connection With Java

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?

3 REPLIES
Anonymous
N/A

Re: Looking For API To Start VPN Connection With Java

Community Member

Re: Looking For API To Start VPN Connection With Java

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@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z)

already defined in NativeVPNChannel.obj

msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string,class std::allocator >::_Tidy(bool)" (?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z) 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@D@std@@V?$allocator@D@2@@std@@QAE@XZ) 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@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@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@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@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@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z) 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@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE

_NI_N@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 >::erase(unsigned

int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in NativeVPNChannel.obj

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

y defined in NativeVPNChannel.obj

Community Member

Re: Looking For API To Start VPN Connection With Java

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.

1893
Views
0
Helpful
3
Replies
CreatePlease to create content