File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libtnccs / tnc / imv / imv_recommendations.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Jun 3 09:46:43 2020 UTC (4 years, 3 months ago) by misho
Branches: strongswan, MAIN
CVS tags: v5_9_2p0, v5_8_4p7, HEAD
Strongswan

    1: /*
    2:  * Copyright (C) 2010 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 imv_recommendations imv_recommendations
   18:  * @{ @ingroup imv
   19:  */
   20: 
   21: #ifndef IMV_RECOMMENDATIONS_H_
   22: #define IMV_RECOMMENDATIONS_H_
   23: 
   24: #include <tncifimv.h>
   25: #include <library.h>
   26: 
   27: typedef enum recommendation_policy_t recommendation_policy_t;
   28: 
   29: enum recommendation_policy_t {
   30: 	RECOMMENDATION_POLICY_DEFAULT,
   31: 	RECOMMENDATION_POLICY_ANY,
   32: 	RECOMMENDATION_POLICY_ALL
   33: };
   34: 
   35: extern enum_name_t *recommendation_policy_names;
   36: 
   37: 
   38: typedef struct recommendations_t recommendations_t;
   39: 
   40: /**
   41:  * Collection of all IMV action recommendations and evaluation results
   42:  */
   43: struct recommendations_t {
   44: 
   45: 	/**
   46: 	 * Deliver an IMV action recommendation and IMV evaluation result to the TNCS
   47: 	 *
   48: 	 * @param imv_id		ID of the IMV providing the recommendation
   49: 	 * @param rec			action recommendation
   50: 	 * @param eval			evaluation result
   51: 	 * @return				return code
   52: 	 */
   53: 	TNC_Result (*provide_recommendation)(recommendations_t *this,
   54: 										 TNC_IMVID imv_id,
   55: 										 TNC_IMV_Action_Recommendation rec,
   56: 										 TNC_IMV_Evaluation_Result eval);
   57: 
   58: 	/**
   59: 	 * If all IMVs provided a recommendation, derive a consolidated action
   60: 	 * recommendation and evaluation result based on a configured policy
   61: 	 *
   62: 	 * @param rec			action recommendation
   63: 	 * @param eval			evaluation result
   64: 	 * @return				TRUE if all IMVs provided a recommendation
   65: 	 */
   66: 	bool (*have_recommendation)(recommendations_t *this,
   67: 								TNC_IMV_Action_Recommendation *rec,
   68: 								TNC_IMV_Evaluation_Result *eval);
   69: 
   70: 	/**
   71: 	 * Clear all recommendation information
   72: 	 */
   73: 	void (*clear_recommendation)(recommendations_t *this);
   74: 
   75: 	/**
   76: 	 * Get the preferred language for remediation messages
   77: 	 *
   78: 	 * @return				preferred language
   79: 	 */
   80: 	chunk_t (*get_preferred_language)(recommendations_t *this);
   81: 
   82: 	/**
   83: 	 * Set the preferred language for remediation messages
   84: 	 *
   85: 	 * @param pref_lang		preferred language
   86: 	 */
   87: 	void (*set_preferred_language)(recommendations_t *this, chunk_t pref_lang);
   88: 
   89: 	/**
   90: 	 * Set the reason string
   91: 	 *
   92: 	 * @param id			ID of IMV setting the reason string
   93: 	 * @param reason		reason string
   94: 	 * @result				return code
   95: 	 */
   96: 	TNC_Result (*set_reason_string)(recommendations_t *this, TNC_IMVID id,
   97: 									chunk_t reason);
   98: 
   99: 	/**
  100: 	 * Set the language for reason strings
  101: 	 *
  102: 	 * @param id			ID of IMV setting the reason language
  103: 	 * @param reason_lang	reason language
  104: 	 * @result				return code
  105: 	 */
  106: 	TNC_Result (*set_reason_language)(recommendations_t *this, TNC_IMVID id,
  107: 									  chunk_t reason_lang);
  108: 
  109: 	/**
  110: 	 * Enumerates over all IMVs sending a reason string.
  111: 	 * Format:  TNC_IMVID *id, chunk_t *reason, chunk_t *reason_language
  112: 	 *
  113: 	 * @return				enumerator
  114: 	 */
  115: 	enumerator_t* (*create_reason_enumerator)(recommendations_t *this);
  116: 
  117: 	/**
  118: 	 * Destroys an imv_t object.
  119: 	 */
  120: 	void (*destroy)(recommendations_t *this);
  121: };
  122: 
  123: #endif /** IMV_RECOMMENDATIONS_H_ @}*/

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