mirror of
https://github.com/novatiq/packages.git
synced 2026-07-30 15:23:07 +01:00
dcwifi: Add Dual Channel Wi-Fi component packages
dcstad: Dual Channel Wi-Fi Station Daemon dcwapd: Dual Channel Wi-Fi Access Point Daemon libdcwproto: Dual Channel Wi-Fi Protocol Library libdcwsocket: Dual Channel Wi-Fi Socket Library macremapper: MAC Address Remapper Linux Kernel Module mrmctl: Userland tool to get/set remap rules Signed-off-by: Carey Sonsino <careys@edgewaterwireless.com> Signed-off-by: Carey Sonsino <csonsino@gmail.com> Much help from @neheb
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Copyright (C) 2019 EWSI
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdcwsocket
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ewsi/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_HASH:=c7f6c69a5246fe1f184c21585f0805ceaca09c3c087ae439ded7ed4d25c7a3fa
|
||||
|
||||
PKG_MAINTAINER:=Carey Sonsino <careys@edgewaterwireless.com>
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libdcwsocket
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=Networking
|
||||
TITLE:=Dual-Channel socket library
|
||||
URL:=https://www.edgewaterwireless.com
|
||||
endef
|
||||
|
||||
define Package/libdcwsocket/description
|
||||
User-land C library for sending and receiving DCW "EtherType"d messages
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -std=c89 -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libdcwsocket/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
# Note: $(INSTALL_BIN) does not keep symlinks, so use $(CP)
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libdcwsocket))
|
||||
@@ -0,0 +1,45 @@
|
||||
--- a/src/dcwsocket.c.linux
|
||||
+++ b/src/dcwsocket.c.linux
|
||||
@@ -100,10 +100,10 @@ dcwsock_open(const char * const ifname) {
|
||||
}
|
||||
|
||||
/* sanitize our data structs... defensive */
|
||||
- bzero(rv, sizeof(*rv));
|
||||
- bzero(&ifr, sizeof(ifr));
|
||||
- bzero(&sall, sizeof(sall));
|
||||
- bzero(&sfp, sizeof(sfp));
|
||||
+ memset(rv, 0, sizeof(*rv));
|
||||
+ memset(&ifr, 0, sizeof(ifr));
|
||||
+ memset(&sall, 0, sizeof(sall));
|
||||
+ memset(&sfp, 0, sizeof(sfp));
|
||||
|
||||
/* open a raw socket... "ETH_P_ALL" says take EVERYTHING
|
||||
(this means that it is IMPERATIVE to apply a filter)
|
||||
diff --git a/src/dcwsocket.c.osx b/src/dcwsocket.c.osx
|
||||
index abead10..75cda2f 100644
|
||||
--- a/src/dcwsocket.c.osx
|
||||
+++ b/src/dcwsocket.c.osx
|
||||
@@ -90,10 +90,10 @@ dcwsock_open(const char * const ifname) {
|
||||
}
|
||||
|
||||
/* sanitize our data structs... defensive */
|
||||
- bzero(rv, sizeof(*rv));
|
||||
- bzero(&dmx_desc, sizeof(dmx_desc));
|
||||
- bzero(&proto_desc, sizeof(proto_desc));
|
||||
- bzero(&snd, sizeof(snd));
|
||||
+ memset(rv, 0, sizeof(*rv));
|
||||
+ memset(&dmx_desc, 0, sizeof(dmx_desc));
|
||||
+ memset(&proto_desc, 0, sizeof(proto_desc));
|
||||
+ memset(&snd, 0, sizeof(snd));
|
||||
|
||||
/* open a "NDRV" socket... */
|
||||
rv->fd = socket(PF_NDRV, SOCK_RAW, 0);
|
||||
@@ -201,7 +201,7 @@ dcwsock_send( dcw_socket_t s, const void * const buf, const unsigned buf_size, c
|
||||
fill out a link-level sockaddr cause we can only
|
||||
use sendto() with PF_NDRV...
|
||||
*/
|
||||
- bzero(&sdl, sizeof(sdl));
|
||||
+ memset(&sdl, 0, sizeof(sdl));
|
||||
sdl.sdl_len = sizeof(sdl);
|
||||
sdl.sdl_index = 0;
|
||||
sdl.sdl_type = IFT_ETHER;
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/src/dcwsocket.c.linux
|
||||
+++ b/src/dcwsocket.c.linux
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
+#include <linux/if.h>
|
||||
#include <linux/if_packet.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/filter.h>
|
||||
Reference in New Issue
Block a user