diff options
Diffstat (limited to 'src/lib/libcrypto/lhash')
| -rw-r--r-- | src/lib/libcrypto/lhash/lh_stats.c | 11 | ||||
| -rw-r--r-- | src/lib/libcrypto/lhash/lhash.c | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/lib/libcrypto/lhash/lh_stats.c b/src/lib/libcrypto/lhash/lh_stats.c index e7dde47806..123792a2ab 100644 --- a/src/lib/libcrypto/lhash/lh_stats.c +++ b/src/lib/libcrypto/lhash/lh_stats.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: lh_stats.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */ | 1 | /* $OpenBSD: lh_stats.c,v 1.13 2023/07/07 13:40:44 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -96,6 +96,7 @@ lh_stats(LHASH *lh, FILE *out) | |||
| 96 | fprintf(out, "down_load = %lu\n", lh->down_load); | 96 | fprintf(out, "down_load = %lu\n", lh->down_load); |
| 97 | #endif | 97 | #endif |
| 98 | } | 98 | } |
| 99 | LCRYPTO_ALIAS(lh_stats); | ||
| 99 | 100 | ||
| 100 | void | 101 | void |
| 101 | lh_node_stats(LHASH *lh, FILE *out) | 102 | lh_node_stats(LHASH *lh, FILE *out) |
| @@ -109,6 +110,7 @@ lh_node_stats(LHASH *lh, FILE *out) | |||
| 109 | fprintf(out, "node %6u -> %3u\n", i, num); | 110 | fprintf(out, "node %6u -> %3u\n", i, num); |
| 110 | } | 111 | } |
| 111 | } | 112 | } |
| 113 | LCRYPTO_ALIAS(lh_node_stats); | ||
| 112 | 114 | ||
| 113 | void | 115 | void |
| 114 | lh_node_usage_stats(LHASH *lh, FILE *out) | 116 | lh_node_usage_stats(LHASH *lh, FILE *out) |
| @@ -136,6 +138,7 @@ lh_node_usage_stats(LHASH *lh, FILE *out) | |||
| 136 | (int)(total / n_used), | 138 | (int)(total / n_used), |
| 137 | (int)((total % n_used) * 100 / n_used)); | 139 | (int)((total % n_used) * 100 / n_used)); |
| 138 | } | 140 | } |
| 141 | LCRYPTO_ALIAS(lh_node_usage_stats); | ||
| 139 | 142 | ||
| 140 | #else | 143 | #else |
| 141 | 144 | ||
| @@ -152,6 +155,7 @@ lh_stats(const _LHASH *lh, FILE *fp) | |||
| 152 | BIO_free(bp); | 155 | BIO_free(bp); |
| 153 | end:; | 156 | end:; |
| 154 | } | 157 | } |
| 158 | LCRYPTO_ALIAS(lh_stats); | ||
| 155 | 159 | ||
| 156 | void | 160 | void |
| 157 | lh_node_stats(const _LHASH *lh, FILE *fp) | 161 | lh_node_stats(const _LHASH *lh, FILE *fp) |
| @@ -166,6 +170,7 @@ lh_node_stats(const _LHASH *lh, FILE *fp) | |||
| 166 | BIO_free(bp); | 170 | BIO_free(bp); |
| 167 | end:; | 171 | end:; |
| 168 | } | 172 | } |
| 173 | LCRYPTO_ALIAS(lh_node_stats); | ||
| 169 | 174 | ||
| 170 | void | 175 | void |
| 171 | lh_node_usage_stats(const _LHASH *lh, FILE *fp) | 176 | lh_node_usage_stats(const _LHASH *lh, FILE *fp) |
| @@ -180,6 +185,7 @@ lh_node_usage_stats(const _LHASH *lh, FILE *fp) | |||
| 180 | BIO_free(bp); | 185 | BIO_free(bp); |
| 181 | end:; | 186 | end:; |
| 182 | } | 187 | } |
| 188 | LCRYPTO_ALIAS(lh_node_usage_stats); | ||
| 183 | 189 | ||
| 184 | 190 | ||
| 185 | void | 191 | void |
| @@ -210,6 +216,7 @@ lh_stats_bio(const _LHASH *lh, BIO *out) | |||
| 210 | BIO_printf(out, "down_load = %lu\n", lh->down_load); | 216 | BIO_printf(out, "down_load = %lu\n", lh->down_load); |
| 211 | #endif | 217 | #endif |
| 212 | } | 218 | } |
| 219 | LCRYPTO_ALIAS(lh_stats_bio); | ||
| 213 | 220 | ||
| 214 | void | 221 | void |
| 215 | lh_node_stats_bio(const _LHASH *lh, BIO *out) | 222 | lh_node_stats_bio(const _LHASH *lh, BIO *out) |
| @@ -223,6 +230,7 @@ lh_node_stats_bio(const _LHASH *lh, BIO *out) | |||
| 223 | BIO_printf(out, "node %6u -> %3u\n", i, num); | 230 | BIO_printf(out, "node %6u -> %3u\n", i, num); |
| 224 | } | 231 | } |
| 225 | } | 232 | } |
| 233 | LCRYPTO_ALIAS(lh_node_stats_bio); | ||
| 226 | 234 | ||
| 227 | void | 235 | void |
| 228 | lh_node_usage_stats_bio(const _LHASH *lh, BIO *out) | 236 | lh_node_usage_stats_bio(const _LHASH *lh, BIO *out) |
| @@ -250,5 +258,6 @@ lh_node_usage_stats_bio(const _LHASH *lh, BIO *out) | |||
| 250 | (int)(total / n_used), | 258 | (int)(total / n_used), |
| 251 | (int)((total % n_used) * 100 / n_used)); | 259 | (int)((total % n_used) * 100 / n_used)); |
| 252 | } | 260 | } |
| 261 | LCRYPTO_ALIAS(lh_node_usage_stats_bio); | ||
| 253 | 262 | ||
| 254 | #endif | 263 | #endif |
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c index a68e466700..3adec71ed6 100644 --- a/src/lib/libcrypto/lhash/lhash.c +++ b/src/lib/libcrypto/lhash/lhash.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: lhash.c,v 1.19 2019/05/12 00:09:59 beck Exp $ */ | 1 | /* $OpenBSD: lhash.c,v 1.20 2023/07/07 13:40:44 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -133,6 +133,7 @@ lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c) | |||
| 133 | 133 | ||
| 134 | return (ret); | 134 | return (ret); |
| 135 | } | 135 | } |
| 136 | LCRYPTO_ALIAS(lh_new); | ||
| 136 | 137 | ||
| 137 | void | 138 | void |
| 138 | lh_free(_LHASH *lh) | 139 | lh_free(_LHASH *lh) |
| @@ -154,6 +155,7 @@ lh_free(_LHASH *lh) | |||
| 154 | free(lh->b); | 155 | free(lh->b); |
| 155 | free(lh); | 156 | free(lh); |
| 156 | } | 157 | } |
| 158 | LCRYPTO_ALIAS(lh_free); | ||
| 157 | 159 | ||
| 158 | void * | 160 | void * |
| 159 | lh_insert(_LHASH *lh, void *data) | 161 | lh_insert(_LHASH *lh, void *data) |
| @@ -191,6 +193,7 @@ lh_insert(_LHASH *lh, void *data) | |||
| 191 | } | 193 | } |
| 192 | return (ret); | 194 | return (ret); |
| 193 | } | 195 | } |
| 196 | LCRYPTO_ALIAS(lh_insert); | ||
| 194 | 197 | ||
| 195 | void * | 198 | void * |
| 196 | lh_delete(_LHASH *lh, const void *data) | 199 | lh_delete(_LHASH *lh, const void *data) |
| @@ -220,6 +223,7 @@ lh_delete(_LHASH *lh, const void *data) | |||
| 220 | 223 | ||
| 221 | return (ret); | 224 | return (ret); |
| 222 | } | 225 | } |
| 226 | LCRYPTO_ALIAS(lh_delete); | ||
| 223 | 227 | ||
| 224 | void * | 228 | void * |
| 225 | lh_retrieve(_LHASH *lh, const void *data) | 229 | lh_retrieve(_LHASH *lh, const void *data) |
| @@ -240,6 +244,7 @@ lh_retrieve(_LHASH *lh, const void *data) | |||
| 240 | } | 244 | } |
| 241 | return (ret); | 245 | return (ret); |
| 242 | } | 246 | } |
| 247 | LCRYPTO_ALIAS(lh_retrieve); | ||
| 243 | 248 | ||
| 244 | static void | 249 | static void |
| 245 | doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, | 250 | doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, |
| @@ -275,12 +280,14 @@ lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func) | |||
| 275 | { | 280 | { |
| 276 | doall_util_fn(lh, 0, func, (LHASH_DOALL_ARG_FN_TYPE)0, NULL); | 281 | doall_util_fn(lh, 0, func, (LHASH_DOALL_ARG_FN_TYPE)0, NULL); |
| 277 | } | 282 | } |
| 283 | LCRYPTO_ALIAS(lh_doall); | ||
| 278 | 284 | ||
| 279 | void | 285 | void |
| 280 | lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) | 286 | lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) |
| 281 | { | 287 | { |
| 282 | doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); | 288 | doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); |
| 283 | } | 289 | } |
| 290 | LCRYPTO_ALIAS(lh_doall_arg); | ||
| 284 | 291 | ||
| 285 | static void | 292 | static void |
| 286 | expand(_LHASH *lh) | 293 | expand(_LHASH *lh) |
| @@ -426,9 +433,11 @@ lh_strhash(const char *c) | |||
| 426 | } | 433 | } |
| 427 | return (ret >> 16) ^ ret; | 434 | return (ret >> 16) ^ ret; |
| 428 | } | 435 | } |
| 436 | LCRYPTO_ALIAS(lh_strhash); | ||
| 429 | 437 | ||
| 430 | unsigned long | 438 | unsigned long |
| 431 | lh_num_items(const _LHASH *lh) | 439 | lh_num_items(const _LHASH *lh) |
| 432 | { | 440 | { |
| 433 | return lh ? lh->num_items : 0; | 441 | return lh ? lh->num_items : 0; |
| 434 | } | 442 | } |
| 443 | LCRYPTO_ALIAS(lh_num_items); | ||
