Go to file
Quentin Young f869ab17a7 lib: add ability to decode from lua scripts
This implements the ability to get results out from lua scripts after
they've run.

For each C type we support passing to Lua, there is a corresponding
`struct frrscript_codec`. This struct contains a typename field - just a
string identifying the type - and two function pointers. The first
function pointer, encode, takes a lua_State and a pointer to the C value
and pushes some corresponding Lua representation onto the stack. The
second, decode, assumes there is some Lua value on the stack and decodes
it into the corresponding C value.

Each supported type's `struct frrscript_codec` is registered with the
scripting stuff in the library, which creates a mapping between the type
name (string) and the `struct frrscript_codec`. When calling a script,
you specify arguments by passing an array of `struct frrscript_env`.
Each of these structs has a void *, a type name, and a desired binding
name. The type names are used to look up the appropriate function to
encode the pointed-at value onto the Lua stack, then bind the pushed
value to the provided binding name, so that the converted value is
accessible by that name within the script.

Results work in a similar way. After a script runs, call
frrscript_get_result() with the script and a `struct frrscript_env`.
The typename and name fields are used to fetch the Lua value from the
script's environment and use the registered decoder for the typename to
convert the Lua value back into a C value, which is returned from the
function. The caller is responsible for freeing these.

frrscript_call()'s macro foo has been stripped, as the underlying
function now takes fixed arrays. varargs have awful performance
characteristics, they're hard to read, and structs are more defined than
an order sensitive list.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
.github .github: improve bug report template 2020-10-20 16:12:03 -04:00
alpine alpine: Remove old docker deps for alpine 2020-10-22 03:03:53 -04:00
babeld babeld: Free ifc leak 2020-11-14 21:19:42 -05:00
bfdd bfdd: session specific command type checks 2020-12-01 08:01:37 -03:00
bgpd lib: cleanup / refactor scripting foo 2020-12-01 18:37:14 -05:00
debian *: add Lua 5.3 as a dependency 2020-12-01 18:37:14 -05:00
doc Merge pull request #7632 from idryzhov/vtysh-memory-fixes 2020-12-01 12:08:52 -05:00
docker docker: don't fail on chown /etc/frr 2020-06-10 00:20:04 -04:00
eigrpd bgpd: Advertise FIB installed routes to bgp peers (Part 1) 2020-11-06 08:39:28 +05:30
fpm *: Replace sizeof something to sizeof(something) 2020-03-08 21:44:53 +02:00
gdb bgpd: Convert binfo to path 2018-10-09 14:26:30 -04:00
grpc lib: don't ignore error messages generated during the commit apply phase 2020-08-14 21:37:14 -03:00
include include: Update rtnetlink.h 2020-11-15 10:12:50 -05:00
isisd isisd, tests: fix bug when sending TI-LFA repair paths to zebra 2020-11-23 15:22:36 -03:00
ldpd ldpd: Prevent usage after free 2020-11-26 18:28:48 -05:00
lib lib: add ability to decode from lua scripts 2020-12-01 18:37:14 -05:00
m4 build: find all future minor versions of python3 2020-07-09 06:47:31 +02:00
mlag zebra: Do not build mlag protobuf support if version 3 is not avail 2019-12-15 09:37:51 -05:00
nhrpd bgpd, lib, nhrpd, zebra: verify return of sockunion2hostprefix 2020-11-18 11:04:27 -05:00
ospf6d ospf6d: More lists being leaked 2020-11-19 08:04:51 -05:00
ospfclient ospfclient: replace inet_ntoa 2020-10-22 13:41:51 -04:00
ospfd Merge pull request #7620 from ckishimo/cosmetic2 2020-11-30 08:53:33 -03:00
pbrd *: Convert all usage of zclient_send_message to new enum 2020-11-15 15:04:52 -05:00
pimd Merge pull request #7601 from patrasar/pim_fix 2020-12-01 15:53:53 -05:00
pkgsrc *: cleanup .gitignore files 2018-09-08 21:30:42 +02:00
python *: reformat python files 2020-10-07 17:22:26 -04:00
qpb build: add LLVM bitcode targets 2020-05-05 14:39:12 +02:00
redhat redhat: Update changelog in frr.spec.in 2020-10-31 03:57:46 +01:00
ripd *: Remove route_map_object_t from the system 2020-11-13 19:35:20 -05:00
ripngd *: Remove route_map_object_t from the system 2020-11-13 19:35:20 -05:00
sharpd lib, sharpd, vtysh: When reading a file in for config send start/end indicators 2020-11-19 09:52:11 -05:00
snapcraft snapcraft: Update libyang version 2020-09-10 09:13:36 -04:00
staticd Merge pull request #7478 from donaldsharp/buffer 2020-11-18 08:30:47 -05:00
tests tests: Ignore YANG stderr messages in test_all_protocol_startup test 2020-11-27 19:45:15 +01:00
tools tools: Fix run folder permissions 2020-12-01 12:37:51 +01:00
vrrpd *: Convert all usage of zclient_send_message to new enum 2020-11-15 15:04:52 -05:00
vtysh vtysh: fix incorrect memory statistics 2020-11-30 18:55:40 +03:00
watchfrr *: unify thread/event cancel macros 2020-10-23 12:16:52 -04:00
yang yang: fix cisco access list source value 2020-11-27 21:53:25 +03:00
zebra Merge pull request #7617 from deastoe/dplane-fpm-lsp 2020-12-01 16:01:09 -03:00
.clang-format clang-format: add FOREACH_SAFI to the ForEachMacros list 2020-08-03 12:18:24 -03:00
.dir-locals.el tools: fix emacs configuration file 2019-11-04 11:45:52 -03:00
.dockerignore docker: Make docker image on CentOS 7 2019-11-26 19:29:30 +00:00
.git-blame-ignore-revs *: Consolidate on first git blame ignore revs 2020-10-13 16:07:18 -04:00
.gitignore Revert "debian: Adjust tarsource.sh to use native debian/changelog" 2020-11-19 17:12:41 -05:00
bootstrap.sh autoreconf -i 2007-02-06 19:28:28 +00:00
buildtest.sh config: switch a few references to say FRR 2017-07-12 11:25:33 -05:00
changelog-auto.in Revert "debian: Adjust tarsource.sh to use native debian/changelog" 2020-11-19 17:12:41 -05:00
config.version.in build: carry --with-pkg-extra-version into tarballs 2018-10-24 15:11:50 +02:00
configure.ac Merge pull request #7475 from eololab/add-more-parameters-for-crosscompilation 2020-11-24 11:44:29 -05:00
COPYING *: make consistent & update GPLv2 file headers 2017-05-15 16:37:41 +02:00
COPYING-LGPLv2.1 build: remove LGPL v2.0, add LGPL v2.1 2016-11-15 17:19:38 +09:00
Makefile.am Revert "debian: Adjust tarsource.sh to use native debian/changelog" 2020-11-19 17:12:41 -05:00
README.md doc: Update Documentation to note Solaris Unsupported status 2020-09-21 10:02:20 -04:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00

