Annotation of embedaddon/strongswan/src/libimcv/pts/pts_ima_event_list.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2014 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 pts_ima_event_list pts_ima_event_list
                     18:  * @{ @ingroup pts
                     19:  */
                     20: 
                     21: #ifndef PTS_IMA_EVENT_LIST_H_
                     22: #define PTS_IMA_EVENT_LIST_H_
                     23: 
                     24: #include <time.h>
                     25: 
                     26: #include <library.h>
                     27: 
                     28: typedef struct pts_ima_event_list_t pts_ima_event_list_t;
                     29: 
                     30: #define IMA_PCR                                10
                     31: #define IMA_ALGO_LEN_MIN       5
                     32: #define IMA_ALGO_LEN_MAX       8
                     33: 
                     34: 
                     35: /**
                     36:  * Class retrieving Linux IMA file measurements
                     37:  *
                     38:  */
                     39: struct pts_ima_event_list_t {
                     40: 
                     41:        /**
                     42:         * Get the time the file measurements were taken
                     43:         *
                     44:         * @return                              Measurement time
                     45:         */
                     46:        time_t (*get_time)(pts_ima_event_list_t *this);
                     47: 
                     48:        /**
                     49:         * Get the number of non-processed file measurements
                     50:         *
                     51:         * @return                              Number of measurements left
                     52:         */
                     53:        int (*get_count)(pts_ima_event_list_t *this);
                     54: 
                     55:        /**
                     56:         * Get the next file measurement and remove it from the list
                     57:         *
                     58:         * @param measurement   Measurement hash
                     59:         * @param algo                  Algorithm used to hash files
                     60:         " @param name                  Event name (absolute filename or boot_aggregate)
                     61:         * @return                              Return code
                     62:         */
                     63:        status_t (*get_next)(pts_ima_event_list_t *this, chunk_t *measurement,
                     64:                                                 char **algo, char **name);
                     65: 
                     66:        /**
                     67:         * Destroys a pts_ima_event_list_t object.
                     68:         */
                     69:        void (*destroy)(pts_ima_event_list_t *this);
                     70: 
                     71: };
                     72: 
                     73: /**
                     74:  * Create a PTS IMA runtime file measurement object
                     75:  *
                     76:  * @param file                         Pathname pointing to the IMA runtime measurements
                     77:  */
                     78: pts_ima_event_list_t* pts_ima_event_list_create(char *file);
                     79: 
                     80: #endif /** PTS_IMA_EVENT_LIST_H_ @}*/

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