messaging: Remove the "n_sent" arg from message_send_all
[samba.git] / source3 / include / serverid.h
1 /*
2    Unix SMB/CIFS implementation.
3    Implementation of a reliable server_exists()
4    Copyright (C) Volker Lendecke 2010
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 #ifndef __SERVERID_H__
21 #define __SERVERID_H__
22
23 #include "replace.h"
24 #include "lib/dbwrap/dbwrap.h"
25 #include "librpc/gen_ndr/server_id.h"
26
27 /* Flags to classify messages - used in message_send_all() */
28 /* Sender will filter by flag. */
29
30 #define FLAG_MSG_GENERAL                0x0001
31 #define FLAG_MSG_SMBD                   0x0002
32 #define FLAG_MSG_NMBD                   0x0004
33 #define FLAG_MSG_WINBIND                0x0008
34 #define FLAG_MSG_PRINT_GENERAL          0x0010
35 /* dbwrap messages 4001-4999 */
36 #define FLAG_MSG_DBWRAP                 0x0020
37
38 /*
39  * Register a server with its unique id
40  */
41 bool serverid_register(const struct server_id id, uint32_t msg_flags);
42
43 /*
44  * De-register a server with its unique id
45  */
46 bool serverid_deregister(const struct server_id id);
47
48 /*
49  * Check existence of a server id
50  */
51 bool serverid_exists(const struct server_id *id);
52
53 /*
54  * Walk the list of server_ids registered
55  */
56 bool serverid_traverse(int (*fn)(struct db_record *rec,
57                                  const struct server_id *id,
58                                  uint32_t msg_flags,
59                                  void *private_data),
60                        void *private_data);
61
62 /*
63  * Walk the list of server_ids registered read-only
64  */
65 bool serverid_traverse_read(int (*fn)(const struct server_id *id,
66                                       uint32_t msg_flags,
67                                       void *private_data),
68                             void *private_data);
69 /*
70  * Ensure CLEAR_IF_FIRST works fine, to be called from the parent smbd
71  */
72 bool serverid_parent_init(TALLOC_CTX *mem_ctx);
73
74 struct messaging_context;
75
76 bool message_send_all(struct messaging_context *msg_ctx,
77                       int msg_type,
78                       const void *buf, size_t len);
79
80 #endif