1 /*************************************************************************
3 * Copyright 2020 highstreet technologies GmbH and others
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 ***************************************************************************/
25 //list of all fields, including ves mandatory
30 //mandatory ves fields
35 char *specific_problem;
38 char *yang_notif_processed;
42 char *yang_notif_template;
43 char *choosing_method;
45 fault_details_t *fault;
57 int faults_init(void);
58 void faults_free(void);
60 int faults_change_settings(const char *json);
61 bool faults_get_present(void); //returns wheter faults are present or not in current config
63 fault_details_t *faults_generate_fault(void); //does not require freeing, does not update counters
66 fault_settings_t *faults_settings_read(const char *json_plain);
67 void faults_settings_free(fault_settings_t *faults);
68 int faults_settings_process(fault_settings_t *faults, int fault_no);
71 fault_counters_t faults_counters_get(void); //assumes faults_lock is acquired
72 void faults_counters_clear(void); //assumes faults_lock is acquired
73 int faults_counters_increase(const char *severity); //assumes faults_lock is acquired
76 void faults_fault_list_clear(void); //assumes faults_lock is acquired
77 int faults_fault_list_add(uint16_t delay); //assumes faults_lock is acquired
78 bool faults_fault_list_not_empty(void); //assumes faults_lock is acquired
79 uint16_t faults_fault_list_get_next(void); //assumes faults_lock is acquired
82 int faults_ves_init(void);
83 void faults_ves_free(void);
85 int faults_ves_message_send(sr_session_ctx_t *session, const char *condition, const char *object, const char *severity, const char *date_time, const char *specific_problem);