You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dynamic_cfg.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*-
  2. * Copyright 2016 Vsevolod Stakhov
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef DYNAMIC_CFG_H_
  17. #define DYNAMIC_CFG_H_
  18. #include "config.h"
  19. #include "cfg_file.h"
  20. /**
  21. * Init dynamic configuration using map logic and specific configuration
  22. * @param cfg config file
  23. */
  24. void init_dynamic_config (struct rspamd_config *cfg);
  25. /**
  26. * Dump dynamic configuration to the disk
  27. * @param cfg
  28. * @return
  29. */
  30. gboolean dump_dynamic_config (struct rspamd_config *cfg);
  31. /**
  32. * Add symbol for specified metric
  33. * @param cfg config file object
  34. * @param metric metric's name
  35. * @param symbol symbol's name
  36. * @param value value of symbol
  37. * @return
  38. */
  39. gboolean add_dynamic_symbol (struct rspamd_config *cfg,
  40. const gchar *metric,
  41. const gchar *symbol,
  42. gdouble value);
  43. /**
  44. * Add action for specified metric
  45. * @param cfg config file object
  46. * @param metric metric's name
  47. * @param action action's name
  48. * @param value value of symbol
  49. * @return
  50. */
  51. gboolean add_dynamic_action (struct rspamd_config *cfg,
  52. const gchar *metric,
  53. guint action,
  54. gdouble value);
  55. #endif /* DYNAMIC_CFG_H_ */