enabled adding and deleting ca information records
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 14 Feb 2007 01:02:09 +0000 (01:02 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 14 Feb 2007 01:02:09 +0000 (01:02 -0000)
src/starter/starter.c
src/starter/starterstroke.c
src/starter/starterstroke.h

index 25ee9c7..339e698 100644 (file)
@@ -346,11 +346,15 @@ int main (int argc, char **argv)
                {
                    if (ca->state == STATE_ADDED)
                    {
                {
                    if (ca->state == STATE_ADDED)
                    {
+                       if (starter_charon_pid())
+                       {
+                           starter_stroke_del_ca(ca);
+                       }
                        if (starter_pluto_pid())
                        {
                            starter_whack_del_ca(ca);
                        if (starter_pluto_pid())
                        {
                            starter_whack_del_ca(ca);
-                           ca->state = STATE_TO_ADD;
                        }
                        }
+                       ca->state = STATE_TO_ADD;
                    }
                }
            }
                    }
                }
            }
@@ -539,11 +543,15 @@ int main (int argc, char **argv)
            {
                if (ca->state == STATE_TO_ADD)
                {
            {
                if (ca->state == STATE_TO_ADD)
                {
+                   if (starter_charon_pid())
+                   {
+                       starter_stroke_add_ca(ca);
+                   }
                    if (starter_pluto_pid())
                    {
                        starter_whack_add_ca(ca);
                    if (starter_pluto_pid())
                    {
                        starter_whack_add_ca(ca);
-                       ca->state = STATE_ADDED;
                    }
                    }
+                   ca->state = STATE_ADDED;
                }
            }
 
                }
            }
 
index 47e7348..a1987cb 100644 (file)
@@ -262,3 +262,29 @@ int starter_stroke_initiate_conn(starter_conn_t *conn)
        msg.initiate.name = push_string(&msg, connection_name(conn));
        return send_stroke_msg(&msg);
 }
        msg.initiate.name = push_string(&msg, connection_name(conn));
        return send_stroke_msg(&msg);
 }
+
+int starter_stroke_add_ca(starter_ca_t *ca)
+{
+       stroke_msg_t msg;
+
+       msg.type = STR_ADD_CA;
+       msg.length = offsetof(stroke_msg_t, buffer);
+       msg.add_ca.name =    push_string(&msg, ca->name);
+       msg.add_ca.cacert =  push_string(&msg, ca->cacert);
+       msg.add_ca.crluri =  push_string(&msg, ca->crluri);
+       msg.add_ca.crluri2 = push_string(&msg, ca->crluri2);
+       msg.add_ca.ocspuri = push_string(&msg, ca->ocspuri);
+       return send_stroke_msg(&msg);
+}
+
+int starter_stroke_del_ca(starter_ca_t *ca)
+{
+       stroke_msg_t msg;
+
+       msg.type = STR_DEL_CA;
+       msg.length = offsetof(stroke_msg_t, buffer);
+       msg.del_ca.name = push_string(&msg, ca->name);
+       return send_stroke_msg(&msg);
+}
+
+
index 10fc8b8..95c3709 100644 (file)
@@ -23,5 +23,7 @@ extern int starter_stroke_add_conn(starter_conn_t *conn);
 extern int starter_stroke_del_conn(starter_conn_t *conn);
 extern int starter_stroke_route_conn(starter_conn_t *conn);
 extern int starter_stroke_initiate_conn(starter_conn_t *conn);
 extern int starter_stroke_del_conn(starter_conn_t *conn);
 extern int starter_stroke_route_conn(starter_conn_t *conn);
 extern int starter_stroke_initiate_conn(starter_conn_t *conn);
+extern int starter_stroke_add_ca(starter_ca_t *ca);
+extern int starter_stroke_del_ca(starter_ca_t *ca);
 
 #endif /* _STARTER_STROKE_H_ */
 
 #endif /* _STARTER_STROKE_H_ */