Skip to content

Commit

Permalink
Merge pull request #1467 from snabbco/next
Browse files Browse the repository at this point in the history
Snabb 2022.01 “Octarina”
  • Loading branch information
eugeneia authored Jan 21, 2022
2 parents 4b0c18b + d270298 commit 7544c53
Show file tree
Hide file tree
Showing 160 changed files with 9,772 additions and 706 deletions.
12 changes: 12 additions & 0 deletions lib/ljsyscall/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.*
*.md
COPYRIGHT
ChangeLog
Dockerfile
INSTALL
doc
*.yml
examples
include
rockspec
test
9 changes: 9 additions & 0 deletions lib/ljsyscall/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ tmp/*
*.core
ktrace.out
obj/*

/5.1-ljsyscall
/debian/debhelper-build-stamp
/debian/files
/debian/lua-ljsyscall*
/debian/lua_versions
/debian/tmp
/debian/trash

14 changes: 9 additions & 5 deletions lib/ljsyscall/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
language: c
sudo: required
dist: trusty

addons:
apt:
packages:
- luajit
- luarocks
- strace

before_install:
- sudo add-apt-repository ppa:mwild1/ppa -y
- sudo apt-get update -y
- sudo apt-get install luajit -y --force-yes
- sudo apt-get install luarocks -y
- sudo apt-get install strace -y
- git submodule update --init --recursive

env:
Expand Down
2 changes: 1 addition & 1 deletion lib/ljsyscall/COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Files under the include directory include their own copyright information.

ljsyscall: System call interface for LuaJIT

Copyright (C) 2011-2014 Justin Cormack. All rights reserved.
Copyright (C) 2011-2016 Justin Cormack. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 11 additions & 2 deletions lib/ljsyscall/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
unreleased
0.12 release

+ Fix seccomp on arm64
+ Linux added support for eBPF
+ bug fixes

0.11 release

+ OSX time functions
+ OSX Mach types
+ OSX fixes for Yosemite
+ arm64 support
+ OpenBSD 5.6 and 5.7 support
+ OpenBSD 5.6, 5.7 and 5.8 support
+ ppc64le support, by Gustavo Serra Scalet
+ mipsel support
+ added Dockerfile, now available on Docker Hub

0.10 release

Expand Down
4 changes: 4 additions & 0 deletions lib/ljsyscall/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM alpine:3.4
RUN apk update && apk add luajit luajit-dev strace && mkdir -p /usr/share/lua/5.1
COPY . /usr/share/lua/5.1/
ENTRYPOINT ["luajit"]
5 changes: 4 additions & 1 deletion lib/ljsyscall/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ The [video of my FOSDEM 2013 talk](http://www.myriabit.com/ljsyscall/) here, and

## Install

A Docker hub automated build (currently only for Linux) is available via `docker pull justincormack/ljsyscall`. You can run the test suite with `docker run justincormack/ljsyscall test/test.lua`, use in a scripted way eg `docker run justincormack/ljsyscall -e "print(require('syscall').nl.interfaces())"` or get an interactive session with `docker -it run justincormack/ljsyscall`.

The stable release is now available in the luarocks repository, so you should be able to run ```luarocks install ljsyscall```. There will be a ```ljsyscall-rump``` rock soon, but I need to fix the install for the rump libraries.

For simple uses, you just need to put the ```.lua``` files somewhere that LuaJIT will find them, eg typically in ```/usr/local/share/lua/5.1/```. Keep the directory structure there is. You can safely remove files from architectures and operating systems you do not use.

You can also install the head version using luarocks: ```luarocks install rockspec/ljsyscall-scm-1.rockspec``` .

It is also available as a package in [buildroot](http://buildroot.uclibc.org/), a build system for embedded systems, and in [pkgsrc](http://www.pkgsrc.org] the portable packaging system for many systems.
It is also available as a package in [buildroot](http://buildroot.uclibc.org/), a build system for embedded systems, and in [pkgsrc](http://www.pkgsrc.org] the portable packaging system for many systems. It is now packaged for [Alpine Linux](http://www.alpinelinux.org/), in the testing repository.

If you are using Lua rather than LuaJIT you need to install [luaffi](https://github.com/jmckaskill/luaffi) first; this is largely working now, but there will be more support for standard Lua coming soon.

Expand Down Expand Up @@ -66,6 +68,7 @@ This project is being used in a variety of places, such as for testing the Linux
* [buildroot](http://buildroot.uclibc.org/) has an ljsyscall package.
* [luatz](https://github.com/daurnimator/luatz) uses ljsyscall when available
* [Snabb switch](https://github.com/SnabbCo/snabbswitch) a high performance networking toolkit.
* [Spook](https://github.com/johnae/spook) started out as an fs events based test runner similar to Rubys guard but grew into an event toolkit of sorts.

## Testing

Expand Down
5 changes: 5 additions & 0 deletions lib/ljsyscall/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lua-ljsyscall (0.12-1) unstable; urgency=medium

* UNRELEASED

-- John Doe <[email protected]> Sun, 23 Jul 2017 19:43:15 +0200
1 change: 1 addition & 0 deletions lib/ljsyscall/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
25 changes: 25 additions & 0 deletions lib/ljsyscall/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Source: lua-ljsyscall
Section: interpreters
Priority: optional
Maintainer: nobody
Build-Depends: debhelper (>= 9), dh-lua
Standards-Version: 4.0.0
Homepage: http://www.myriabit.com/ljsyscall/

Package: lua-ljsyscall
Architecture: all
Pre-Depends: ${misc:Pre-Depends}
Depends: luajit, ${misc:Depends}
Provides: ${lua:Provides}
XB-Lua-Versions: ${lua:Versions}
Description: LuaJIT Linux syscall FFI

Package: lua-ljsyscall-dev
Section: libdevel
Architecture: all
Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends}
Provides: ${lua:Provides}
XB-Lua-Versions: ${lua:Versions}
Description: ljsyscall doc
This package contains the documentation of the ljsyscall library.
30 changes: 30 additions & 0 deletions lib/ljsyscall/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ljsyscall
Source: https://github.com/justincormack/ljsyscall

Files: *
Copyright: Copyright (C) 2011-2016 Justin Cormack. All rights reserved.
License: Expat

Files: */doc
Copyright: Copyright (C) 2011-2016 Justin Cormack. All rights reserved.
License: CC0