Icon

FRRouting

FRR is free software that implements and manages various IPv4 and IPv6 routing protocols. It runs on nearly all distributions of Linux and BSD and supports all modern CPU architectures.

FRR currently supports the following protocols:

  • BGP
  • OSPFv2
  • OSPFv3
  • RIPv1
  • RIPv2
  • RIPng
  • IS-IS
  • PIM-SM/MSDP
  • LDP
  • BFD
  • Babel
  • PBR
  • OpenFabric
  • VRRP
  • EIGRP (alpha)
  • NHRP (alpha)

Installation & Use

For source tarballs, see the releases page.

For Debian and its derivatives, use the APT repository at https://deb.frrouting.org/.

Instructions on building and installing from source for supported platforms may be found in the developer docs.

Once installed, please refer to the user guide for instructions on use.

Community

The FRRouting email list server is located here and offers the following public lists:

Topic List
Development dev@lists.frrouting.org
Users & Operators frog@lists.frrouting.org
Announcements announce@lists.frrouting.org

For chat, we currently use Slack. You can join by clicking the "Slack" link under the Participate section of our website.

Contributing

FRR maintains developer's documentation which contains the project workflow and expectations for contributors. Some technical documentation on project internals is also available.

We welcome and appreciate all contributions, no matter how small!

Security

To report security issues, please use our security mailing list:

security [at] lists.frrouting.org