summaryrefslogtreecommitdiff
path: root/lib/lua.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-11-07 09:14:32 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-09-26 21:21:23 -0400
commit1d7c7ace3c08fd1986143f37063114594fb91069 (patch)
tree1b5b0c476375dfeb00f3b0be0167f9911a8734c7 /lib/lua.c
parent634949aef8ffbd504fe6337a4668de4b9b8b3941 (diff)
bgpd: Add lua match command
Please note this is a Proof of Concept and not actually something that is ready to commit at this point. The file tools/lua.scr contains some documentation on how we expect it to work currently. Additionally not all bgp values have been hooked up into the ability to lua script yet. There is still significant work to be done here: 1) Add the ability to pass in more data and to adjust the return values as appropriate. To set it up: 1) copy tools/lua.scr into /etc/frr (or whereever the config directory is ) 2) Create a route-map match command: ! router bgp 55 neighbor 10.50.11.116 remote-as external ! address-family ipv4 unicast neighbor 10.50.11.116 route-map TEST in exit-address-family ! route-map TEST permit 10 match command mooey ! 3) In the lua.scr file make sure that you have a function named 'mooey' ( as the above example does ): function mooey () zlog_debug(string.format("Family: %d: %s %d ifindex: %d aspath: %s localpref: %d", prefix.family, prefix.route, nexthop.metric, nexthop.ifindex, nexthop.aspath, nexthop.localpref)) nexthop.metric = 33 nexthop.localpref = 13 return 3 end This example script modifies the metric and localpref currently. I've also provided a zlog_debug function in lua to allow some simple debugging. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/lua.c')
0 files changed, 0 insertions, 0 deletions