Request limits from TKM on init
[strongswan.git] / src / charon-tkm / src / tkm / tkm.c
index ebff089..e913ddb 100644 (file)
@@ -46,6 +46,14 @@ bool tkm_init()
 {
        private_tkm_t *this;
 
+       active_requests_type max_requests;
+       nc_id_type nc;
+       dh_id_type dh;
+       cc_id_type cc;
+       ae_id_type ae;
+       isa_id_type isa;
+       esa_id_type esa;
+
        /* initialize TKM client library */
        tkmlib_init();
        if (ike_init(IKE_SOCKET) != TKM_OK)
@@ -60,6 +68,13 @@ bool tkm_init()
                return FALSE;
        }
 
+       /* get limits from tkm */
+       if (ike_tkm_limits(&max_requests, &nc, &dh, &cc, &ae, &isa, &esa) != TKM_OK)
+       {
+               tkmlib_final();
+               return FALSE;
+       }
+
        INIT(this,
                .public = {
                        .idmgr = tkm_id_manager_create(),