s3: Fix a long-standing problem with recycled PIDs
[Samba/gebeck_regimport.git] / source3 / include / serverid.h
blob9ef778cdc0cf25ccde15a561aefe0abc7a182b4d
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"
26 * Register a server with its unique id
28 bool serverid_register(const struct server_id *id, uint32_t msg_flags);
31 * Register ourselves with a unique id
33 bool serverid_register_self(uint32_t msg_flags);
36 * De-register a server with its unique id
38 bool serverid_deregister(const struct server_id *id);
41 * De-register ourself
43 bool serverid_deregister_self(void);
46 * Check existence of a server id
48 bool serverid_exists(const struct server_id *id);
51 * Walk the list of server_ids registered
53 bool serverid_traverse(int (*fn)(struct db_record *rec,
54 const struct server_id *id,
55 uint32_t msg_flags,
56 void *private_data),
57 void *private_data);
60 * Walk the list of server_ids registered read-only
62 bool serverid_traverse_read(int (*fn)(const struct server_id *id,
63 uint32_t msg_flags,
64 void *private_data),
65 void *private_data);
66 #endif