From 29e80de7214199500b56e4ac3a667a40df1a7f20 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Tue, 4 Apr 2017 12:44:16 +0300 Subject: ipoe: included lua bitop library Included bitop library http://bitop.luajit.org/index.html It may be used to extract vlan components in username function: function username(ses) vid=ses:vlan() svid=bit.rshift(vid,16) cvid=bit.band(vid,0xffff) ... end --- accel-pppd/ctrl/ipoe/lua.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'accel-pppd/ctrl/ipoe/lua.c') diff --git a/accel-pppd/ctrl/ipoe/lua.c b/accel-pppd/ctrl/ipoe/lua.c index f078506..d5f9e95 100644 --- a/accel-pppd/ctrl/ipoe/lua.c +++ b/accel-pppd/ctrl/ipoe/lua.c @@ -35,6 +35,7 @@ static int packet4_agent_remote_id(lua_State *L); static int packet4_vlan(lua_State *L); int luaopen_lpack(lua_State *L); +int luaopen_bit(lua_State *L); static const struct luaL_reg packet4_lib [] = { {"hdr", packet4_hdr}, @@ -193,6 +194,7 @@ static void init_lua() luaL_openlibs(L); luaopen_lpack(L); + luaopen_bit(L); luaopen_packet4(L); if (luaL_loadfile(L, conf_filename)) -- cgit v1.2.3