lib/util: add server_id_equal()
authorStefan Metzmacher <metze@samba.org>
Fri, 17 Aug 2012 10:41:02 +0000 (12:41 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 17 Aug 2012 18:07:07 +0000 (20:07 +0200)
metze

lib/util/samba_util.h
lib/util/server_id.c

index 274dde811c13df62e9a30c44d606ed2429473983..26a5c6872b2eba912e74cb26969fae755857bbab 100644 (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_ */
index 195deeac7c152ed5864fa17fcb2df7ff4031b84f..7370ad93356c694d3c4da0494e40f43b195f62d6 100644 (file)
 #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) {