]> granicus.if.org Git - apache/blob - modules/ssl/ssl_ct_util.h
mod_cache: Don't add cached/revalidated entity headers to a 304 response.
[apache] / modules / ssl / ssl_ct_util.h
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 SSL_CT_UTIL_H
18 #define SSL_CT_UTIL_H
19
20 #include "httpd.h"
21
22 apr_status_t ctutil_path_join(char **out, const char *dirname, const char *basename,
23                               apr_pool_t *p, server_rec *s);
24
25 int ctutil_dir_exists(apr_pool_t *p, const char *dirname);
26
27 int ctutil_file_exists(apr_pool_t *p, const char *filename);
28
29 void ctutil_buffer_to_array(apr_pool_t *p, const char *b,
30                             apr_size_t b_size, apr_array_header_t **out);
31
32 int ctutil_in_array(const char *needle, const apr_array_header_t *haystack);
33
34 apr_status_t ctutil_fopen(const char *fn, const char *mode, FILE **f);
35
36 apr_status_t ctutil_read_dir(apr_pool_t *p,
37                              server_rec *s,
38                              const char *dirname,
39                              const char *pattern,
40                              apr_array_header_t **outarr);
41
42 apr_status_t ctutil_read_file(apr_pool_t *p,
43                               server_rec *s,
44                               const char *fn,
45                               apr_off_t limit,
46                               char **contents,
47                               apr_size_t *contents_size);
48
49 apr_status_t ctutil_run_to_log(apr_pool_t *p,
50                                server_rec *s,
51                                const char *args[8],
52                                const char *desc_for_log);
53
54 void ctutil_thread_mutex_lock(apr_thread_mutex_t *m);
55 void ctutil_thread_mutex_unlock(apr_thread_mutex_t *m);
56
57 apr_status_t ctutil_file_write_uint16(server_rec *s,
58                                       apr_file_t *f,
59                                       apr_uint16_t val);
60
61 apr_status_t ctutil_file_write_uint24(server_rec *s,
62                                       apr_file_t *f,
63                                       apr_uint32_t val);
64
65 void ctutil_log_array(const char *file, int line, int module_index,
66                       int level, server_rec *s, const char *desc,
67                       apr_array_header_t *arr);
68
69 apr_status_t ctutil_read_var_bytes(const unsigned char **mem,
70                                    apr_size_t *avail,
71                                    const unsigned char **start,
72                                    apr_size_t *len);
73
74 apr_status_t ctutil_deserialize_uint64(const unsigned char **mem,
75                                        apr_size_t *avail, apr_uint64_t *pval);
76 apr_status_t ctutil_deserialize_uint16(const unsigned char **mem,
77                                        apr_size_t *avail,
78                                        apr_uint16_t *pval);
79
80 apr_status_t ctutil_serialize_uint64(unsigned char **mem, apr_size_t *avail,
81                                      apr_uint64_t val);
82
83 apr_status_t ctutil_serialize_uint24(unsigned char **mem, apr_size_t *avail,
84                                      apr_uint32_t val);
85
86 apr_status_t ctutil_serialize_uint16(unsigned char **mem, apr_size_t *avail,
87                                      apr_uint16_t val);
88
89 apr_status_t ctutil_serialize_uint8(unsigned char **mem, apr_size_t *avail,
90                                     unsigned char val);
91
92 apr_status_t ctutil_write_var16_bytes(unsigned char **mem, apr_size_t *avail,
93                                       const unsigned char *val,
94                                       apr_uint16_t len);
95
96 apr_status_t ctutil_write_var24_bytes(unsigned char **mem, apr_size_t *avail,
97                                       const unsigned char *val,
98                                       apr_uint32_t len);
99
100 void ctutil_run_internal_tests(apr_pool_t *p);
101
102 #endif /* SSL_CT_UTIL_H */