Annotation of embedaddon/strongswan/src/libimcv/imc/imc_os_info.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2012-2015 Andreas Steffen
                      3:  * HSR Hochschule fuer Technik Rapperswil
                      4:  *
                      5:  * This program is free software; you can redistribute it and/or modify it
                      6:  * under the terms of the GNU General Public License as published by the
                      7:  * Free Software Foundation; either version 2 of the License, or (at your
                      8:  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
                      9:  *
                     10:  * This program is distributed in the hope that it will be useful, but
                     11:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
                     12:  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
                     13:  * for more details.
                     14:  */
                     15: 
                     16: /**
                     17:  * @defgroup imc_os_info imc_os_info
                     18:  * @{ @ingroup libimcv_imc
                     19:  */
                     20: 
                     21: #ifndef IMC_OS_INFO_H_
                     22: #define IMC_OS_INFO_H_
                     23: 
                     24: typedef struct imc_os_info_t imc_os_info_t;
                     25: 
                     26: #include "os_info/os_info.h"
                     27: 
                     28: #include <library.h>
                     29: 
                     30: #include <time.h>
                     31: 
                     32: /**
                     33:  * Interface for the IMC Operating System (OS) information module
                     34:  */
                     35: struct imc_os_info_t {
                     36: 
                     37:        /**
                     38:         * Get the OS type if it can be determined
                     39:         *
                     40:         * @return                                      OS type
                     41:         */
                     42:        os_type_t (*get_type)(imc_os_info_t *this);
                     43: 
                     44:        /**
                     45:         * Get the OS product name or distribution
                     46:         *
                     47:         * @return                                      OS name
                     48:         */
                     49:        chunk_t (*get_name)(imc_os_info_t *this);
                     50: 
                     51:        /**
                     52:         * Get the numeric OS version or release
                     53:         *
                     54:         * @param major                         OS major version number
                     55:         * @param minor                         OS minor version number
                     56:         */
                     57:        void (*get_numeric_version)(imc_os_info_t *this, uint32_t *major,
                     58:                                                                                                 uint32_t *minor);
                     59: 
                     60:        /**
                     61:         * Get the OS version or release
                     62:         *
                     63:         * @return                                      OS version
                     64:         */
                     65:        chunk_t (*get_version)(imc_os_info_t *this);
                     66: 
                     67:        /**
                     68:         * Get the OS IPv4 forwarding status
                     69:         *
                     70:         * @return                                      IP forwarding status
                     71:         */
                     72:        os_fwd_status_t (*get_fwd_status)(imc_os_info_t *this);
                     73: 
                     74:        /**
                     75:         * Get the default password status
                     76:         *
                     77:         * @return                                      TRUE if enabled, FALSE otherwise
                     78:         */
                     79:        bool (*get_default_pwd_status)(imc_os_info_t *this);
                     80: 
                     81:        /**
                     82:         * Get the OS uptime in seconds
                     83:         *
                     84:         * @return                                      OS uptime
                     85:         */
                     86:        time_t (*get_uptime)(imc_os_info_t *this);
                     87: 
                     88:        /**
                     89:         * Get an OS setting (restricted to /proc, /sys, and /etc)
                     90:         *
                     91:         * @param name                          name of OS setting
                     92:         * @return                                      value of OS setting
                     93:         */
                     94:        chunk_t (*get_setting)(imc_os_info_t *this, char *name);
                     95: 
                     96:        /**
                     97:         * Enumerates over all installed packages
                     98:         *
                     99:         * @return                              return package enumerator
                    100:         */
                    101:        enumerator_t* (*create_package_enumerator)(imc_os_info_t *this);
                    102: 
                    103:        /**
                    104:         * Destroys an imc_os_info_t object.
                    105:         */
                    106:        void (*destroy)(imc_os_info_t *this);
                    107: };
                    108: 
                    109: /**
                    110:  * Create an imc_os_info_t object
                    111:  */
                    112: imc_os_info_t* imc_os_info_create(void);
                    113: 
                    114: #endif /** IMC_OS_INFO_H_ @}*/

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>