Project

General

Profile

Issue #2810

davici

Added by M Thotager almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
vici
Affected version:
5.7.1
Resolution:
No change required

Description

Hi Team,

I'm trying to integrate the davici api(s) into my application , getting the below error (syslog).

charon-systemd[1599]: vici client 2 invalid request: load-conns

Here is my sample code , could you please let me know if any issue with the below code.

    assert(davici_new_cmd("load-conns", &req) >= 0);

    davici_section_start(req, "rw");

    davici_kvf(req, "version", "%s", "2");

    davici_list_start(req,"proposals");    
    davici_kvf(req,"%s","aes128-sha256-x25519");
    davici_list_end(req);

    davici_list_start(req, "local_addrs");
    davici_list_itemf(req, "%s", "10.13.199.185");
        davici_list_end(req);

    davici_list_start(req, "remote_addrs");
    davici_list_itemf(req, "%s", "10.13.199.190");
        davici_list_end(req);

    davici_section_start(req, "local");
    davici_kvf(req,"auth","%s","psk");
    davici_kvf(req,"id","%s","peer.strongswan.org");
    davici_section_end(req);

    davici_section_start(req,"remote");
    davici_kvf(req,"auth","%s","psk");  
    davici_kvf(req,"id","%s","gateway.strongswan.org");  
    davici_section_end(req);

    davici_section_start(req,"children");
    davici_section_start(req,"net");

    davici_list_start(req,"local_ts");    
    davici_list_itemf(req,"%s","10.1.0.0/16"); 
    davici_list_end(req);

    davici_list_start(req,"remote_ts");    
    davici_list_itemf(req,"%s","10.2.0.0/16"); 
    davici_list_end(req);

    davici_list_start(req,"esp_proposals");    
    davici_list_itemf(req,"%s","aes128gcm128-x25519");
    davici_list_end(req);

    davici_section_end(req); 
    davici_section_end(req); 
    davici_section_end(req); 

    err=davici_queue(c, req, cb, t);

Thanks,

History

#1 Updated by M Thotager almost 2 years ago

"load-conns" is the issue, changed to "load-conn" and it is fine now.

#2 Updated by Tobias Brunner almost 2 years ago

  • Description updated (diff)
  • Category set to vici
  • Status changed from New to Closed
  • Resolution set to No change required

The commands provided by swanctl (if that was perhaps your reference) don't really match those of the vici protocol. So make sure to refer to the README.md that documents the actual protocol.

Also available in: Atom PDF