Apache HTTPD
md_status.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. 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
17#ifndef md_status_h
18#define md_status_h
19
20struct md_json_t;
21struct md_reg_t;
22struct md_result_t;
23struct md_ocsp_reg_t;
24
25#include "md_store.h"
26
31 struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp,
32 apr_pool_t *p);
33
38 struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp,
39 apr_pool_t *p);
40
47 struct md_reg_t *reg, apr_pool_t *p);
48
49
50typedef struct md_job_t md_job_t;
51
52struct md_job_t {
53 md_store_group_t group;/* group where job is persisted */
54 const char *mdomain; /* Name of the MD this job is about */
55 md_store_t *store; /* store where it is persisted */
57 apr_time_t next_run; /* Time this job wants to be processed next */
58 apr_time_t last_run; /* Time this job ran last (or 0) */
59 struct md_result_t *last_result; /* Result from last run */
60 int finished; /* true iff the job finished successfully */
61 int notified; /* true iff notifications were handled successfully */
62 int notified_renewed; /* true iff a 'renewed' notification was handled successfully */
63 apr_time_t valid_from; /* at which time the finished job results become valid, 0 if immediate */
64 int error_runs; /* Number of errored runs of an unfinished job */
65 int fatal_error; /* a fatal error is remedied by retrying */
66 md_json_t *log; /* array of log objects with minimum fields
67 MD_KEY_WHEN (timestamp) and MD_KEY_TYPE (string) */
68 apr_size_t max_log; /* max number of log entries, new ones replace oldest */
69 int dirty;
71 apr_time_t min_delay; /* smallest delay a repeated attempt should have */
72};
73
79 md_store_group_t group, const char *name,
80 apr_time_t min_delay);
81
83
88
93
100void md_job_log_append(md_job_t *job, const char *type,
101 const char *status, const char *detail);
102
106md_json_t *md_job_log_get_latest(md_job_t *job, const char *type);
107
113
114void md_job_start_run(md_job_t *job, struct md_result_t *result, md_store_t *store);
115void md_job_end_run(md_job_t *job, struct md_result_t *result);
117
123
124apr_status_t md_job_notify(md_job_t *job, const char *reason, struct md_result_t *result);
125
126#endif /* md_status_h */
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
int type
apr_array_header_t ** result
int reason
int int status
apr_int64_t apr_time_t
Definition apr_time.h:45
apr_pool_t * p
Definition md_event.c:32
apr_status_t md_status_get_md_json(struct md_json_t **pjson, const md_t *md, struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp, apr_pool_t *p)
Definition md_status.c:261
md_job_t * md_job_make(apr_pool_t *p, md_store_t *store, md_store_group_t group, const char *name, apr_time_t min_delay)
Definition md_status.c:288
void md_job_set_group(md_job_t *job, md_store_group_t group)
Definition md_status.c:302
void md_status_take_stock(struct md_json_t **pjson, apr_array_header_t *mds, struct md_reg_t *reg, apr_pool_t *p)
Definition md_status.c:446
void md_job_end_run(md_job_t *job, struct md_result_t *result)
Definition md_status.c:611
apr_status_t md_job_save(md_job_t *job, struct md_result_t *result, apr_pool_t *p)
Definition md_status.c:370
apr_status_t md_job_load(md_job_t *job)
Definition md_status.c:358
md_json_t * md_job_log_get_latest(md_job_t *job, const char *type)
Definition md_status.c:421
apr_status_t md_status_get_json(struct md_json_t **pjson, apr_array_header_t *mds, struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp, apr_pool_t *p)
Definition md_status.c:267
apr_time_t md_job_delay_on_errors(md_job_t *job, int err_count, const char *last_problem)
Definition md_status.c:578
void md_job_start_run(md_job_t *job, struct md_result_t *result, md_store_t *store)
Definition md_status.c:570
void md_job_retry_at(md_job_t *job, apr_time_t later)
Definition md_status.c:628
apr_time_t md_job_log_get_time_of_latest(md_job_t *job, const char *type)
Definition md_status.c:433
apr_status_t md_job_notify(md_job_t *job, const char *reason, struct md_result_t *result)
Definition md_status.c:634
void md_job_log_append(md_job_t *job, const char *type, const char *status, const char *detail)
Definition md_status.c:382
md_store_group_t
Definition md_store.h:62
char * name
struct md_result_t * observing
Definition md_status.h:70
apr_time_t min_delay
Definition md_status.h:71
int fatal_error
Definition md_status.h:65
int notified
Definition md_status.h:61
int error_runs
Definition md_status.h:64
int dirty
Definition md_status.h:69
apr_time_t last_run
Definition md_status.h:58
md_store_t * store
Definition md_status.h:55
const char * mdomain
Definition md_status.h:54
apr_time_t valid_from
Definition md_status.h:63
apr_time_t next_run
Definition md_status.h:57
int finished
Definition md_status.h:60
int notified_renewed
Definition md_status.h:62
struct md_result_t * last_result
Definition md_status.h:59
md_json_t * log
Definition md_status.h:66
apr_size_t max_log
Definition md_status.h:68
md_store_group_t group
Definition md_status.h:53
apr_pool_t * p
Definition md_status.h:56
const char * detail
Definition md_result.h:34
Definition md.h:76