]>
Commit | Line | Data |
---|---|---|
a6266485 AS |
1 | /* |
2 | * Copyright (C) 2013 Andreas Steffen | |
19ef2aec TB |
3 | * |
4 | * Copyright (C) secunet Security Networks AG | |
a6266485 AS |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
15 | */ | |
16 | ||
17 | #include "tncif_policy.h" | |
18 | ||
19 | /** | |
20 | * See header | |
21 | */ | |
22 | TNC_IMV_Evaluation_Result tncif_policy_update_evaluation( | |
23 | TNC_IMV_Evaluation_Result eval, | |
24 | TNC_IMV_Evaluation_Result eval_add) | |
25 | { | |
26 | switch (eval) | |
27 | { | |
28 | case TNC_IMV_EVALUATION_RESULT_COMPLIANT: | |
29 | switch (eval_add) | |
30 | { | |
31 | case TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR: | |
32 | case TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR: | |
33 | case TNC_IMV_EVALUATION_RESULT_ERROR: | |
34 | eval = eval_add; | |
35 | break; | |
36 | default: | |
37 | break; | |
38 | } | |
39 | break; | |
40 | case TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR: | |
41 | switch (eval_add) | |
42 | { | |
43 | case TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR: | |
44 | case TNC_IMV_EVALUATION_RESULT_ERROR: | |
45 | eval = eval_add; | |
46 | break; | |
47 | default: | |
48 | break; | |
49 | } | |
50 | break; | |
51 | case TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR: | |
52 | switch (eval_add) | |
53 | { | |
54 | case TNC_IMV_EVALUATION_RESULT_ERROR: | |
55 | eval = eval_add; | |
56 | break; | |
57 | default: | |
58 | break; | |
59 | } | |
60 | break; | |
61 | case TNC_IMV_EVALUATION_RESULT_DONT_KNOW: | |
62 | eval = eval_add; | |
63 | break; | |
64 | default: | |
65 | break; | |
66 | } | |
67 | return eval; | |
68 | } | |
69 | ||
70 | /** | |
71 | * See header | |
72 | */ | |
73 | TNC_IMV_Action_Recommendation tncif_policy_update_recommendation( | |
74 | TNC_IMV_Action_Recommendation rec, | |
75 | TNC_IMV_Action_Recommendation rec_add) | |
76 | { | |
77 | switch (rec) | |
78 | { | |
79 | case TNC_IMV_ACTION_RECOMMENDATION_ALLOW: | |
80 | switch (rec_add) | |
81 | { | |
82 | case TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS: | |
83 | case TNC_IMV_ACTION_RECOMMENDATION_ISOLATE: | |
84 | rec = rec_add; | |
85 | break; | |
86 | default: | |
87 | break; | |
88 | } | |
89 | break; | |
7658b399 | 90 | case TNC_IMV_ACTION_RECOMMENDATION_ISOLATE: |
a6266485 AS |
91 | switch (rec_add) |
92 | { | |
7658b399 | 93 | case TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS: |
a6266485 AS |
94 | rec = rec_add; |
95 | break; | |
96 | default: | |
97 | break; | |
98 | } | |
99 | break; | |
100 | case TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION: | |
101 | rec = rec_add; | |
102 | break; | |
103 | default: | |
104 | break; | |
105 | } | |
106 | return rec; | |
107 | } |