diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2015-12-01 18:43:11 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-12-01 18:43:11 +0300 |
commit | b1c5ae767273119283089b35a79f1a64952234af (patch) | |
tree | 5237c6ecf92b4c68836199d002d86fdf039bbe32 /accel-pppd/ctrl/ipoe/ipoe.c | |
parent | e6c5b180e9b3fe0afac48bffe80522813a35b405 (diff) | |
download | accel-ppp-xebd-b1c5ae767273119283089b35a79f1a64952234af.tar.gz accel-ppp-xebd-b1c5ae767273119283089b35a79f1a64952234af.zip |
ipoe: implemented ability to use lua to make vlan name
[ipoe]
vlan-name=lua:make_vlan_name
lua function accepts three arguments: parent interface name, parent vlan number and vlan number caused vlan creation
sample lua function:
function make_vlan_name(ifname, svid, cvid)
print('make_vlan_name: '..ifname..','..svid..','..cvid)
return ifname..'.'..cvid
end
Diffstat (limited to 'accel-pppd/ctrl/ipoe/ipoe.c')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 9e1a989..e843b50 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2245,6 +2245,11 @@ static int make_vlan_name(const char *parent, int svid, int cvid, char *name) const char *ptr2 = conf_vlan_name; char svid_str[5], cvid_str[5], *ptr3; +#ifdef USE_LUA + if (!memcmp(conf_vlan_name, "lua:", 4)) + return ipoe_lua_make_vlan_name(conf_vlan_name + 4, parent, svid, cvid, name); +#endif + sprintf(svid_str, "%i", svid); sprintf(cvid_str, "%i", cvid); |