~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to source4/ntvfs/sysdep/sys_lease.h

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   Unix SMB/CIFS implementation.
 
3
 
 
4
   Copyright (C) Stefan Metzmacher 2008
 
5
 
 
6
   This program is free software; you can redistribute it and/or modify
 
7
   it under the terms of the GNU General Public License as published by
 
8
   the Free Software Foundation; either version 3 of the License, or
 
9
   (at your option) any later version.
 
10
 
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
   GNU General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU General Public License
 
17
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
#include "param/share.h"
 
21
 
 
22
struct sys_lease_context;
 
23
struct opendb_entry;
 
24
struct messaging_context;
 
25
struct tevent_context;
 
26
 
 
27
typedef NTSTATUS (*sys_lease_send_break_fn)(struct messaging_context *,
 
28
                                            struct opendb_entry *,
 
29
                                            uint8_t level);
 
30
 
 
31
struct sys_lease_ops {
 
32
        const char *name;
 
33
        NTSTATUS (*init)(struct sys_lease_context *ctx);
 
34
        NTSTATUS (*setup)(struct sys_lease_context *ctx,
 
35
                          struct opendb_entry *e);
 
36
        NTSTATUS (*update)(struct sys_lease_context *ctx,
 
37
                           struct opendb_entry *e);
 
38
        NTSTATUS (*remove)(struct sys_lease_context *ctx,
 
39
                           struct opendb_entry *e);
 
40
};
 
41
 
 
42
struct sys_lease_context {
 
43
        struct tevent_context *event_ctx;
 
44
        struct messaging_context *msg_ctx;
 
45
        sys_lease_send_break_fn break_send;
 
46
        void *private_data; /* for use of backend */
 
47
        const struct sys_lease_ops *ops;
 
48
};
 
49
 
 
50
NTSTATUS sys_lease_register(const struct sys_lease_ops *ops);
 
51
NTSTATUS sys_lease_init(void);
 
52
 
 
53
struct sys_lease_context *sys_lease_context_create(struct share_config *scfg,
 
54
                                                   TALLOC_CTX *mem_ctx,
 
55
                                                   struct tevent_context *ev,
 
56
                                                   struct messaging_context *msg_ctx,
 
57
                                                   sys_lease_send_break_fn break_send);
 
58
 
 
59
NTSTATUS sys_lease_setup(struct sys_lease_context *ctx,
 
60
                         struct opendb_entry *e);
 
61
 
 
62
NTSTATUS sys_lease_update(struct sys_lease_context *ctx,
 
63
                          struct opendb_entry *e);
 
64
 
 
65
NTSTATUS sys_lease_remove(struct sys_lease_context *ctx,
 
66
                          struct opendb_entry *e);