A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rmind/liblpm below:

rmind/liblpm: Longest Prefix Match (LPM) library

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. Specifications to build RPM and DEB packages are also provided.

local lpm = require("lpm")

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

local addr, preflen = lpm.tobin("10.0.0.0/24")
if not acl:insert(addr, preflen, some_info) then
  print("acl:insert() failed")
  return -1
end

local ret = acl:lookup(lpm.tobin("10.0.0.100"))
print(ret.val)

See README how to build the JAR and the test case as example how to use the Java API

Just build the package, install it and link the library using the -llpm flag.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4