Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
dd583e2
Fix ‘UCHAR_MAX’ undeclared
tcz717 May 15, 2018
f022e21
Add poc-driver submodule
tcz717 May 15, 2018
05ab896
change cflags to new style
tcz717 May 28, 2018
d01b28d
Add socket, socket.bind, socket.listen, socket.connect and socket.accept
tcz717 May 21, 2018
5ee38e4
Change luaopen to normal lib and finish sendmsg
tcz717 May 24, 2018
3238d55
Fix wrong return number
tcz717 May 24, 2018
c38ec9d
Unify code style
tcz717 May 25, 2018
9883284
Add recvmsg and close
tcz717 May 28, 2018
b62b2d4
fix problems found by @tammela
tcz717 Jun 4, 2018
1068773
Port luadata and add ludata.data supoort for sendmsg and recvmsg
tcz717 Jun 4, 2018
4b10615
Add getsockname() and get getpeername()
tcz717 Jun 4, 2018
3b3be0a
Format code
tcz717 Jun 4, 2018
654baa7
Use NetBSD's ntop and pton
tcz717 Jun 11, 2018
7891bc4
Add `getsockopt` and `setsockopt`
tcz717 Jun 11, 2018
58fdeb5
Fix problems reiviewed by @tammela
tcz717 Jun 18, 2018
b4cecb6
Add luaproc submodule
tcz717 Jun 18, 2018
6a77755
Add recv and send functions
tcz717 Jun 25, 2018
81889d1
Allow bind and connect use `number` IP
tcz717 Jun 25, 2018
acc965e
Fix recv wrong argument check
tcz717 Jun 25, 2018
88efa10
Add socks v4 example
tcz717 Jun 25, 2018
35e7c5d
Fix proxy demo bugs
tcz717 Jul 6, 2018
390a6d7
Add 4.17 support (getname API changed)
tcz717 Jul 6, 2018
4691e40
Add flag enums & Return error code
tcz717 Jul 14, 2018
6312b84
Add poll/select binding
tcz717 Jul 30, 2018
cc2d301
Add luasocket document
tcz717 Jul 30, 2018
b279f7a
Remove redundant luadata module init
tcz717 Jul 30, 2018
dffaf9b
Change recv and send to use recvmsg and sendmsg internally
tcz717 Aug 5, 2018
a92ebbf
Fix bug: unable to close a socket twice
tcz717 Aug 5, 2018
47ffa66
Add poll GC function
tcz717 Aug 6, 2018
84f0407
Update Socket README and add benchmark
tcz717 Aug 6, 2018
f15e9ee
Optimize the performance and update the documentation
tcz717 Aug 12, 2018
7bc0199
[doc] Add Flame Graph section
tcz717 Aug 13, 2018
ed68b09
[doc] fix some grammar mistakes
tcz717 Aug 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
.cache.mk
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "poc-driver"]
path = poc-driver
url = git@github.com:luainkernel/poc-driver.git
[submodule "luadata"]
path = luadata
url = git@github.com:luainkernel/luadata.git
[submodule "luaproc"]
path = luaproc
url = https://github.com/luainkernel/luaproc
17 changes: 16 additions & 1 deletion Kconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
config LUNATIK
tristate "Lunatik"
tristate "Lunatik"

config LUNATIK_POC
bool "Use poc driver"
depends on LUNATIK
default y

config LUADATA
bool "Use luadata lib"
depends on LUNATIK
default y

config LUAPROC
bool "Use luaproc lib"
depends on LUNATIK
default y
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EXTRA_CFLAGS += -D_KERNEL
subdir-ccflags-y := -D_KERNEL -I$(src) -g

obj-$(CONFIG_LUNATIK) +=lunatik.o

Expand All @@ -10,4 +10,24 @@ lunatik-objs := lua/lapi.o lua/lcode.o lua/lctype.o lua/ldebug.o lua/ldo.o \
lua/lbitlib.o lua/lcorolib.o lua/ldblib.o lua/lstrlib.o \
lua/ltablib.o lua/lutf8lib.o lua/loslib.o lua/lmathlib.o lua/linit.o

lunatik-objs += arch/$(ARCH)/setjmp.o
lunatik-objs += arch/$(ARCH)/setjmp.o

lunatik-objs += socket/socket.o socket/enums.o socket/inet_ntop.o socket/inet_pton.o socket/poll.o

# LUADATA

subdir-ccflags-${CONFIG_LUADATA} += -I$(src)/luadata -I$(src)/lua -D'CHAR_BIT=(8)' \
-D'MIN=min' -D'MAX=max' -D'UCHAR_MAX=(255)' -D'UINT64_MAX=(U64_MAX)' -DCONFIG_LUADATA

lunatik-${CONFIG_LUADATA} += luadata/binary.o luadata/data.o luadata/handle.o \
luadata/layout.o luadata/luadata.o luadata/luautil.o

# LUAPROC

subdir-ccflags-${CONFIG_LUAPROC} += -DLUAPROC_USE_KTHREADS -D__linux__ -I$(src)/luadata

lunatik-${CONFIG_LUAPROC} += luaproc/src/luaproc.o luaproc/src/lpsched.o

# POC

lunatik-${CONFIG_LUNATIK_POC} += poc-driver/luadrv.o
2 changes: 0 additions & 2 deletions lua/luaconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -874,14 +874,12 @@ static inline void *realloc(const void *p, size_t new_size)
/* signal.h */
#define l_signalT lu_byte

#ifdef __mips__
/* limits.h */
#define UCHAR_MAX (255)
#define CHAR_BIT (8)

#undef LUAL_BUFFERSIZE /* stack shouldn't be greater than 2048 */
#define LUAL_BUFFERSIZE (1024)
#endif /* __mips__ */

#endif /* __linux__ */

Expand Down
1 change: 1 addition & 0 deletions luadata
Submodule luadata added at ff8858
1 change: 1 addition & 0 deletions luaproc
Submodule luaproc added at 7cdd3d
1 change: 1 addition & 0 deletions poc-driver
Submodule poc-driver added at 950558
Loading