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__ */
#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;
--- /dev/null
+/*
+ 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__ */
#include "lib/async_req/async_sock.h"
#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "common/comm.h"
#include "common/logging.h"
#include "protocol/protocol.h"
#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "client/client.h"
#include "common/logging.h"
#include "common/logging.h"
#include "common/rb_tree.h"
-#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "server/ipalloc_private.h"
#include "common/common.h"
#include "common/rb_tree.h"
-#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "server/ipalloc_private.h"
#include "lib/util/debug.h"
#include "common/logging.h"
-#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "server/ipalloc_private.h"
#include "common/logging.h"
#include "common/common.h"
-#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "server/ipalloc_private.h"
#include "lib/util/debug.h"
#include "protocol/protocol.h"
-#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "common/logging.h"
#include "common/system.h"
#include "protocol/protocol.h"
#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "common/comm.h"
#include "common/system.h"
#include "common/logging.h"
#include "protocol/protocol.h"
#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "common/system.h"
#include "client/client.h"
#include "client/client_sync.h"
#include "lib/util/debug.h"
-#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "client/client_event.h"
#include "common/logging.h"
#include "lib/util/debug.h"
#include "protocol/protocol.h"
-#include "protocol/protocol_api.h"
+#include "protocol/protocol_util.h"
#include "common/rb_tree.h"
#include "common/system.h"
protocol_keepalive.c
protocol_client.c
protocol_debug.c
- protocol_util.c
protocol_event.c
protocol_sock.c'''),
includes='include',
deps='replace talloc tdb')
+ bld.SAMBA_SUBSYSTEM('ctdb-protocol-util',
+ source='protocol/protocol_util.c',
+ deps='replace talloc tdb')
+
bld.SAMBA_SUBSYSTEM('ctdb-client',
source=bld.SUBDIR('client', 'ctdb_client.c'),
includes='include',
ipalloc.c
'''),
includes='include',
- deps='ctdb-protocol replace talloc tevent')
+ deps='ctdb-protocol-util replace talloc tevent')
bld.SAMBA_BINARY('ctdbd',
source='server/ctdbd.c ' +
bld.SAMBA_BINARY('ctdb',
source='tools/ctdb.c',
- deps='''ctdb-client2 ctdb-protocol ctdb-util ctdb-system
- samba-util sys_rw popt''',
+ deps='''ctdb-client2 ctdb-protocol ctdb-protocol-util
+ ctdb-util ctdb-system samba-util sys_rw popt''',
install_path='${BINDIR}',
manpages='ctdb.1')
bld.SAMBA_BINARY('ctdb_killtcp',
source='tools/ctdb_killtcp.c',
- deps='''ctdb-protocol ctdb-util ctdb-system
+ deps='''ctdb-protocol-util ctdb-util ctdb-system
samba-util replace''',
install_path='${CTDB_HELPER_BINDIR}')
bld.SAMBA_BINARY('ctdb_event',
source='tools/ctdb_event.c',
- deps='''ctdb-client2 ctdb-protocol ctdb-util ctdb-system
- samba-util replace''',
+ deps='''ctdb-client2 ctdb-protocol ctdb-protocol-util
+ ctdb-util ctdb-system samba-util replace''',
install_path='${CTDB_HELPER_BINDIR}')
bld.SAMBA_BINARY('ltdbtool',
bld.SAMBA_BINARY('ctdb_eventd',
source='server/ctdb_eventd.c',
- deps='''ctdb-server-util ctdb-protocol ctdb-util
- samba-util LIBASYNC_REQ replace popt''',
+ deps='''ctdb-server-util ctdb-protocol ctdb-protocol-util
+ ctdb-util samba-util LIBASYNC_REQ replace popt''',
install_path='${CTDB_HELPER_BINDIR}')
bld.SAMBA_BINARY('ctdb_lock_helper',
bld.SAMBA_BINARY('fake_ctdbd',
source='''tests/src/fake_ctdbd.c
tests/src/ipalloc_read_known_ips.c''',
- deps='''ctdb-util ctdb-protocol ctdb-system
- samba-util tevent-util LIBASYNC_REQ popt''',
+ deps='''ctdb-util ctdb-protocol ctdb-protocol-util
+ ctdb-system samba-util tevent-util
+ LIBASYNC_REQ popt''',
install_path='${CTDB_TEST_LIBEXECDIR}')
if bld.env.HAVE_INFINIBAND: