summaryrefslogtreecommitdiff
path: root/ctdb/protocol
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2017-09-04 16:00:48 +1000
committerMartin Schwenke <martins@samba.org>2017-09-19 13:30:26 +0200
commit3783b66fb343b9dbbb4a135ff0573c80ef2aba17 (patch)
tree7f17486b571cdb6e3c655758668dce3bb8f3115b /ctdb/protocol
parent2550a88e2f04e45b6519c981a40de1fa5f729bd1 (diff)
downloadsamba-3783b66fb343b9dbbb4a135ff0573c80ef2aba17.tar.gz
ctdb-build: Split protocol-util as a separate subsystem
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/protocol')
-rw-r--r--ctdb/protocol/protocol_api.h18
-rw-r--r--ctdb/protocol/protocol_util.c4
-rw-r--r--ctdb/protocol/protocol_util.h43
3 files changed, 44 insertions, 21 deletions
diff --git a/ctdb/protocol/protocol_api.h b/ctdb/protocol/protocol_api.h
index d165ba25ade..67f32a0b8cc 100644
--- a/ctdb/protocol/protocol_api.h
+++ b/ctdb/protocol/protocol_api.h
@@ -678,22 +678,4 @@ void sock_packet_header_set_reqid(struct sock_packet_header *h,
void sock_packet_header_set_length(struct sock_packet_header *h,
uint32_t length);
-/* From protocol/protocol_util.c */
-
-const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
-enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
-
-const char *ctdb_event_to_string(enum ctdb_event event);
-enum ctdb_event ctdb_event_from_string(const char *event_str);
-
-const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
-int ctdb_sock_addr_cmp_ip(const ctdb_sock_addr *addr1,
- const ctdb_sock_addr *addr2);
-int ctdb_sock_addr_cmp(const ctdb_sock_addr *addr1,
- const ctdb_sock_addr *addr2);
-bool ctdb_sock_addr_same_ip(const ctdb_sock_addr *addr1,
- const ctdb_sock_addr *addr2);
-bool ctdb_sock_addr_same(const ctdb_sock_addr *addr1,
- const ctdb_sock_addr *addr2);
-
#endif /* __CTDB_PROTOCOL_API_H__ */
diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c
index 0e1bf286799..3b039446af3 100644
--- a/ctdb/protocol/protocol_util.c
+++ b/ctdb/protocol/protocol_util.c
@@ -21,11 +21,9 @@
#include "system/network.h"
#include <talloc.h>
-#include <tdb.h>
#include "protocol.h"
-#include "protocol_private.h"
-#include "protocol_api.h"
+#include "protocol_util.h"
static struct {
enum ctdb_runstate runstate;
diff --git a/ctdb/protocol/protocol_util.h b/ctdb/protocol/protocol_util.h
new file mode 100644
index 00000000000..94778817efd
--- /dev/null
+++ b/ctdb/protocol/protocol_util.h
@@ -0,0 +1,43 @@
+/*
+ CTDB protocol marshalling
+
+ Copyright (C) Amitay Isaacs 2015
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __CTDB_PROTOCOL_UTIL_H__
+#define __CTDB_PROTOCOL_UTIL_H__
+
+#include <talloc.h>
+
+#include "protocol/protocol.h"
+
+const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
+enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
+
+const char *ctdb_event_to_string(enum ctdb_event event);
+enum ctdb_event ctdb_event_from_string(const char *event_str);
+
+const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
+int ctdb_sock_addr_cmp_ip(const ctdb_sock_addr *addr1,
+ const ctdb_sock_addr *addr2);
+int ctdb_sock_addr_cmp(const ctdb_sock_addr *addr1,
+ const ctdb_sock_addr *addr2);
+bool ctdb_sock_addr_same_ip(const ctdb_sock_addr *addr1,
+ const ctdb_sock_addr *addr2);
+bool ctdb_sock_addr_same(const ctdb_sock_addr *addr1,
+ const ctdb_sock_addr *addr2);
+
+#endif /* __CTDB_PROTOCOL_UTIL_H__ */