improved control when an attribute request is sent
[strongswan.git] / src / libimcv / plugins / imv_os / imv_os_state.h
index 65bbee0..d3e3191 100644 (file)
 #include <library.h>
 
 typedef struct imv_os_state_t imv_os_state_t;
+typedef enum os_settings_t os_settings_t;
+
+enum os_settings_t {
+       OS_SETTINGS_FWD_ENABLED =         1,
+       OS_SETTINGS_DEFAULT_PWD_ENABLED = 2,
+       OS_SETTINGS_NON_MARKET_APPS =     4
+};
 
 /**
  * Internal state of an imv_os_t connection instance
@@ -62,22 +69,39 @@ struct imv_os_state_t {
        /**
         * Set [or with multiple attributes increment] package counters
         *
-        * @param count                 Number of processed packages
-        * @param count_bad             Number of blacklisted or not updated packages
-        * @param count_ok              Number of whitelisted packages
+        * @param count                         Number of processed packages
+        * @param count_update          Number of not updated packages
+        * @param count_blacklist       Number of blacklisted packages
+        * @param count_ok                      Number of whitelisted packages
         */
-       void (*set_count)(imv_os_state_t *this, int count, int count_bad,
-                                         int count_ok);
+       void (*set_count)(imv_os_state_t *this, int count, int count_update,
+                                         int count_blacklist, int count_ok);
 
        /**
         * Set [or with multiple attributes increment] package counters
         *
-        * @param count                 Number of processed packages
-        * @param count_bad             Number of blacklisted or not updated packages
-        * @param count_ok              Number of whitelisted packages
+        * @param count                         Number of processed packages
+        * @param count_update          Number of not updated packages
+        * @param count_blacklist       Number of blacklisted packages
+        * @param count_ok                      Number of whitelisted packages
         */
-       void (*get_count)(imv_os_state_t *this, int *count, int *count_bad,
-                                         int *count_ok);
+       void (*get_count)(imv_os_state_t *this, int *count, int *count_update,
+                                         int *count_blacklist, int *count_ok);
+
+       /**
+        * Set/reset attribute request status
+        *
+        * @param set                   TRUE to set, FALSE to clear
+        */
+       void (*set_attribute_request)(imv_os_state_t *this, bool set);
+
+       /**
+        * Get attribute request status
+        *
+        * @return                              TRUE if set, FALSE if unset
+        */
+       bool (*get_attribute_request)(imv_os_state_t *this);
+
        /**
         * Set/reset OS Installed Packages request status
         *
@@ -93,6 +117,34 @@ struct imv_os_state_t {
        bool (*get_package_request)(imv_os_state_t *this);
 
        /**
+        * Set device ID
+        *
+        * @param device_id             Device ID primary database key
+        */
+       void (*set_device_id)(imv_os_state_t *this, int id);
+
+       /**
+        * Get device ID
+        *
+        * @return                              Device ID primary database key
+        */
+       int (*get_device_id)(imv_os_state_t *this);
+
+       /**
+        * Set OS settings
+        *
+        * @param settings              OS settings
+        */
+       void (*set_os_settings)(imv_os_state_t *this, u_int settings);
+
+       /**
+        * Get OS settings
+        *
+        * @return                              OS settings
+        */
+       u_int (*get_os_settings)(imv_os_state_t *this);
+
+       /**
         * Increase/Decrease the ITA Angel count
         *
         * @param start                 TRUE increases and FALSE decreases count by one
@@ -106,6 +158,15 @@ struct imv_os_state_t {
         */
        int (*get_angel_count)(imv_os_state_t *this);
 
+       /**
+        * Store a bad package that has to be updated or removed
+        *
+        * @param package               Name of software package
+        * @param package_state Security state of software package
+        */
+       void (*add_bad_package)(imv_os_state_t *this, char *package,
+                                                       os_package_state_t package_state);
+
 };
 
 /**