License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 24 additions & 0 deletions lib/ljsyscall/debian/dh-lua.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### mandatory fields
LUA_VERSION=5.1
PKG_NAME=ljsyscall

### things relative to the C library part
CLIB_CFLAGS=
CLIB_LDFLAGS=
CLIB_LDFLAGS_STATIC=
CLIB_OBJS=
LUA_MODNAME_CPART=

### things relative to the lua library part
LUA_HEADER=
LUA_SOURCES=syscall.lua syscall/*.lua syscall/shared/*.lua syscall/linux/*.lua syscall/linux/*/*.lua
LUA_SOURCES_MANGLER=
LUA_MODNAME=syscall
LUA_TEST=

### this part is relative to pkg-config
PKG_VERSION=
PKG_LIBS_PRIVATE=
PKG_URL=
PKG_REQUIRES=
PKG_CONFLICTS=
2 changes: 2 additions & 0 deletions lib/ljsyscall/debian/lua-ljsyscall-dev.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doc
test
Empty file.
4 changes: 4 additions & 0 deletions lib/ljsyscall/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/make -f

%:
dh $@ --buildsystem=lua --with lua
1 change: 1 addition & 0 deletions lib/ljsyscall/debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
3 changes: 3 additions & 0 deletions lib/ljsyscall/debian/tests/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Tests: dh-lua-tests
Restrictions: rw-build-tree
Depends: @, dh-lua
1 change: 1 addition & 0 deletions lib/ljsyscall/debian/tests/dh-lua-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debian/rules autopkgtest
6 changes: 6 additions & 0 deletions lib/ljsyscall/debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# test this watch file using:
# uscan --watchfile debian/watch --upstream-version 0.1 --package lua-ljsyscall
#
version=3
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/ljsyscall-$1\.tar\.gz/ \
https://github.com/justincormack/ljsyscall/releases .*/v?(\d\S*)\.tar\.gz
5 changes: 5 additions & 0 deletions lib/ljsyscall/docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sut:
build: .
command: /test/test.lua
volumes:
- ./test:/test
170 changes: 170 additions & 0 deletions lib/ljsyscall/rockspec/ljsyscall-0.11-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
package = "ljsyscall"
version = "0.11-1"
source =
{
url = "https://github.com/justincormack/ljsyscall/archive/v0.11.tar.gz";
dir = "ljsyscall-0.11";
}

