created libpts
[strongswan.git] / src / libimcv / pa_tnc / pa_tnc_attr.c
index 07a821c..c927e23 100644 (file)
 #include "ietf/ietf_attr.h"
 #include "ietf/ietf_attr_pa_tnc_error.h"
 #include "ietf/ietf_attr_port_filter.h"
+#include "ietf/ietf_attr_product_info.h"
+
+#ifdef USE_PTS
 #include "tcg/tcg_attr.h"
-#include "tcg/tcg_pts_attr_req_proto_caps.h"
 #include "tcg/tcg_pts_attr_proto_caps.h"
 #include "tcg/tcg_pts_attr_meas_algo.h"
 #include "tcg/tcg_pts_attr_get_tpm_version_info.h"
 #include "tcg/tcg_pts_attr_simple_evid_final.h"
 #include "tcg/tcg_pts_attr_req_file_meas.h"
 #include "tcg/tcg_pts_attr_file_meas.h"
+#endif /* USE_PTS */
+
+#include "ita/ita_attr.h"
 #include "ita/ita_attr_command.h"
 
 /**
  * See header
  */
-pa_tnc_attr_t* pa_tnc_attr_create_create_from_data(pen_t vendor_id, u_int32_t type,
+pa_tnc_attr_t* pa_tnc_attr_create_from_data(pen_t vendor_id, u_int32_t type,
                                                                                        chunk_t value)
 {
        switch (vendor_id)
@@ -48,9 +53,10 @@ pa_tnc_attr_t* pa_tnc_attr_create_create_from_data(pen_t vendor_id, u_int32_t ty
                                        return ietf_attr_port_filter_create_from_data(value);
                                case IETF_ATTR_PA_TNC_ERROR:
                                        return ietf_attr_pa_tnc_error_create_from_data(value);
+                               case IETF_ATTR_PRODUCT_INFORMATION:
+                                       return ietf_attr_product_info_create_from_data(value);
                                case IETF_ATTR_TESTING:
                                case IETF_ATTR_ATTRIBUTE_REQUEST:
-                               case IETF_ATTR_PRODUCT_INFORMATION:
                                case IETF_ATTR_NUMERIC_VERSION:
                                case IETF_ATTR_STRING_VERSION:
                                case IETF_ATTR_OPERATIONAL_STATUS:
@@ -64,13 +70,14 @@ pa_tnc_attr_t* pa_tnc_attr_create_create_from_data(pen_t vendor_id, u_int32_t ty
                                        break;
                        }
                        break;
+#ifdef USE_PTS
                case PEN_TCG:
                        switch (type)
                        {
                                case TCG_PTS_REQ_PROTO_CAPS:
-                                       return tcg_pts_attr_req_proto_caps_create_from_data(value);
+                                       return tcg_pts_attr_proto_caps_create_from_data(value, TRUE);
                                case TCG_PTS_PROTO_CAPS:
-                                       return tcg_pts_attr_proto_caps_create_from_data(value);
+                                       return tcg_pts_attr_proto_caps_create_from_data(value, FALSE);
                                case TCG_PTS_MEAS_ALGO:
                                        return tcg_pts_attr_meas_algo_create_from_data(value, FALSE);
                                case TCG_PTS_MEAS_ALGO_SELECTION:
@@ -114,6 +121,7 @@ pa_tnc_attr_t* pa_tnc_attr_create_create_from_data(pen_t vendor_id, u_int32_t ty
                                        break;
                        }
                        break;
+#endif /* HAVE _PTS */
                case PEN_ITA:
                        switch (type)
                        {