use OS type on IMV side
[strongswan.git] / src / libimcv / os_info / os_info.h
index 6a477ca..6946b1e 100644 (file)
 #define OS_INFO_H_
 
 typedef struct os_info_t os_info_t;
+typedef enum os_type_t os_type_t;
 typedef enum os_fwd_status_t os_fwd_status_t;
 
 #include <library.h>
 
 #include <time.h>
 
+enum os_type_t {
+       OS_TYPE_UNKNOWN,
+       OS_TYPE_DEBIAN,
+       OS_TYPE_UBUNTU,
+       OS_TYPE_FEDORA,
+       OS_TYPE_REDHAT,
+       OS_TYPE_CENTOS,
+       OS_TYPE_SUSE,
+       OS_TYPE_GENTOO,
+       OS_TYPE_ANDROID,
+       OS_TYPE_ROOF
+};
+
+extern enum_name_t *os_type_names;
+
 /**
  * Defines the IPv4 forwarding status
  */
@@ -45,6 +61,13 @@ extern enum_name_t *os_fwd_status_names;
 struct os_info_t {
 
        /**
+        * Get the OS type if it can be determined
+        *
+        * @return                                      OS type
+        */
+       os_type_t (*get_type)(os_info_t *this);
+
+       /**
         * Get the OS product name or distribution
         *
         * @return                                      OS name
@@ -103,6 +126,14 @@ struct os_info_t {
 };
 
 /**
+ * Convert an OS name into an OS enumeration type
+ *
+ * @param name                         OS name
+ * @return                                     OS enumeration type
+ */
+os_type_t os_type_from_name(chunk_t name);
+
+/**
  * Create an os_info_t object
  */
 os_info_t* os_info_create(void);