1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

lib/util: add server_id_equal()

metze
This commit is contained in:
Stefan Metzmacher 2012-08-17 12:41:02 +02:00
parent f46c4dfe28
commit 8149623ad4
2 changed files with 22 additions and 0 deletions

View File

@ -899,6 +899,7 @@ char *data_path(TALLOC_CTX *mem_ctx, const char *name);
const char *shlib_ext(void);
struct server_id;
bool server_id_equal(const struct server_id *p1, const struct server_id *p2);
char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id);
#endif /* _SAMBA_UTIL_H_ */

View File

@ -20,6 +20,27 @@
#include "includes.h"
#include "librpc/gen_ndr/server_id.h"
bool server_id_equal(const struct server_id *p1, const struct server_id *p2)
{
if (p1->pid != p2->pid) {
return false;
}
if (p1->task_id != p2->task_id) {
return false;
}
if (p1->vnn != p2->vnn) {
return false;
}
if (p1->unique_id != p2->unique_id) {
return false;
}
return true;
}
char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id)
{
if (id->vnn == NONCLUSTER_VNN && id->task_id == 0) {