1 /* $OpenBSD: scheduler_null.c,v 1.11 2021/06/14 17:58:16 eric Exp $ */
2
3 /*
4 * Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #include "smtpd.h"
20
21 static int scheduler_null_init(const char *);
22 static int scheduler_null_insert(struct scheduler_info *);
23 static size_t scheduler_null_commit(uint32_t);
24 static size_t scheduler_null_rollback(uint32_t);
25 static int scheduler_null_update(struct scheduler_info *);
26 static int scheduler_null_delete(uint64_t);
27 static int scheduler_null_hold(uint64_t, uint64_t);
28 static int scheduler_null_release(int, uint64_t, int);
29 static int scheduler_null_batch(int, int*, size_t*, uint64_t*, int*);
30 static size_t scheduler_null_messages(uint32_t, uint32_t *, size_t);
31 static size_t scheduler_null_envelopes(uint64_t, struct evpstate *, size_t);
32 static int scheduler_null_schedule(uint64_t);
33 static int scheduler_null_remove(uint64_t);
34 static int scheduler_null_suspend(uint64_t);
35 static int scheduler_null_resume(uint64_t);
36
37 struct scheduler_backend scheduler_backend_null = {
38 scheduler_null_init,
39
40 scheduler_null_insert,
41 scheduler_null_commit,
42 scheduler_null_rollback,
43
44 scheduler_null_update,
45 scheduler_null_delete,
46 scheduler_null_hold,
47 scheduler_null_release,
48
49 scheduler_null_batch,
50
51 scheduler_null_messages,
52 scheduler_null_envelopes,
53 scheduler_null_schedule,
54 scheduler_null_remove,
55 scheduler_null_suspend,
56 scheduler_null_resume,
57 };
58
59 static int
scheduler_null_init(const char * arg)60 scheduler_null_init(const char *arg)
61 {
62 return (1);
63 }
64
65 static int
scheduler_null_insert(struct scheduler_info * si)66 scheduler_null_insert(struct scheduler_info *si)
67 {
68 return (0);
69 }
70
71 static size_t
scheduler_null_commit(uint32_t msgid)72 scheduler_null_commit(uint32_t msgid)
73 {
74 return (0);
75 }
76
77 static size_t
scheduler_null_rollback(uint32_t msgid)78 scheduler_null_rollback(uint32_t msgid)
79 {
80 return (0);
81 }
82
83 static int
scheduler_null_update(struct scheduler_info * si)84 scheduler_null_update(struct scheduler_info *si)
85 {
86 return (0);
87 }
88
89 static int
scheduler_null_delete(uint64_t evpid)90 scheduler_null_delete(uint64_t evpid)
91 {
92 return (0);
93 }
94
95 static int
scheduler_null_hold(uint64_t evpid,uint64_t holdq)96 scheduler_null_hold(uint64_t evpid, uint64_t holdq)
97 {
98 return (0);
99 }
100
101 static int
scheduler_null_release(int type,uint64_t holdq,int n)102 scheduler_null_release(int type, uint64_t holdq, int n)
103 {
104 return (0);
105 }
106
107 static int
scheduler_null_batch(int typemask,int * delay,size_t * count,uint64_t * evpids,int * types)108 scheduler_null_batch(int typemask, int *delay, size_t *count, uint64_t *evpids, int *types)
109 {
110 *delay = 0;
111
112 return (0);
113 }
114
115 static int
scheduler_null_schedule(uint64_t evpid)116 scheduler_null_schedule(uint64_t evpid)
117 {
118 return (0);
119 }
120
121 static int
scheduler_null_remove(uint64_t evpid)122 scheduler_null_remove(uint64_t evpid)
123 {
124 return (0);
125 }
126
127 static int
scheduler_null_suspend(uint64_t evpid)128 scheduler_null_suspend(uint64_t evpid)
129 {
130 return (0);
131 }
132
133 static int
scheduler_null_resume(uint64_t evpid)134 scheduler_null_resume(uint64_t evpid)
135 {
136 return (0);
137 }
138
139 static size_t
scheduler_null_messages(uint32_t from,uint32_t * dst,size_t size)140 scheduler_null_messages(uint32_t from, uint32_t *dst, size_t size)
141 {
142 return (0);
143 }
144
145 static size_t
scheduler_null_envelopes(uint64_t from,struct evpstate * dst,size_t size)146 scheduler_null_envelopes(uint64_t from, struct evpstate *dst, size_t size)
147 {
148 return (0);
149 }
150