[luci] Use of luci.ip.cidr ?
Bryan Mayland
bmayland at leoninedev.com
Mon Jan 20 20:40:05 CET 2014
luci.ip.cidr is the index of the IPv4 object table, so the methods are
already included on your myip object:
print(myip:add(1):string())
Note that add() returns a new IPv4 address unless you pass the "inplace"
parameter:
myip:add(1, true)
print(myip:string())
On 1/20/2014 2:23 PM, Ken Bantoft wrote:
> Hi List,
>
> I¹m trying to figure out how to use the luci.ip.cidr object. I¹ve looked
> through the LuCI source, and the only references seem to be within the
> ip.lua library itself. Other modules seem to take their own approaches
> (olsr and meshwizard )
>
> What I¹m trying to do it simply increment an IP address by 1, which I
> thought should be something likeŠ
>
>
> local ipc = require "luci.ip"
>
>
> local myip = ipc.IPv4(³192.168.0.0/24²)
> myip.cidr:add(1)
>
>
> However that just fails with attempt to index field 'cidr' (a nil value).
> Can someone point me in the syntactically correct direction?
>
> Thanks,
>
> Ken
>
>
>
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci
>
More information about the luci
mailing list