s3: Simplify check_reduced_name a bit
[Samba/gebeck_regimport.git] / source3 / include / serverid.h
blob8fc06a15d88251cadd8881c1b099603980d12532
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 "includes.h"
25 /** Don't verify this unique id */
26 #define SERVERID_UNIQUE_ID_NOT_TO_VERIFY 0xFFFFFFFFFFFFFFFFULL
29 * Register a server with its unique id
31 bool serverid_register(const struct server_id id, uint32_t msg_flags);
34 * De-register a server with its unique id
36 bool serverid_deregister(const struct server_id id);
39 * (De)register additional message flags
41 bool serverid_register_msg_flags(const struct server_id id, bool do_reg,
42 uint32_t msg_flags);
45 * Check existence of a server id
47 bool serverid_exists(const struct server_id *id);
50 * Check existence of a list of server ids
52 bool serverids_exist(const struct server_id *ids, int num_ids, bool *results);
55 * Walk the list of server_ids registered
57 bool serverid_traverse(int (*fn)(struct db_record *rec,
58 const struct server_id *id,
59 uint32_t msg_flags,
60 void *private_data),
61 void *private_data);
64 * Walk the list of server_ids registered read-only
66 bool serverid_traverse_read(int (*fn)(const struct server_id *id,
67 uint32_t msg_flags,
68 void *private_data),
69 void *private_data);
71 * Ensure CLEAR_IF_FIRST works fine, to be called from the parent smbd
73 bool serverid_parent_init(TALLOC_CTX *mem_ctx);
76 * Get a random unique_id and make sure that it is not
77 * SERVERID_UNIQUE_ID_NOT_TO_VERIFY
79 uint64_t serverid_get_random_unique_id(void);
81 #endif