implemented IETF Operational Status attribute
[strongswan.git] / src / libimcv / plugins / imv_os / imv_os.c
index 655d1bf..b085b85 100644 (file)
@@ -22,6 +22,7 @@
 #include <ietf/ietf_attr_default_pwd_enabled.h>
 #include <ietf/ietf_attr_fwd_enabled.h>
 #include <ietf/ietf_attr_installed_packages.h>
+#include <ietf/ietf_attr_op_status.h>
 #include <ietf/ietf_attr_pa_tnc_error.h>
 #include <ietf/ietf_attr_product_info.h>
 #include <ietf/ietf_attr_string_version.h>
@@ -181,6 +182,22 @@ static TNC_Result receive_message(TNC_IMVID imv_id,
                                }
                                break;
                        }
+                       case IETF_ATTR_OPERATIONAL_STATUS:
+                       {
+                               ietf_attr_op_status_t *attr_cast;
+                               op_status_t op_status;
+                               op_result_t op_result;
+                               time_t last_boot;
+
+                               attr_cast = (ietf_attr_op_status_t*)attr;
+                               op_status = attr_cast->get_status(attr_cast);
+                               op_result = attr_cast->get_result(attr_cast);
+                               last_boot = attr_cast->get_last_use(attr_cast);
+                               DBG1(DBG_IMV, "operational status: %N, result: %N",
+                                        op_status_names, op_status, op_result_names, op_result);
+                               DBG1(DBG_IMV, "last boot: %T", &last_boot, TRUE);
+                               break;
+                       }
                        case IETF_ATTR_FORWARDING_ENABLED:
                        {
                                ietf_attr_fwd_enabled_t *attr_cast;
@@ -364,6 +381,7 @@ TNC_Result TNC_IMV_BatchEnding(TNC_IMVID imv_id,
                                                                                         IETF_ATTR_PRODUCT_INFORMATION);
                attr_cast = (ietf_attr_attr_request_t*)attr;
                attr_cast->add(attr_cast, PEN_IETF, IETF_ATTR_STRING_VERSION);
+               attr_cast->add(attr_cast, PEN_IETF, IETF_ATTR_OPERATIONAL_STATUS);
                attr_cast->add(attr_cast, PEN_IETF, IETF_ATTR_FORWARDING_ENABLED);
                attr_cast->add(attr_cast, PEN_IETF, IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED);
                attr_list->insert_last(attr_list, attr);