if tpids[pid] ~= true then
tpids[pid](pid, stat, code)
end
+ tpids[pid] = nil
end
pid, stat, code = nixio.wait(-1, "nohang")
end
AXTLS_DIR = axTLS
AXTLS_FILE = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz
NIXIO_TLS ?= openssl
+NIXIO_SHADOW ?= $(shell echo 'int main(void){ return !getspnam("root"); }' | $(CC) -include shadow.h -xc -o/dev/null - 2>/dev/null && echo yes)
NIXIO_SO = nixio.so
NIXIO_LDFLAGS =
endif
NIXIO_OBJ = src/nixio.o src/socket.o src/sockopt.o src/bind.o src/address.o \
- src/poll.o src/io.o src/file.o src/splice.o src/process.o src/syslog.o \
- src/bit.o src/binary.o src/fs.o src/user.o \
+ src/protoent.o src/poll.o src/io.o src/file.o src/splice.o src/process.o \
+ src/syslog.o src/bit.o src/binary.o src/fs.o src/user.o \
$(if $(NIXIO_TLS),src/tls-crypto.o src/tls-context.o src/tls-socket.o,)
ifeq ($(NIXIO_TLS),axtls)
NIXIO_CFLAGS += -DNO_TLS
endif
+ifneq ($(NIXIO_SHADOW),yes)
+ NIXIO_CFLAGS += -DNO_SHADOW
+endif
+
ifeq ($(OS),SunOS)
NIXIO_LDFLAGS += -lsocket -lnsl -lsendfile
-- <li>ifindex = Interface Index (Linux, "packet"-family)</li>
-- </ul>
+--- Get protocol entry by name.
+-- @usage This function returns nil if the given protocol is unknown.
+-- @class function
+-- @name nixio.getprotobyname
+-- @param name protocol name to lookup
+-- @return Table containing the following fields: <ul>
+-- <li>name = Protocol Name</li>
+-- <li>proto = Protocol Number</li>
+-- <li>aliases = Table of alias names</li>
+-- </ul>
+
+--- Get protocol entry by number.
+-- @usage This function returns nil if the given protocol is unknown.
+-- @class function
+-- @name nixio.getprotobynumber
+-- @param proto protocol number to lookup
+-- @return Table containing the following fields: <ul>
+-- <li>name = Protocol Name</li>
+-- <li>proto = Protocol Number</li>
+-- <li>aliases = Table of alias names</li>
+-- </ul>
+
+--- Get all or a specifc proto entry.
+-- @class function
+-- @name nixio.getproto
+-- @param proto protocol number or name to lookup (optional)
+-- @return Table (or if no parameter is given, a table of tables)
+-- containing the following fields: <ul>
+-- <li>name = Protocol Name</li>
+-- <li>proto = Protocol Number</li>
+-- <li>aliases = Table of alias names</li>
+-- </ul>
+
--- Create a new socket and bind it to a network address.
-- This function is a shortcut for calling nixio.socket and then bind()
-- on the socket object.
-- @class function
-- @name nixio.tls
-- @param mode TLS-Mode ["client", "server"]
--- @return TLSContext Object
\ No newline at end of file
+-- @return TLSContext Object
}
/* on success */
- if (!status) {
+ if (!status || errno == EINPROGRESS) {
break;
}
}
#include <errno.h>
#include <signal.h>
-#define VERSION 0.3
+#define VERSION 0.4
/* pushes nil, error number and errstring on the stack */
nixio_open_sockopt(L);
nixio_open_bind(L);
nixio_open_address(L);
+ nixio_open_protoent(L);
nixio_open_poll(L);
nixio_open_io(L);
nixio_open_splice(L);
NIXIO_PUSH_CONSTANT(SIGSEGV);
#ifndef __WINNT__
+ NIXIO_PUSH_CONSTANT(EALREADY);
+ NIXIO_PUSH_CONSTANT(EINPROGRESS);
NIXIO_PUSH_CONSTANT(EWOULDBLOCK);
NIXIO_PUSH_CONSTANT(ELOOP);
NIXIO_PUSH_CONSTANT(EOVERFLOW);
void nixio_open_sockopt(lua_State *L);
void nixio_open_bind(lua_State *L);
void nixio_open_address(lua_State *L);
+void nixio_open_protoent(lua_State *L);
void nixio_open_poll(lua_State *L);
void nixio_open_io(lua_State *L);
void nixio_open_splice(lua_State *L);
--- /dev/null
+/*
+ * nixio - Linux I/O library for lua
+ *
+ * Copyright (C) 2011 Jo-Philipp Wich <jow@openwrt.org>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "nixio.h"
+
+#ifndef __WINNT__
+#include <netdb.h>
+#endif
+
+/**
+ * protoent conversion helper
+ */
+static int nixio__pushprotoent(lua_State *L, struct protoent *e) {
+ int i;
+ if (e) {
+ lua_newtable(L);
+
+ lua_pushstring(L, e->p_name);
+ lua_setfield(L, -2, "name");
+
+ lua_pushnumber(L, e->p_proto);
+ lua_setfield(L, -2, "proto");
+
+ lua_newtable(L);
+ for (i = 0; e->p_aliases[i]; i++) {
+ lua_pushstring(L, e->p_aliases[i]);
+ lua_rawseti(L, -2, i+1);
+ }
+ lua_setfield(L, -2, "aliases");
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+/**
+ * getprotobyname(name)
+ */
+static int nixio_getprotobyname(lua_State *L) {
+ const char *name = luaL_checkstring(L, 1);
+ struct protoent *res = getprotobyname(name);
+ return nixio__pushprotoent(L, res);
+}
+
+/**
+ * getprotobynumber(proto)
+ */
+static int nixio_getprotobynumber(lua_State *L) {
+ int proto = luaL_checkinteger(L, 1);
+ struct protoent *res = getprotobynumber(proto);
+ return nixio__pushprotoent(L, res);
+}
+
+/**
+ * getproto(name_or_proto)
+ */
+static int nixio_getproto(lua_State *L) {
+ int i = 1;
+ struct protoent *res;
+ if (lua_isnumber(L, 1)) {
+ return nixio_getprotobynumber(L);
+ } else if (lua_isstring(L, 1)) {
+ return nixio_getprotobyname(L);
+ } else if (lua_isnoneornil(L, 1)) {
+ setprotoent(1);
+ lua_newtable(L);
+ while ((res = getprotoent()) != NULL) {
+ nixio__pushprotoent(L, res);
+ lua_rawseti(L, -2, i++);
+ }
+ endprotoent();
+ return 1;
+ } else {
+ return luaL_argerror(L, 1, "supported values: <protoname>, <protonumber>");
+ }
+}
+
+/* module table */
+static const luaL_reg R[] = {
+ {"getprotobyname", nixio_getprotobyname},
+ {"getprotobynumber", nixio_getprotobynumber},
+ {"getproto", nixio_getproto},
+ {NULL, NULL}
+};
+
+void nixio_open_protoent(lua_State *L) {
+ luaL_register(L, NULL, R);
+}
#include <pwd.h>
#ifndef BSD
+#ifndef NO_SHADOW
#include <shadow.h>
+#endif
#include <crypt.h>
#endif
}
#ifndef BSD
+#ifndef NO_SHADOW
static int nixio__push_spwd(lua_State *L, struct spwd *sp) {
lua_createtable(L, 0, 9);
lua_pushstring(L, sp->sp_namp);
return nixio__push_spwd(L, sp);
}
}
+#endif /* !NO_SHADOW */
#endif /* !BSD */
static int nixio_crypt(lua_State *L) {
{"getgr", nixio_getgr},
{"getpw", nixio_getpw},
#ifndef BSD
+#ifndef NO_SHADOW
{"getsp", nixio_getsp},
+#endif
#endif
{NULL, NULL}
};
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-26 17:57+0200\n"
-"PO-Revision-Date: 2009-05-20 23:51+0200\n"
-"Last-Translator: Stefan Pirwitz <i18n@freifunk-bno.de>\n"
+"PO-Revision-Date: 2011-08-07 16:59+0200\n"
+"Last-Translator: Manuel <freifunk@somakoma.de>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Pootle 1.1.0\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Pootle 2.0.4\n"
#. Asterisk General Options
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:1
#. AGI directory
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:2
msgid "AGI directory"
-msgstr "AGI - Verzeichniss"
+msgstr "AGI - Verzeichnis"
#. Cache recorded sound files during recording
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:3
#. Debug Level
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:4
-#, fuzzy
msgid "Debug Level"
msgstr "Fehlerausgabestufe"
#. Initialise Crypto
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:8
msgid "Initialise Crypto"
-msgstr ""
+msgstr "Verschlüsselung initialisieren"
#. Use Internal Timing
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:9
msgid "Use Internal Timing"
-msgstr ""
+msgstr "Interne Zeitreferenz benutzen"
#. Log directory
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:10
-#, fuzzy
msgid "Log directory"
-msgstr "AGI - Verzeichniss"
+msgstr "Log - Verzeichnis"
#. Maximum number of calls allowed
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:11
-#, fuzzy
msgid "Maximum number of calls allowed"
-msgstr "AGI - Verzeichniss"
+msgstr "Maximale Anruferanzahl"
#. Maximum load to stop accepting new calls
#: applications/luci-asterisk/luasrc/i18n/asterisk.en.lua:12
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2011-08-07 17:01+0200\n"
+"Last-Translator: Manuel <freifunk@somakoma.de>\n"
"Language-Team: none\n"
+"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Pootle 2.0.4\n"
msgid ""
"With this menu you can configure network diagnostics, such as network device "
"scans and ping tests."
msgstr ""
+"Hier werden die Netzwerk Diagnose Tools konfiguriert (zB. Netzwerkscans und "
+"Pings)."
msgid ""
"The entries in the menu allow you to perform diagnostic tests on your system "
msgstr ""
msgid "Configure Diagnostics"
-msgstr ""
+msgstr "Diagnose-Tests konfigurieren"
msgid "l_d_diag"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-10 03:40+0200\n"
-"PO-Revision-Date: 2011-06-18 10:16+0200\n"
-"Last-Translator: fredb <fblistes+luci@free.fr>\n"
+"PO-Revision-Date: 2011-08-07 16:47+0200\n"
+"Last-Translator: Manuel <freifunk@somakoma.de>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
msgstr "Second canal de 40 MHz suivant"
msgid "40MHz 2nd channel below"
-msgstr "Decond canal de 40 MHz précédent"
+msgstr "Second canal de 40 MHz précédent"
msgid "5 Minute Load:"
msgstr "Charge sur 5 minutes :"
"The following files are detected by the system and will be kept "
"automatically during sysupgrade"
msgstr ""
-"LEs fichiers suivants ont été détectés par le système et seront "
-"automatiquement< préservés pendant la mise à jour"
+"Les fichiers suivants ont été détectés par le système et seront "
+"automatiquement préservés pendant la mise à jour"
msgid "The following rules are currently active on this system."
msgstr "Les règles suivantes sont actuellement actives sur ce système."