aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-11-08 00:29:44 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-11-09 20:43:50 +0100
commit8286b93af2fc4cd17f6e5e408ee4329e7134d763 (patch)
treee27a77b39967c5f9fa22f38ef3010e6259742b05 /src/libcharon
parenteefcf33c4c21251b368cf58f3d7d2a9116f7d298 (diff)
downloadstrongswan-8286b93af2fc4cd17f6e5e408ee4329e7134d763.tar.bz2
strongswan-8286b93af2fc4cd17f6e5e408ee4329e7134d763.tar.xz
insert IMV/IMC before providing BindFunction
Diffstat (limited to 'src/libcharon')
-rw-r--r--src/libcharon/plugins/tnc_imc/tnc_imc.c1
-rw-r--r--src/libcharon/plugins/tnc_imc/tnc_imc_manager.c5
-rw-r--r--src/libcharon/plugins/tnc_imv/tnc_imv.c1
-rw-r--r--src/libcharon/plugins/tnc_imv/tnc_imv_manager.c5
-rw-r--r--src/libcharon/tnc/imc/imc.h2
5 files changed, 9 insertions, 5 deletions
diff --git a/src/libcharon/plugins/tnc_imc/tnc_imc.c b/src/libcharon/plugins/tnc_imc/tnc_imc.c
index 7c1b7b5b2..7664b6142 100644
--- a/src/libcharon/plugins/tnc_imc/tnc_imc.c
+++ b/src/libcharon/plugins/tnc_imc/tnc_imc.c
@@ -88,6 +88,7 @@ METHOD(imc_t, set_message_types, void,
this->supported_types = malloc(size);
memcpy(this->supported_types, supported_types, size);
}
+ DBG2(DBG_TNC, "IMC %u supports %u message types", this->id, type_count);
}
METHOD(imc_t, type_supported, bool,
diff --git a/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c b/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c
index f1d0f2101..da10274f1 100644
--- a/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c
+++ b/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c
@@ -59,6 +59,9 @@ METHOD(imc_manager_t, add, bool,
imc->get_name(imc));
return FALSE;
}
+ this->imcs->insert_last(this->imcs, imc);
+ this->next_imc_id++;
+
if (imc->provide_bind_function(imc->get_id(imc), TNC_TNCC_BindFunction)
!= TNC_RESULT_SUCCESS)
{
@@ -66,8 +69,6 @@ METHOD(imc_manager_t, add, bool,
imc->get_name(imc));
return FALSE;
}
- this->imcs->insert_last(this->imcs, imc);
- this->next_imc_id++;
return TRUE;
}
diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv.c b/src/libcharon/plugins/tnc_imv/tnc_imv.c
index 2eca072bb..a685b91dd 100644
--- a/src/libcharon/plugins/tnc_imv/tnc_imv.c
+++ b/src/libcharon/plugins/tnc_imv/tnc_imv.c
@@ -88,6 +88,7 @@ METHOD(imv_t, set_message_types, void,
this->supported_types = malloc(size);
memcpy(this->supported_types, supported_types, size);
}
+ DBG2(DBG_TNC, "IMV %u supports %u message types", this->id, type_count);
}
METHOD(imv_t, type_supported, bool,
diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c b/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c
index 08bc09392..4beaccc07 100644
--- a/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c
+++ b/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c
@@ -59,6 +59,9 @@ METHOD(imv_manager_t, add, bool,
imv->get_name(imv));
return FALSE;
}
+ this->imvs->insert_last(this->imvs, imv);
+ this->next_imv_id++;
+
if (imv->provide_bind_function(imv->get_id(imv), TNC_TNCS_BindFunction)
!= TNC_RESULT_SUCCESS)
{
@@ -66,8 +69,6 @@ METHOD(imv_manager_t, add, bool,
imv->get_name(imv));
return FALSE;
}
- this->imvs->insert_last(this->imvs, imv);
- this->next_imv_id++;
return TRUE;
}
diff --git a/src/libcharon/tnc/imc/imc.h b/src/libcharon/tnc/imc/imc.h
index 8d3f4af94..affaadd8b 100644
--- a/src/libcharon/tnc/imc/imc.h
+++ b/src/libcharon/tnc/imc/imc.h
@@ -24,7 +24,7 @@
#include <tnc/tncifimc.h>
#include <library.h>
-/typedef struct imc_t imc_t;
+typedef struct imc_t imc_t;
/**
* Controls a single Integrity Measurement Collector (IMC)