Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "ksm/ksm.h"
00039 #include "ksm/ksmdef.h"
00040 #include "ksm/message.h"
00041
00042 #define max(x,y) ((x) > (y) ? (x) : (y))
00043 #define min(x,y) ((x) < (y) ? (x) : (y))
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 int KsmParameterClockskew(KSM_PARCOLL* collection)
00063 {
00064
00065 if (collection == NULL) {
00066 MsgLog(KSM_INVARG, "NULL collection");
00067 return -1;
00068 }
00069 return collection->clockskew;
00070 }
00071
00072 int KsmParameterKskLifetime(KSM_PARCOLL* collection)
00073 {
00074
00075 if (collection == NULL) {
00076 MsgLog(KSM_INVARG, "NULL collection");
00077 return -1;
00078 }
00079 return collection->ksklife;
00080 }
00081
00082 int KsmParameterStandbyKSKeys(KSM_PARCOLL* collection)
00083 {
00084
00085 if (collection == NULL) {
00086 MsgLog(KSM_INVARG, "NULL collection");
00087 return -1;
00088 }
00089 return collection->standbyksks;
00090 }
00091
00092 int KsmParameterStandbyZSKeys(KSM_PARCOLL* collection)
00093 {
00094
00095 if (collection == NULL) {
00096 MsgLog(KSM_INVARG, "NULL collection");
00097 return -1;
00098 }
00099 return collection->standbyzsks;
00100 }
00101
00102 int KsmParameterPropagationDelay(KSM_PARCOLL* collection)
00103 {
00104
00105 if (collection == NULL) {
00106 MsgLog(KSM_INVARG, "NULL collection");
00107 return -1;
00108 }
00109 return collection->propdelay;
00110 }
00111
00112 int KsmParameterSigningInterval(KSM_PARCOLL* collection)
00113 {
00114
00115 if (collection == NULL) {
00116 MsgLog(KSM_INVARG, "NULL collection");
00117 return -1;
00118 }
00119 return collection->signint;
00120 }
00121
00122 int KsmParameterSoaMin(KSM_PARCOLL* collection)
00123 {
00124
00125 if (collection == NULL) {
00126 MsgLog(KSM_INVARG, "NULL collection");
00127 return -1;
00128 }
00129 return collection->soamin;
00130 }
00131
00132 int KsmParameterSoaTtl(KSM_PARCOLL* collection)
00133 {
00134
00135 if (collection == NULL) {
00136 MsgLog(KSM_INVARG, "NULL collection");
00137 return -1;
00138 }
00139 return collection->soattl;
00140 }
00141
00142 int KsmParameterZskLifetime(KSM_PARCOLL* collection)
00143 {
00144
00145 if (collection == NULL) {
00146 MsgLog(KSM_INVARG, "NULL collection");
00147 return -1;
00148 }
00149 return collection->zsklife;
00150 }
00151
00152 int KsmParameterZskTtl(KSM_PARCOLL* collection)
00153 {
00154
00155 if (collection == NULL) {
00156 MsgLog(KSM_INVARG, "NULL collection");
00157 return -1;
00158 }
00159 return collection->zskttl;
00160 }
00161
00162 int KsmParameterKskTtl(KSM_PARCOLL* collection)
00163 {
00164
00165 if (collection == NULL) {
00166 MsgLog(KSM_INVARG, "NULL collection");
00167 return -1;
00168 }
00169 return collection->kskttl;
00170 }
00171
00172 int KsmParameterKskPropagationDelay(KSM_PARCOLL* collection)
00173 {
00174
00175 if (collection == NULL) {
00176 MsgLog(KSM_INVARG, "NULL collection");
00177 return -1;
00178 }
00179 return collection->kskpropdelay;
00180 }
00181
00182 int KsmParameterRegistrationDelay(KSM_PARCOLL* collection)
00183 {
00184
00185 if (collection == NULL) {
00186 MsgLog(KSM_INVARG, "NULL collection");
00187 return -1;
00188 }
00189 return collection->regdelay;
00190 }
00191
00192 int KsmParameterPubSafety(KSM_PARCOLL* collection)
00193 {
00194
00195 if (collection == NULL) {
00196 MsgLog(KSM_INVARG, "NULL collection");
00197 return -1;
00198 }
00199 return collection->pub_safety;
00200 }
00201
00202 int KsmParameterRetSafety(KSM_PARCOLL* collection)
00203 {
00204
00205 if (collection == NULL) {
00206 MsgLog(KSM_INVARG, "NULL collection");
00207 return -1;
00208 }
00209 return collection->ret_safety;
00210 }
00211
00212
00213
00214
00215
00216
00217 int KsmParameterInitialPublicationInterval(KSM_PARCOLL* collection)
00218 {
00219 int ncache;
00220 int pubint;
00221
00222 if (collection == NULL) {
00223 MsgLog(KSM_INVARG, "NULL collection");
00224 return -1;
00225 }
00226
00227 ncache = min(KsmParameterSoaTtl(collection),
00228 KsmParameterSoaMin(collection));
00229 pubint = max(KsmParameterZskTtl(collection), ncache) +
00230 KsmParameterPropagationDelay(collection);
00231
00232 return pubint;
00233 }