emmericp / MoonGen

MoonGen is a fully scriptable high-speed packet generator built on DPDK and LuaJIT. It can saturate a 10 Gbit/s connection with 64 byte packets on a single CPU core while executing user-provided Lua scripts for each packet. Multi-core support allows for even higher rates. It also features precise and accurate timestamping and rate control.
MIT License
1.04k stars 234 forks source link

RFC2544 Compile help #135

Closed jlixfeld closed 8 years ago

jlixfeld commented 8 years ago

/disclaimer: Not a developer, so forgive my dumb questions...

Trying to compile the RFC2544 module, but it was giving me issues with lualib.h not being found. I ran make install in deps/luajit, but still couldn't fine the header. I modified the Makefile to add -I/usr/local/include/luajit-2.1 which got me closer, but seems there are issues still.

Any pointers?

Debian 8.4 MoonGen pulled from git last week.

root@pgen:~/MoonGen/rfc2544# make gcc -o utils/snmpc.so utils/snmpc.c -lsnmp -llua -Wall -fPIC -shared -I/usr/local/include/luajit-2.1 In file included from utils/snmpc.c:10:0: utils/snmpc.c: In function ‘l_session_add_route_entry’: /usr/local/include/luajit-2.1/lauxlib.h:97:31: warning: initialization discards ‘const’ qualifier from pointer target type

define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))

                           ^

utils/snmpc.c:179:17: note: in expansion of macro ‘luaL_checkstring’ char _dst = luaL_checkstring(L, 2); ^ /usr/local/include/luajit-2.1/lauxlib.h:97:31: warning: initialization discards ‘const’ qualifier from pointer target type

define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))

                           ^

utils/snmpc.c:181:22: note: in expansion of macro ‘luaL_checkstring’ char next_hop = luaL_checkstring(L, 4); ^ utils/snmpc.c:185:5: warning: implicit declaration of function ‘lua_tointegerx’ [-Wimplicit-function-declaration] int metric = lua_tointegerx(L, 7, &valid_metric); ^ utils/snmpc.c: In function ‘luaopen_snmp’: utils/snmpc.c:440:5: warning: implicit declaration of function ‘luaL_setfuncs’ [-Wimplicit-function-declaration] luaL_setfuncs(L, session_functions, 0); ^ utils/snmpc.c:443:5: warning: implicit declaration of function ‘luaL_newlib’ [-Wimplicit-function-declaration] luaL_newlib(L, snmp_functions); ^ /usr/bin/ld: cannot find -llua collect2: error: ld returned 1 exit status Makefile:3: recipe for target 'lib' failed make: _* [lib] Error 1 root@pgen:~/MoonGen/rfc2544#

emmericp commented 8 years ago

You need the liblua-dev headers on your system in order to use the SNMP functionality of the RFC 2544 test.

However, you don't need to compile it to use the module - it will automatically select a different config module if the module isn't compiled. Devices that actually support all the necessary features via SNMP are rare anyways.