description =
{
summary = "LuaJIT Linux syscall FFI";
homepage = "http://www.myriabit.com/ljsyscall/";
license = "MIT";
}
dependencies =
{
"lua == 5.1"; -- In fact this should be "luajit >= 2.0.0"
}
build =
{
type = "builtin";
modules =
{
["syscall"] = "syscall.lua";
["syscall.abi"] = "syscall/abi.lua";
["syscall.helpers"] = "syscall/helpers.lua";
["syscall.syscalls"] = "syscall/syscalls.lua";
["syscall.libc"] = "syscall/libc.lua";
["syscall.methods"] = "syscall/methods.lua";
["syscall.ffitypes"] = "syscall/ffitypes.lua";
["syscall.util"] = "syscall/util.lua";
["syscall.compat"] = "syscall/compat.lua";
["syscall.bit"] = "syscall/bit.lua";
["syscall.types"] = "syscall/types.lua";
["syscall.lfs"] = "syscall/lfs.lua";

["syscall.shared.types"] = "syscall/shared/types.lua";
};
platforms =
{
linux =
{
modules = {
["syscall.linux.syscalls"] = "syscall/linux/syscalls.lua";
["syscall.linux.c"] = "syscall/linux/c.lua";
["syscall.linux.constants"] = "syscall/linux/constants.lua";
["syscall.linux.ffi"] = "syscall/linux/ffi.lua";
["syscall.linux.ioctl"] = "syscall/linux/ioctl.lua";
["syscall.linux.types"] = "syscall/linux/types.lua";
["syscall.linux.fcntl"] = "syscall/linux/fcntl.lua";
["syscall.linux.errors"] = "syscall/linux/errors.lua";
["syscall.linux.util"] = "syscall/linux/util.lua";
["syscall.linux.nr"] = "syscall/linux/nr.lua";

["syscall.linux.nl"] = "syscall/linux/nl.lua";
["syscall.linux.netfilter"] = "syscall/linux/netfilter.lua";
["syscall.linux.sockopt"] = "syscall/linux/sockopt.lua";
["syscall.linux.cgroup"] = "syscall/linux/cgroup.lua";

["syscall.linux.arm.constants"] = "syscall/linux/arm/constants.lua";
["syscall.linux.arm.ffi"] = "syscall/linux/arm/ffi.lua";
["syscall.linux.arm.ioctl"] = "syscall/linux/arm/ioctl.lua";
["syscall.linux.arm.nr"] = "syscall/linux/arm/nr.lua";
["syscall.linux.arm64.constants"] = "syscall/linux/arm64/constants.lua";
["syscall.linux.arm64.ffi"] = "syscall/linux/arm64/ffi.lua";
["syscall.linux.arm64.ioctl"] = "syscall/linux/arm64/ioctl.lua";
["syscall.linux.arm64.nr"] = "syscall/linux/arm64/nr.lua";
["syscall.linux.mips.constants"] = "syscall/linux/mips/constants.lua";
["syscall.linux.mips.ffi"] = "syscall/linux/mips/ffi.lua";
["syscall.linux.mips.ioctl"] = "syscall/linux/mips/ioctl.lua";
["syscall.linux.mips.nr"] = "syscall/linux/mips/nr.lua";
["syscall.linux.ppc.constants"] = "syscall/linux/ppc/constants.lua";
["syscall.linux.ppc.ffi"] = "syscall/linux/ppc/ffi.lua";
["syscall.linux.ppc.ioctl"] = "syscall/linux/ppc/ioctl.lua";
["syscall.linux.ppc.nr"] = "syscall/linux/ppc/nr.lua";
["syscall.linux.ppc64le.constants"] = "syscall/linux/ppc64le/constants.lua";
["syscall.linux.ppc64le.ffi"] = "syscall/linux/ppc64le/ffi.lua";
["syscall.linux.ppc64le.ioctl"] = "syscall/linux/ppc64le/ioctl.lua";
["syscall.linux.ppc64le.nr"] = "syscall/linux/ppc64le/nr.lua";
["syscall.linux.x64.constants"] = "syscall/linux/x64/constants.lua";
["syscall.linux.x64.ffi"] = "syscall/linux/x64/ffi.lua";
["syscall.linux.x64.ioctl"] = "syscall/linux/x64/ioctl.lua";
["syscall.linux.x64.nr"] = "syscall/linux/x64/nr.lua";
["syscall.linux.x86.constants"] = "syscall/linux/x86/constants.lua";
["syscall.linux.x86.ffi"] = "syscall/linux/x86/ffi.lua";
["syscall.linux.x86.ioctl"] = "syscall/linux/x86/ioctl.lua";
["syscall.linux.x86.nr"] = "syscall/linux/x86/nr.lua";
}
};
macosx =
{
modules =
{
["syscall.osx.syscalls"] = "syscall/osx/syscalls.lua";
["syscall.osx.c"] = "syscall/osx/c.lua";
["syscall.osx.constants"] = "syscall/osx/constants.lua";
["syscall.osx.ffi"] = "syscall/osx/ffi.lua";
["syscall.osx.ioctl"] = "syscall/osx/ioctl.lua";
["syscall.osx.types"] = "syscall/osx/types.lua";
["syscall.osx.fcntl"] = "syscall/osx/fcntl.lua";
["syscall.osx.errors"] = "syscall/osx/errors.lua";
["syscall.osx.util"] = "syscall/osx/util.lua";
["syscall.osx.sysctl"] = "syscall/osx/sysctl.lua";
}
};
freebsd =
{
modules =
{
["syscall.freebsd.syscalls"] = "syscall/freebsd/syscalls.lua";
["syscall.freebsd.c"] = "syscall/freebsd/c.lua";
["syscall.freebsd.constants"] = "syscall/freebsd/constants.lua";
["syscall.freebsd.ffi"] = "syscall/freebsd/ffi.lua";
["syscall.freebsd.ioctl"] = "syscall/freebsd/ioctl.lua";
["syscall.freebsd.types"] = "syscall/freebsd/types.lua";
["syscall.freebsd.fcntl"] = "syscall/freebsd/fcntl.lua";
["syscall.freebsd.errors"] = "syscall/freebsd/errors.lua";
["syscall.freebsd.util"] = "syscall/freebsd/util.lua";
["syscall.freebsd.version"] = "syscall/freebsd/version.lua";
["syscall.freebsd.sysctl"] = "syscall/freebsd/sysctl.lua";
}
};
netbsd =
{
modules =
{
["syscall.netbsd.syscalls"] = "syscall/netbsd/syscalls.lua";
["syscall.netbsd.c"] = "syscall/netbsd/c.lua";
["syscall.netbsd.constants"] = "syscall/netbsd/constants.lua";
["syscall.netbsd.ffitypes"] = "syscall/netbsd/ffitypes.lua";
["syscall.netbsd.ffifunctions"] = "syscall/netbsd/ffifunctions.lua";
["syscall.netbsd.ioctl"] = "syscall/netbsd/ioctl.lua";
["syscall.netbsd.types"] = "syscall/netbsd/types.lua";
["syscall.netbsd.fcntl"] = "syscall/netbsd/fcntl.lua";
["syscall.netbsd.errors"] = "syscall/netbsd/errors.lua";
["syscall.netbsd.util"] = "syscall/netbsd/util.lua";
["syscall.netbsd.nr"] = "syscall/netbsd/nr.lua";
["syscall.netbsd.init"] = "syscall/netbsd/init.lua";
["syscall.netbsd.version"] = "syscall/netbsd/version.lua";
["syscall.netbsd.sysctl"] = "syscall/netbsd/sysctl.lua";
}
};
openbsd =
{
modules =
{
["syscall.openbsd.syscalls"] = "syscall/openbsd/syscalls.lua";
["syscall.openbsd.c"] = "syscall/openbsd/c.lua";
["syscall.openbsd.constants"] = "syscall/openbsd/constants.lua";
["syscall.openbsd.ffi"] = "syscall/openbsd/ffi.lua";
["syscall.openbsd.ioctl"] = "syscall/openbsd/ioctl.lua";
["syscall.openbsd.types"] = "syscall/openbsd/types.lua";
["syscall.openbsd.fcntl"] = "syscall/openbsd/fcntl.lua";
["syscall.openbsd.errors"] = "syscall/openbsd/errors.lua";
["syscall.openbsd.util"] = "syscall/openbsd/util.lua";
["syscall.openbsd.version"] = "syscall/openbsd/version.lua";
["syscall.openbsd.sysctl"] = "syscall/openbsd/sysctl.lua";
}
};
bsd =
{
modules =
{
["syscall.bsd.syscalls"] = "syscall/bsd/syscalls.lua";
["syscall.bsd.ffi"] = "syscall/bsd/ffi.lua";
["syscall.bsd.types"] = "syscall/bsd/types.lua";
}
};
}
}
Loading

0 comments on commit 7544c53

Please sign in to comment.