4 * Copyright Volker Lendecke <vl@samba.org> 2014
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 _SERVER_ID_DB_H_
21 #define _SERVER_ID_DB_H_
24 #include "librpc/gen_ndr/server_id.h"
28 struct server_id_db
*server_id_db_init(TALLOC_CTX
*mem_ctx
,
30 const char *base_path
,
31 int hash_size
, int tdb_flags
);
32 void server_id_db_reinit(struct server_id_db
*db
, struct server_id pid
);
33 int server_id_db_add(struct server_id_db
*db
, const char *name
);
34 int server_id_db_remove(struct server_id_db
*db
, const char *name
);
35 int server_id_db_lookup(struct server_id_db
*db
, const char *name
,
36 TALLOC_CTX
*mem_ctx
, unsigned *num_servers
,
37 struct server_id
**servers
);
38 bool server_id_db_lookup_one(struct server_id_db
*db
, const char *name
,
39 struct server_id
*server
);
40 int server_id_db_traverse_read(struct server_id_db
*db
,
41 int (*fn
)(const char *name
,
43 const struct server_id
*servers
,