static int ntop_get_info(lua_State* vm) { char rsp[256]; int major, minor, patch; lua_newtable(vm); lua_push_str_table_entry(vm, "copyright", (char*)"© 1998-2013 - ntop.org"); lua_push_str_table_entry(vm, "authors", (char*)"Luca Deri and Alfredo Cardigliano"); lua_push_str_table_entry(vm, "license", (char*)"GNU GPLv3"); snprintf(rsp, sizeof(rsp), "%s (%s)", PACKAGE_VERSION, NTOPNG_SVN_RELEASE); lua_push_str_table_entry(vm, "version", rsp); lua_push_int_table_entry(vm, "uptime", ntop->getGlobals()->getUptime()); lua_push_str_table_entry(vm, "version.rrd", rrd_strversion()); lua_push_str_table_entry(vm, "version.redis", ntop->getRedis()->getVersion(rsp, sizeof(rsp))); lua_push_str_table_entry(vm, "version.httpd", (char*)mg_version()); lua_push_str_table_entry(vm, "version.luajit", (char*)LUAJIT_VERSION); #ifdef HAVE_GEOIP lua_push_str_table_entry(vm, "version.geoip", (char*)GeoIP_lib_version()); #endif lua_push_str_table_entry(vm, "version.ndpi", ndpi_revision()); zmq_version(&major, &minor, &patch); snprintf(rsp, sizeof(rsp), "%d.%d.%d", major, minor, patch); lua_push_str_table_entry(vm, "version.zmq", rsp); return(CONST_LUA_OK); }
const char* geoip_version(void) { #ifdef USE_GEOIP return GeoIP_lib_version(); #else return NULL; #endif /* USE_GEOIP */ }
static PyObject* GeoIP_lib_version_Py(PyObject* self, PyObject *args) { return Py_BuildValue("s", GeoIP_lib_version()); }
static PyObject *GeoIP_lib_version_Py(PyObject *UNUSED(self), PyObject *UNUSED(args)) { return Py_BuildValue("s", GeoIP_lib_version()); }