summaryrefslogtreecommitdiff
path: root/ctdb/common
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-06-28 20:15:37 +1000
committerMartin Schwenke <martins@samba.org>2018-07-02 08:51:20 +0200
commit57834c64bef96d67dabe1ce22ced67e6544b8035 (patch)
tree9872c14c1ca24c21e62f00d78f343d9f4688654c /ctdb/common
parentf697c2e1c6aa481b3619f4c3dfefcc850af69eb4 (diff)
downloadsamba-57834c64bef96d67dabe1ce22ced67e6544b8035.tar.gz
ctdb-common: Rename system utility files
system_socket.[ch] will contain all the raw socket code and other functions that use ctdb_sock_addr. system.[ch] will contain other platform dependent functions. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/common')
-rw-r--r--ctdb/common/system.c (renamed from ctdb/common/system_util.c)0
-rw-r--r--ctdb/common/system.h5
-rw-r--r--ctdb/common/system_aix.c1
-rw-r--r--ctdb/common/system_freebsd.c1
-rw-r--r--ctdb/common/system_gnu.c1
-rw-r--r--ctdb/common/system_kfreebsd.c1
-rw-r--r--ctdb/common/system_linux.c1
-rw-r--r--ctdb/common/system_socket.c (renamed from ctdb/common/system_common.c)14
-rw-r--r--ctdb/common/system_socket.h28
9 files changed, 39 insertions, 13 deletions
diff --git a/ctdb/common/system_util.c b/ctdb/common/system.c
index f1e9763c52a..f1e9763c52a 100644
--- a/ctdb/common/system_util.c
+++ b/ctdb/common/system.c
diff --git a/ctdb/common/system.h b/ctdb/common/system.h
index 5865a1a690e..6a3ef29104c 100644
--- a/ctdb/common/system.h
+++ b/ctdb/common/system.h
@@ -22,11 +22,6 @@
#include <talloc.h>
-/* From system_common.c */
-
-uint32_t uint16_checksum(uint16_t *data, size_t n);
-bool ctdb_sys_have_ip(ctdb_sock_addr *_addr);
-
/* From system_<os>.c */
int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface);
diff --git a/ctdb/common/system_aix.c b/ctdb/common/system_aix.c
index f0a0a62efc0..f4c5c700141 100644
--- a/ctdb/common/system_aix.c
+++ b/ctdb/common/system_aix.c
@@ -38,6 +38,7 @@
#include "common/logging.h"
#include "common/system.h"
+#include "common/system_socket.h"
#if 0
diff --git a/ctdb/common/system_freebsd.c b/ctdb/common/system_freebsd.c
index b709a5c75c1..5614e1014d8 100644
--- a/ctdb/common/system_freebsd.c
+++ b/ctdb/common/system_freebsd.c
@@ -41,6 +41,7 @@
#include "common/logging.h"
#include "common/system.h"
+#include "common/system_socket.h"
#ifndef ETHERTYPE_IP6
#define ETHERTYPE_IP6 0x86dd
diff --git a/ctdb/common/system_gnu.c b/ctdb/common/system_gnu.c
index 38ccd13988b..27339d18c3e 100644
--- a/ctdb/common/system_gnu.c
+++ b/ctdb/common/system_gnu.c
@@ -40,6 +40,7 @@
#include "common/logging.h"
#include "common/system.h"
+#include "common/system_socket.h"
#ifndef ETHERTYPE_IP6
#define ETHERTYPE_IP6 0x86dd
diff --git a/ctdb/common/system_kfreebsd.c b/ctdb/common/system_kfreebsd.c
index d02f28659cb..67c2aa06043 100644
--- a/ctdb/common/system_kfreebsd.c
+++ b/ctdb/common/system_kfreebsd.c
@@ -40,6 +40,7 @@
#include "common/logging.h"
#include "common/system.h"
+#include "common/system_socket.h"
#ifndef ETHERTYPE_IP6
#define ETHERTYPE_IP6 0x86dd
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index fa77a45460f..d8f53ea8ea0 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -37,6 +37,7 @@
#include "common/logging.h"
#include "common/system.h"
+#include "common/system_socket.h"
#ifndef ETHERTYPE_IP6
#define ETHERTYPE_IP6 0x86dd
diff --git a/ctdb/common/system_common.c b/ctdb/common/system_socket.c
index 49afbf34469..b2af6582c97 100644
--- a/ctdb/common/system_common.c
+++ b/ctdb/common/system_socket.c
@@ -1,4 +1,4 @@
-/*
+/*
ctdb system specific code to manage raw sockets on linux
Copyright (C) Ronnie Sahlberg 2007
@@ -8,12 +8,12 @@
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/>.
*/
@@ -26,7 +26,7 @@
#include "protocol/protocol.h"
#include "common/logging.h"
-#include "common/system.h"
+#include "common/system_socket.h"
/*
uint16 checksum for n bytes
@@ -45,11 +45,9 @@ uint32_t uint16_checksum(uint16_t *data, size_t n)
return sum;
}
-/*
- see if we currently have an interface with the given IP
- we try to bind to it, and if that fails then we don't have that IP
- on an interface
+/*
+ * See if the given IP is currently on an interface
*/
bool ctdb_sys_have_ip(ctdb_sock_addr *_addr)
{
diff --git a/ctdb/common/system_socket.h b/ctdb/common/system_socket.h
new file mode 100644
index 00000000000..aaa7f16e993
--- /dev/null
+++ b/ctdb/common/system_socket.h
@@ -0,0 +1,28 @@
+/*
+ System specific network code
+
+ 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_SYSTEM_SOCKET_H__
+#define __CTDB_SYSTEM_SOCKET_H__
+
+#include "protocol/protocol.h"
+
+uint32_t uint16_checksum(uint16_t *data, size_t n);
+bool ctdb_sys_have_ip(ctdb_sock_addr *addr);
+
+#endif /* __CTDB_SYSTEM_SOCKET_H__ */