bbc/liblpm

Name: liblpm

Owner: BBC

Description: Longest Prefix Match (LPM) library

Forked from: rmind/liblpm

Created: 2017-09-11 09:24:07.0

Updated: 2017-09-11 09:24:09.0

Pushed: 2017-09-26 10:41:46.0

Homepage:

Size: 54

Language: C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Longest Prefix Match (LPM) library

Longest Prefix Match (LPM) library supporting IPv4 and IPv6. The implementation is written in C99 and is distributed under the 2-clause BSD license. Additionally, bindings are available for Lua and Java.

Build Status

API
Lua example
l lpm = require("lpm")

l acl = lpm.new()
l some_info = { val = "test" }

l addr, preflen = lpm.tobin("10.0.0.0/24")
ot acl:insert(addr, preflen, some_info) then
int("acl:insert() failed")
turn -1


l ret = acl:lookup(lpm.tobin("10.0.0.100"))
t(ret.val)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.