sssd  2.2.3
About: SSSD provides a set of daemons to manage access to remote directories and authentication mechanisms such as LDAP, Kerberos or FreeIPA. It provides also an NSS and PAM interface toward the system.
  Fossies Dox: sssd-2.2.3.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

be_ptask.h
Go to the documentation of this file.
1 /*
2  Authors:
3  Pavel Březina <pbrezina@redhat.com>
4 
5  Copyright (C) 2013 Red Hat
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef _DP_PTASK_H_
22 #define _DP_PTASK_H_
23 
24 #include <tevent.h>
25 #include <talloc.h>
26 #include <time.h>
27 
28 /* solve circular dependency */
29 struct be_ctx;
30 
31 struct be_ptask;
32 
33 /* be_ptask flags */
34 
39 #define BE_PTASK_NO_PERIODIC 0x0001
40 
44 /* Schedule starting from now, typically this is used when scheduling
45  * relative to the finish time */
46 #define BE_PTASK_SCHEDULE_FROM_NOW 0x0002
47 /* Schedule relative to the start time of the task */
48 #define BE_PTASK_SCHEDULE_FROM_LAST 0x0004
49 
53 /* current request will be skipped and rescheduled to 'now + period' */
54 #define BE_PTASK_OFFLINE_SKIP 0x0008
55 /* An offline and online callback is registered. The task is disabled */
56 #define BE_PTASK_OFFLINE_DISABLE 0x0010
57 /* current request will be executed as planned */
58 #define BE_PTASK_OFFLINE_EXECUTE 0x0020
59 
60 typedef struct tevent_req *
61 (*be_ptask_send_t)(TALLOC_CTX *mem_ctx,
62  struct tevent_context *ev,
63  struct be_ctx *be_ctx,
64  struct be_ptask *be_ptask,
65  void *pvt);
66 
71 typedef errno_t
72 (*be_ptask_recv_t)(struct tevent_req *req);
73 
78 typedef errno_t
79 (*be_ptask_sync_t)(TALLOC_CTX *mem_ctx,
80  struct tevent_context *ev,
81  struct be_ctx *be_ctx,
82  struct be_ptask *be_ptask,
83  void *pvt);
84 
114 errno_t be_ptask_create(TALLOC_CTX *mem_ctx,
115  struct be_ctx *be_ctx,
116  time_t period,
117  time_t first_delay,
118  time_t enabled_delay,
119  time_t random_offset,
120  time_t timeout,
121  time_t max_backoff,
124  void *pvt,
125  const char *name,
126  uint32_t flags,
127  struct be_ptask **_task);
128 
129 errno_t be_ptask_create_sync(TALLOC_CTX *mem_ctx,
130  struct be_ctx *be_ctx,
131  time_t period,
132  time_t first_delay,
133  time_t enabled_delay,
134  time_t random_offset,
135  time_t timeout,
136  time_t max_backoff,
137  be_ptask_sync_t fn,
138  void *pvt,
139  const char *name,
140  uint32_t flags,
141  struct be_ptask **_task);
142 
143 void be_ptask_enable(struct be_ptask *task);
144 void be_ptask_disable(struct be_ptask *task);
145 void be_ptask_destroy(struct be_ptask **task);
146 
147 time_t be_ptask_get_period(struct be_ptask *task);
148 time_t be_ptask_get_timeout(struct be_ptask *task);
149 
150 #endif /* _DP_PTASK_H_ */
be_ptask::recv_fn
be_ptask_recv_t recv_fn
Definition: be_ptask_private.h:34
be_ptask_destroy
void be_ptask_destroy(struct be_ptask **task)
Definition: be_ptask.c:420
be_ptask_create_sync
errno_t be_ptask_create_sync(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx, time_t period, time_t first_delay, time_t enabled_delay, time_t random_offset, time_t timeout, time_t max_backoff, be_ptask_sync_t fn, void *pvt, const char *name, uint32_t flags, struct be_ptask **_task)
Definition: be_ptask.c:483
be_ptask::period
time_t period
Definition: be_ptask_private.h:38
be_ptask_sync_t
errno_t(* be_ptask_sync_t)(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct be_ctx *be_ctx, struct be_ptask *be_ptask, void *pvt)
If EOK, task will be scheduled again to 'last_execution_time + period'.
Definition: be_ptask.h:79
errno_t
int errno_t
Definition: hbac_evaluator.c:36
be_ptask
Definition: be_ptask_private.h:24
name
const char * name
Definition: sbus_errors.c:30
be_ptask::max_backoff
time_t max_backoff
Definition: be_ptask_private.h:32
be_ptask_recv_t
errno_t(* be_ptask_recv_t)(struct tevent_req *req)
If EOK, task will be scheduled again to 'last_execution_time + period'.
Definition: be_ptask.h:72
be_ptask::random_offset
time_t random_offset
Definition: be_ptask_private.h:30
be_ptask::send_fn
be_ptask_send_t send_fn
Definition: be_ptask_private.h:33
be_ptask::enabled_delay
time_t enabled_delay
Definition: be_ptask_private.h:29
be_ptask_send_t
struct tevent_req *(* be_ptask_send_t)(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct be_ctx *be_ctx, struct be_ptask *be_ptask, void *pvt)
Definition: be_ptask.h:61
be_ptask::pvt
void * pvt
Definition: be_ptask_private.h:35
be_ptask::timeout
time_t timeout
Definition: be_ptask_private.h:31
be_ptask_create
errno_t be_ptask_create(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx, time_t period, time_t first_delay, time_t enabled_delay, time_t random_offset, time_t timeout, time_t max_backoff, be_ptask_send_t send_fn, be_ptask_recv_t recv_fn, void *pvt, const char *name, uint32_t flags, struct be_ptask **_task)
The first execution is scheduled first_delay seconds after the task is created.
Definition: be_ptask.c:292
be_ptask_get_timeout
time_t be_ptask_get_timeout(struct be_ptask *task)
Definition: be_ptask.c:430
be_ptask::flags
uint32_t flags
Definition: be_ptask_private.h:43
be_ptask::first_delay
time_t first_delay
Definition: be_ptask_private.h:28
be_ctx
Definition: backend.h:75
be_ptask_get_period
time_t be_ptask_get_period(struct be_ptask *task)
Definition: be_ptask.c:425
be_ptask_enable
void be_ptask_enable(struct be_ptask *task)
Definition: be_ptask.c:391
be_ptask_disable
void be_ptask_disable(struct be_ptask *task)
Definition: be_ptask.c:409