diff --git a/Makefile b/Makefile index 0eb71a1..ffbbf72 100755 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ MANPAGE = man/batctl.8 # batctl flags and options CFLAGS += -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP -CPPFLAGS += -D_GNU_SOURCE +CPPFLAGS += -D_GNU_SOURCE -Ikernelinc LDLIBS += -lm # disable verbose output diff --git a/kernelinc/linux/bitops.h b/kernelinc/linux/bitops.h new file mode 100644 index 0000000..d41db10 --- /dev/null +++ b/kernelinc/linux/bitops.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2009-2014 B.A.T.M.A.N. contributors: + * + * Marek Lindner + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA + * + */ + +#ifndef _BATCTL_KERNELINC_LINUX_BITOPS_H +#define _BATCTL_KERNELINC_LINUX_BITOPS_H + +#define BIT(nr) (1UL << (nr)) + +#endif diff --git a/main.h b/main.h index 461f3e3..248467c 100644 --- a/main.h +++ b/main.h @@ -36,17 +36,6 @@ #define DEBUG_TABLE_PATH_MAX_LEN 20 #define SETTINGS_PATH_MAX_LEN 25 -#if BYTE_ORDER == BIG_ENDIAN -#define __BIG_ENDIAN_BITFIELD -#elif BYTE_ORDER == LITTLE_ENDIAN -#define __LITTLE_ENDIAN_BITFIELD -#else -#error "unknown endianess" -#endif - -#define __packed __attribute((packed)) /* linux kernel compat */ -#define BIT(nr) (1UL << (nr)) /* linux kernel compat */ - extern char module_ver_path[]; #ifndef VLAN_VID_MASK diff --git a/packet.h b/packet.h index b81fbbf..27b4003 100644 --- a/packet.h +++ b/packet.h @@ -18,6 +18,11 @@ #ifndef _NET_BATMAN_ADV_PACKET_H_ #define _NET_BATMAN_ADV_PACKET_H_ +#include +#include +#include +#include + /** * enum batadv_packettype - types for batman-adv encapsulated packets * @BATADV_IV_OGM: originator messages for B.A.T.M.A.N. IV diff --git a/sys.c b/sys.c index 676bef1..6c0cab4 100644 --- a/sys.c +++ b/sys.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "main.h" #include "sys.h"