use countof()
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 1 Nov 2012 08:02:58 +0000 (09:02 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 1 Nov 2012 08:02:58 +0000 (09:02 +0100)
src/libimcv/plugins/imc_os/imc_os.c
src/libimcv/plugins/imc_scanner/imc_scanner.c
src/libimcv/plugins/imc_test/imc_test.c
src/libimcv/plugins/imv_os/imv_os.c
src/libimcv/plugins/imv_scanner/imv_scanner.c
src/libimcv/plugins/imv_test/imv_test.c
src/libpts/plugins/imc_attestation/imc_attestation.c
src/libpts/plugins/imv_attestation/imv_attestation.c

index 48bc6e2..e011c2b 100644 (file)
@@ -58,7 +58,8 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
                DBG1(DBG_IMC, "IMC \"%s\" has already been initialized", imc_name);
                return TNC_RESULT_ALREADY_INITIALIZED;
        }
-       imc_os = imc_agent_create(imc_name, msg_types, 1, imc_id, actual_version);
+       imc_os = imc_agent_create(imc_name, msg_types, countof(msg_types),
+                                                         imc_id, actual_version);
        if (!imc_os)
        {
                return TNC_RESULT_FATAL;
index 8e843a2..4ae3240 100644 (file)
@@ -52,7 +52,8 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
                DBG1(DBG_IMC, "IMC \"%s\" has already been initialized", imc_name);
                return TNC_RESULT_ALREADY_INITIALIZED;
        }
-       imc_scanner = imc_agent_create(imc_name, msg_types, 1, imc_id, actual_version);
+       imc_scanner = imc_agent_create(imc_name, msg_types, countof(msg_types),
+                                                                  imc_id, actual_version);
        if (!imc_scanner)
        {
                return TNC_RESULT_FATAL;
index 87efaff..c97d416 100644 (file)
@@ -50,7 +50,8 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
                DBG1(DBG_IMC, "IMC \"%s\" has already been initialized", imc_name);
                return TNC_RESULT_ALREADY_INITIALIZED;
        }
-       imc_test = imc_agent_create(imc_name, msg_types, 1, imc_id, actual_version);
+       imc_test = imc_agent_create(imc_name, msg_types, countof(msg_types),
+                                                               imc_id, actual_version);
        if (!imc_test)
        {
                return TNC_RESULT_FATAL;
index 2cb60ef..487c9a9 100644 (file)
@@ -60,7 +60,8 @@ TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id,
                DBG1(DBG_IMV, "IMV \"%s\" has already been initialized", imv_name);
                return TNC_RESULT_ALREADY_INITIALIZED;
        }
-       imv_os = imv_agent_create(imv_name, msg_types, 1, imv_id, actual_version);
+       imv_os = imv_agent_create(imv_name, msg_types, countof(msg_types),
+                                                         imv_id, actual_version);
        if (!imv_os)
        {
                return TNC_RESULT_FATAL;
index 96ad5c6..be35550 100644 (file)
@@ -126,7 +126,8 @@ TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id,
                DBG1(DBG_IMV, "IMV \"%s\" has already been initialized", imv_name);
                return TNC_RESULT_ALREADY_INITIALIZED;
        }
-       imv_scanner = imv_agent_create(imv_name, msg_types, 1, imv_id, actual_version);
+       imv_scanner = imv_agent_create(imv_name, msg_types, countof(msg_types),
+                                                                  imv_id, actual_version);
        if (!imv_scanner)
        {
                return TNC_RESULT_FATAL;
index 973edad..df45ce6 100644 (file)
@@ -52,7 +52,8 @@ TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id,
                DBG1(DBG_IMV, "IMV \"%s\" has already been initialized", imv_name);
                return TNC_RESULT_ALREADY_INITIALIZED;
        }
-       imv_test = imv_agent_create(imv_name, msg_types, 1, imv_id, actual_version);
+       imv_test = imv_agent_create(imv_name, msg_types, countof(msg_types),
+                                                               imv_id, actual_version);
        if (!imv_test)
        {
                return TNC_RESULT_FATAL;
index 5a3b91d..bb327e9 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <imc/imc_agent.h>
 #include <imc/imc_msg.h>
-#include <pa_tnc/pa_tnc_msg.h>
 #include <ietf/ietf_attr.h>
 #include <ietf/ietf_attr_pa_tnc_error.h>
 #include <ietf/ietf_attr_product_info.h>
@@ -77,8 +76,8 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
        {
                return TNC_RESULT_FATAL;
        }
-       imc_attestation = imc_agent_create(imc_name, msg_types, 1, imc_id,
-                                                                          actual_version);
+       imc_attestation = imc_agent_create(imc_name, msg_types, countof(msg_types),
+                                                                          imc_id, actual_version);
        if (!imc_attestation)
        {
                return TNC_RESULT_FATAL;
index 647faf4..9d36f2a 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <imv/imv_agent.h>
 #include <imv/imv_msg.h>
-#include <pa_tnc/pa_tnc_msg.h>
 #include <ietf/ietf_attr.h>
 #include <ietf/ietf_attr_pa_tnc_error.h>
 #include <ietf/ietf_attr_product_info.h>
@@ -96,8 +95,8 @@ TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id,
        {
                return TNC_RESULT_FATAL;
        }
-       imv_attestation = imv_agent_create(imv_name, msg_types, 2, imv_id,
-                                                                          actual_version);
+       imv_attestation = imv_agent_create(imv_name, msg_types, countof(msg_types),
+                                                                          imv_id, actual_version);
        if (!imv_attestation)
        {
                return TNC_RESULT_FATAL;