support for transport in create_child_sa
authorMartin Willi <martin@strongswan.org>
Mon, 8 Jan 2007 06:55:50 +0000 (06:55 -0000)
committerMartin Willi <martin@strongswan.org>
Mon, 8 Jan 2007 06:55:50 +0000 (06:55 -0000)
include TRANSPORT/TUNNEL information in statusall

src/charon/config/policies/policy.c
src/charon/config/policies/policy.h
src/charon/sa/child_sa.c
src/charon/sa/transactions/create_child_sa.c

index f7e2eb4..34bd151 100644 (file)
@@ -38,6 +38,14 @@ ENUM(dpd_action_names, DPD_NONE, DPD_RESTART,
        "DPD_RESTART"
 );
 
+ENUM(mode_names, MODE_TRANSPORT, MODE_BEET,
+       "TRANSPORT",
+       "TUNNEL",
+       "2",
+       "3",
+       "BEET"
+);
+
 typedef struct private_policy_t private_policy_t;
 
 /**
index 76b20f6..123383c 100644 (file)
@@ -53,6 +53,11 @@ enum dpd_action_t {
 };
 
 /**
+ * enum names for dpd_action_t.
+ */
+extern enum_name_t *dpd_action_names;
+
+/**
  * @brief Mode of an IPsec SA.
  *
  * These are equal to those defined in XFRM, so don't change.
@@ -69,9 +74,9 @@ enum mode_t {
 };
 
 /**
- * enum names for dpd_action_t.
+ * enum names for mode_t.
  */
-extern enum_name_t *dpd_action_names;
+extern enum_name_t *mode_names;
 
 /**
  * @brief A policy_t defines the policies to apply to CHILD_SAs.
index 874937d..182da86 100644 (file)
@@ -780,8 +780,9 @@ static int print(FILE *stream, const struct printf_info *info,
        
        now = (u_int32_t)time(NULL);
        
-       written += fprintf(stream, "%12s:  %N, reqid: %d", this->name,
-                                          child_sa_state_names, this->state, this->reqid);
+       written += fprintf(stream, "%12s:  %N, reqid: %d, %N", this->name,
+                                          child_sa_state_names, this->state, this->reqid,
+                                          mode_names, this->mode);
        
        if (this->state == CHILD_INSTALLED)
        {
index c07347d..bcb3ced 100644 (file)
@@ -509,11 +509,13 @@ static status_t install_child_sa(private_create_child_sa_t *this, bool initiator
        
        if (initiator)
        {
-               status = this->child_sa->update(this->child_sa, this->proposal, 1, prf_plus);
+               status = this->child_sa->update(this->child_sa, this->proposal,
+                                                                               this->mode, prf_plus);
        }
        else
        {
-               status = this->child_sa->add(this->child_sa, this->proposal, 1, prf_plus);
+               status = this->child_sa->add(this->child_sa, this->proposal,
+                                                                        this->mode, prf_plus);
        }
        prf_plus->destroy(prf_plus);
        if (status != SUCCESS)
@@ -522,11 +524,13 @@ static status_t install_child_sa(private_create_child_sa_t *this, bool initiator
        }
        if (initiator)
        {
-               status = this->child_sa->add_policies(this->child_sa, this->tsi, this->tsr, 1);
+               status = this->child_sa->add_policies(this->child_sa, this->tsi,
+                                                                                         this->tsr, this->mode);
        }
        else
        {
-               status = this->child_sa->add_policies(this->child_sa, this->tsr, this->tsi, 1);
+               status = this->child_sa->add_policies(this->child_sa, this->tsr,
+                                                                                         this->tsi, this->mode);
        }
        if (status != SUCCESS)
        {