/*
* Emergency Access Daemon
- * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2008 Felix Fietkau <nbd@nbd.name>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
#include <t_sha.h>
#include <t_defines.h>
#include <t_server.h>
+#include <net/if.h>
#include "list.h"
#include "ead.h"
#include "ead-pcap.h"
#include "ead-crypt.h"
+#include "libbridge.h"
#include "filter.c"
-#ifdef linux
-#include "libbridge_init.c"
-#endif
-
#ifdef linux
#include <linux/if_packet.h>
#endif
char ifname[16];
int pid;
char id;
-#ifdef linux
char bridge[16];
bool br_check;
-#endif
};
static char ethmac[6] = "\x00\x13\x37\x00\x00\x00"; /* last 3 bytes will be randomized */
pcap_fp_rx = NULL;
do {
-#ifdef linux
if (instance->bridge[0]) {
pcap_fp_rx = ead_open_pcap(instance->bridge, errbuf, 1);
pcap_fp = ead_open_pcap(instance->ifname, errbuf, 0);
- } else
-#endif
- {
+ } else {
pcap_fp = ead_open_pcap(instance->ifname, errbuf, 1);
}
exit(1);
}
-#ifdef linux
static int
check_bridge_port(const char *br, const char *port, void *arg)
{
br_foreach_port(name, check_bridge_port, arg);
return 0;
}
-#endif
static void
check_all_interfaces(void)
{
-#ifdef linux
struct ead_instance *in;
struct list_head *p;
stop_server(in, false);
}
}
-#endif
}
nid = *(((u16_t *) ethmac) + 2);
start_servers(false);
-#ifdef linux
br_init();
-#endif
tv.tv_sec = 1;
tv.tv_usec = 0;
while (1) {
start_servers(true);
sleep(1);
}
-#ifdef linux
br_shutdown();
-#endif
return 0;
}