libdns: Small cleanup
[Samba.git] / source3 / include / serverid.h
blob5db61b9d6ab7d0e516bdfc847b6e93f2f3b7d48a
1 /*
2 Unix SMB/CIFS implementation.
3 Implementation of a reliable server_exists()
4 Copyright (C) Volker Lendecke 2010
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.
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.
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/>.
20 #ifndef __SERVERID_H__
21 #define __SERVERID_H__
23 #include "replace.h"
24 #include "lib/dbwrap/dbwrap.h"
27 * Register a server with its unique id
29 bool serverid_register(const struct server_id id, uint32_t msg_flags);
32 * De-register a server with its unique id
34 bool serverid_deregister(const struct server_id id);
37 * Check existence of a server id
39 bool serverid_exists(const struct server_id *id);
42 * Walk the list of server_ids registered
44 bool serverid_traverse(int (*fn)(struct db_record *rec,
45 const struct server_id *id,
46 uint32_t msg_flags,
47 void *private_data),
48 void *private_data);
51 * Walk the list of server_ids registered read-only
53 bool serverid_traverse_read(int (*fn)(const struct server_id *id,
54 uint32_t msg_flags,
55 void *private_data),
56 void *private_data);
58 * Ensure CLEAR_IF_FIRST works fine, to be called from the parent smbd
60 bool serverid_parent_init(TALLOC_CTX *mem_ctx);
62 #endif