-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added eigennet legacy compatibility proto
- Loading branch information
Showing
3 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright (C) 2006-2014 OpenWrt.org | ||
# | ||
# This is free software, licensed under the GNU General Public License v3. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) | ||
LIME_CODENAME:=bigbang | ||
|
||
GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) | ||
GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) | ||
|
||
PKG_NAME:=lime-proto-eigennet | ||
PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/$(PKG_NAME) | ||
TITLE:=LiMe eigennet legacy compatibility proto support | ||
CATEGORY:=LiMe | ||
MAINTAINER:=Gioacchino Mazzurco <gio@eigenlab.org> | ||
URL:=http://libre-mesh.org | ||
DEPENDS:=+lua +libuci-lua +lime-system +lime-proto-batadv | ||
endef | ||
|
||
define Build/Compile | ||
@rm -rf ./build || true | ||
@cp -r ./src ./build | ||
@sed -i '/^--!.*/d' build/*.lua | ||
endef | ||
|
||
define Package/$(PKG_NAME)/install | ||
@mkdir -p $(1)/usr/lib/lua/lime/proto || true | ||
$(CP) ./build/eigennet.lua $(1)/usr/lib/lua/lime/proto/ | ||
endef | ||
|
||
$(eval $(call BuildPackage,$(PKG_NAME))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/lua | ||
|
||
local network = require("lime.network") | ||
local batadv = require("lime.proto.batadv") | ||
local libuci = require("uci") | ||
|
||
eigennet = {} | ||
|
||
function eigennet.setup_interface(ifname, args) | ||
if ifname:match("^wlan%d_ap") then return end | ||
|
||
if ifname:match("^eth%d$") then | ||
args[2] = args[2] or 10 | ||
args[3] = args[3] or "8021q" | ||
args[4] = args[4] or "_eigennet" | ||
|
||
batadv.setup_interface(ifname, args) | ||
return | ||
end | ||
|
||
if ifname:match("^wlan%d_adhoc$") then | ||
local owrtInterfaceName = network.limeIfNamePrefix..ifname | ||
|
||
local uci = libuci:cursor() | ||
|
||
uci:set("network", owrtInterfaceName, "interface") | ||
uci:set("network", owrtInterfaceName, "mtu", 1532) | ||
uci:set("network", owrtInterfaceName, "proto", "batadv") | ||
uci:set("network", owrtInterfaceName, "mesh", "bat0") | ||
uci:set("network", owrtInterfaceName, "eigennet", "1") | ||
|
||
uci:save("network") | ||
end | ||
end | ||
|
||
function eigennet.clean() | ||
batadv.clean() | ||
end | ||
|
||
function eigennet.configure(args) | ||
batadv.configure(args) | ||
end | ||
|
||
|
||
return eigennet |