*/
-#include "includes.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include "lib/util/debug.h"
+
+#include "protocol/protocol.h"
+
#include <netinet/if_ether.h>
#include <netinet/ip6.h>
#include <net/if_arp.h>
#include <sys/kinfo.h>
#include <pcap.h>
+#include "common/logging.h"
+#include "common/system.h"
#if 0
int s, ret;
uint32_t one = 1;
- s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+ s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
if (s == -1) {
DEBUG(DEBUG_CRIT,(" failed to open raw socket (%s)\n",
strerror(errno)));
- s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+ s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
if (s == -1) {
DEBUG(DEBUG_CRIT,(" failed to open raw socket (%s)\n",
strerror(errno)));
*/
int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
{
- /* We dont do grat arp on aix yet */
- return 0;
+ /* FIXME AIX: We don't do gratuitous arp yet */
+ return -1;
}
}
+bool ctdb_sys_check_iface_exists(const char *iface)
+{
+ /* FIXME AIX: Interface always considered present */
+ return true;
+}
+int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
+{
+ struct peercred_struct cr;
+ socklen_t crl = sizeof(struct peercred_struct);
+ int ret;
+ if ((ret = getsockopt(fd, SOL_SOCKET, SO_PEERID, &cr, &crl) == 0)) {
+ *peer_pid = cr.pid;
+ }
+ return ret;
+}