Skip to content

Commit

Permalink
added qmp legacy compatibility proto
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck authored and frank95 committed Aug 9, 2014
1 parent 16a1d77 commit d0b93ad
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/lime-proto-bmx6/src/bmx6.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ local libuci = require("uci")
bmx6 = {}

function bmx6.setup_interface(ifname, args)
if not args[2] then return end
vlanId = args[2] or 13
vlanProto = args[3] or "8021ad"
nameSuffix = args[4] or "_bmx6"

local owrtInterfaceName, linux802adIfName, owrtDeviceName = network.createVlanIface(ifname, args[2], "_bmx6")
local owrtInterfaceName, linux802adIfName, owrtDeviceName = network.createVlanIface(ifname, vlanId, nameSuffix, vlanProto)

local uci = libuci:cursor()
uci:set("network", owrtDeviceName, "mtu", "1398")
Expand Down
40 changes: 40 additions & 0 deletions packages/lime-proto-qmp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# 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-qmp
PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP)

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)
TITLE:=LiMe qmp proto legacy compatibility support
CATEGORY:=LiMe
MAINTAINER:=Gioacchino Mazzurco <gio@eigenlab.org>
URL:=http://libre-mesh.org
DEPENDS:=+lime-system +lime-proto-bmx6 +lua +libuci-lua
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/qmp.lua $(1)/usr/lib/lua/lime/proto/
endef

$(eval $(call BuildPackage,$(PKG_NAME)))

27 changes: 27 additions & 0 deletions packages/lime-proto-qmp/src/qmp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/lua

local bmx6 = require("lime.proto.bmx6")

qmp = {}

function qmp.setup_interface(ifname, args)
args[2] = args[2] or 12
args[3] = args[3] or "8021q"
args[4] = args[4] or "_qmp"

bmx6.setup_interface(ifname, args)
end

function qmp.clean()
bmx6.clean()
end

function qmp.configure(args)
bmx6.configure(args)
end

function qmp.apply()
bmx6.apply()
end

return qmp
2 changes: 1 addition & 1 deletion packages/lime-system/files/etc/config/lime-defaults
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config lime network
list protocols lan
list protocols anygw
list protocols batadv:11
list protocols bmx6:12
list protocols bmx6:13
list resolvers 8.8.8.8 # DNS servers node will use
list resolvers 2001:4860:4860::8844

Expand Down

0 comments on commit d0b93ad

Please sign in to comment.