winbindd: add retry to _winbind_SendToSam
[Samba.git] / lib / util / server_id_db.h
blob2dcce622939adaf10422c5725077fe9e1f18c572
1 /*
2 * Namedb
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_
23 #include "talloc.h"
24 #include "librpc/gen_ndr/server_id.h"
26 struct server_id_db;
28 struct server_id_db *server_id_db_init(TALLOC_CTX *mem_ctx,
29 struct server_id pid,
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 struct server_id server_id_db_pid(struct server_id_db *db);
34 int server_id_db_add(struct server_id_db *db, const char *name);
35 int server_id_db_remove(struct server_id_db *db, const char *name);
36 int server_id_db_prune_name(struct server_id_db *db, const char *name,
37 struct server_id server);
38 int server_id_db_lookup(struct server_id_db *db, const char *name,
39 TALLOC_CTX *mem_ctx, unsigned *num_servers,
40 struct server_id **servers);
41 bool server_id_db_lookup_one(struct server_id_db *db, const char *name,
42 struct server_id *server);
43 int server_id_db_traverse_read(struct server_id_db *db,
44 int (*fn)(const char *name,
45 unsigned num_servers,
46 const struct server_id *servers,
47 void *private_data),
48 void *private_data);
50 #endif