From: Alexander Shiryaev Date: Mon, 14 Nov 2016 03:40:35 +0000 (+0300) Subject: synchronized with https://github.com/aixp/BlackBox X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=fa3a8f992ea0a865bba31edbfed4c1ddb2bb9e63;p=bbcp.git synchronized with https://github.com/aixp/BlackBox --- diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Host/Mod/Console.odc b/BlackBox/_FreeBSDLinuxOpenBSD_/Host/Mod/Console.odc new file mode 100644 index 0000000..5509e60 Binary files /dev/null and b/BlackBox/_FreeBSDLinuxOpenBSD_/Host/Mod/Console.odc differ diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ similarity index 55% rename from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ rename to BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ index 23a9202..266d5c2 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ +++ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ @@ -1,17 +1,14 @@ -MODULE LinIoctl ["libc.so.70.0"]; +MODULE LinIoctl ["libc.so%%libver%%"]; (* - A. V. Shiryaev, 2012.11, 2013.08 - - OpenBSD 5.4 - 32-bit + %%osname%% + %%machine%% *) CONST - (* /usr/include/sys/ttycom.h *) -%%defs-ttycom%% +%%defs-tiocm%% %%defs-ioctl%% PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER; PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER; -END LinIoctl. +END LinIoctl. \ No newline at end of file diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Rsrc/Mod/gen-Libc/Libc.txt.templ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ similarity index 94% rename from BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Rsrc/Mod/gen-Libc/Libc.txt.templ rename to BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ index a0b6d6b..b367b0b 100644 --- a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Rsrc/Mod/gen-Libc/Libc.txt.templ +++ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ @@ -49,11 +49,17 @@ MODULE LinLibc ["libc.so%%libver%%"]; SEEK_CUR* = 1; SEEK_END* = 2; + STDIN_FILENO* = 0; + STDOUT_FILENO* = 1; + STDERR_FILENO* = 2; + P_tmpdir* = "/tmp"; (* O_RDWR, O_NONBLOCK (intFlags) *) %%defs-fcntlo%% +%%defs-clockid%% + TYPE StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR; PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR; @@ -115,6 +121,10 @@ MODULE LinLibc ["libc.so%%libver%%"]; %%fields-dirent%% END; + timespec_t* = RECORD [untagged] +%%fields-timespec%% + END; + (* VAR stdin*: INTEGER; @@ -132,6 +142,9 @@ MODULE LinLibc ["libc.so%%libver%%"]; (* ANSI C 89 *) PROCEDURE [ccall] clock* (): clock_t; + (* POSIX.1 *) + PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int; + PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid; (* BSD *) PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int; @@ -170,6 +183,7 @@ MODULE LinLibc ["libc.so%%libver%%"]; (* ANSI C 89 *) PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE; + PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE; PROCEDURE [ccall] fclose* (stream: PtrFILE): int; PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t; PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t; diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/Net.txt.templ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/Net.txt.templ new file mode 100644 index 0000000..eb80349 --- /dev/null +++ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/Net.txt.templ @@ -0,0 +1,138 @@ +MODULE LinNet ["libc.so%%libver%%"]; + + (* + %%osname%% + %%machine%% + *) + + CONST + NULL* = 0H; + + SOCKET_ERROR* = -1; + INVALID_SOCKET* = -1; + + INADDR_NONE* = -1; + INADDR_ANY* = 0; + + (* socket domains *) +%%defs-af%% + (* socket types *) +%%defs-sock%% + (* socket protocols *) +%%defs-proto%% + (* socket options *) +%%defs-so%% +%%defs-shut%% +%%defs-sol%% +%%defs-msg%% +%%defs-somaxconn%% + (* addrinfo.ai_flags *) +%%defs-ai%% + (* getaddrinfo/getnameinfo/gai_strerror error codes *) +%%defs-eai%% +%%defs-fd_set-const%% + TYPE + u_int8_t = SHORTCHAR; + int8_t = SHORTCHAR; + uint16_t = SHORTINT; + (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *) +%%defs-basictypes%% + PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR; + + SOCKET* = int; + +(* + in_addr* = RECORD [untagged] + s_addr*: in_addr_t; + END; +*) + in_addr* = RECORD [untagged] + S_un*: RECORD [union] + S_un_b*: RECORD [untagged] + s_b1*: SHORTCHAR; + s_b2*: SHORTCHAR; + s_b3*: SHORTCHAR; + s_b4*: SHORTCHAR; + END; + S_un_w*: RECORD [untagged] + s_w1*: SHORTINT; + s_w2*: SHORTINT; + END; + S_addr*: in_addr_t; + END; + END; + + Ptrsockaddr* = POINTER [untagged] TO sockaddr; + sockaddr* = RECORD [untagged] +%%fields-sockaddr%% + END; + + Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage; + sockaddr_storage* = RECORD [untagged] +%%fields-sockaddr_storage%% + END; + + Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in; + sockaddr_in* = RECORD [untagged] +%%fields-sockaddr_in%% + END; + + Ptraddrinfo* = POINTER [untagged] TO addrinfo; + addrinfo* = RECORD [untagged] +%%fields-addrinfo%% + END; + + timeval* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + tv_sec*: time_t; (* seconds *) + tv_usec*: suseconds_t; (* and microseconds *) + END; + + pollfd* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + fd*: int; + events*: short; + revents*: short; + END; + +%%defs-fd_set-type%% + (* POSIX.1 *) + PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET; + PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; + PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int; + PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int; + PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int; + PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int; + PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int; + + PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t; + PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t; + + PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int; + + PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int; + +(* + PROCEDURE FD_ZERO (VAR set: Net.fd_set); + VAR i: INTEGER; + BEGIN + i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 + END FD_ZERO; + + PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); + BEGIN + INCL(set[fd DIV 32], fd MOD 32) + END FD_SET; +*) + + (* POSIX.1g *) + PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int; + PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo); + + PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR; + +END LinNet. \ No newline at end of file diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/sizeofs.c b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/sizeofs.c new file mode 100644 index 0000000..808e5e2 --- /dev/null +++ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/sizeofs.c @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include +#include + +#define TABS "\t\t" + +#define FALSE (0) +#define TRUE (1) + +static void D (const char *s, int sz, int set, int export) +{ + int res; + + res = printf("%s%s", TABS, s); + if (export) { + res = printf("*"); + } + res = printf(" = "); + if (sz == 1) { + res = printf("SHORTCHAR"); + } else if (sz == 2) { + res = printf("SHORTINT"); + } else if (sz == 4) { + if (set) { + res = printf("SET"); + } else { + res = printf("INTEGER"); + } + } else if (sz == 8) { + if (set) { + res = printf("ARRAY [untagged] 2 OF SET"); + } else { + res = printf("LONGINT"); + } + } else { + res = printf("ARRAY [untagged] "); + if (sz % 4 == 0) { + if (set) { + res = printf("%d OF SET", sz / 4); + } else { + res = printf("%d OF INTEGER", sz / 4); + } + } else { + res = printf("%d OF SHORTCHAR", sz); + } + } + res = printf(";\n"); +} + +int main () +{\ + D("PtrVoid", sizeof(void *), FALSE, TRUE); + D("short", sizeof(short), FALSE, TRUE); + D("int", sizeof(int), FALSE, TRUE); + D("intFlags", sizeof(int), TRUE, TRUE); + D("size_t", sizeof(size_t), FALSE, TRUE); + D("ssize_t", sizeof(ssize_t), FALSE, TRUE); + D("time_t", sizeof(time_t), FALSE, TRUE); + D("suseconds_t", sizeof(suseconds_t), FALSE, TRUE); + D("socklen_t", sizeof(socklen_t), FALSE, TRUE); + D("in_addr_t", sizeof(in_addr_t), FALSE, TRUE); + D("in_port_t", sizeof(in_port_t), FALSE, TRUE); + D("nfds_t", sizeof(nfds_t), FALSE, TRUE); + D("sa_family_t", sizeof(sa_family_t), FALSE, TRUE); + + return 0; +} diff --git a/BlackBox/_LinuxOpenBSD_GUI/Build-Tool.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Build-Tool.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Gtk2/Docu/ObjectHierarchy.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Docu/ObjectHierarchy.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Gtk2/Docu/ObjectHierarchy.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Docu/ObjectHierarchy.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Gtk2/Mod/Keysyms.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Mod/Keysyms.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Gtk2/Mod/Keysyms.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Mod/Keysyms.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Gtk2/Mod/Util.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Mod/Util.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Gtk2/Mod/Util.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Mod/Util.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/CFrames.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/CFrames.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/CFrames.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/CFrames.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Clipboard.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Clipboard.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Clipboard.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Clipboard.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Cmds.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Cmds.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Cmds.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Cmds.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Dialog.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Dialog.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Dialog.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Dialog.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Fonts.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Fonts.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Fonts.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Fonts.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Mechanisms.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Mechanisms.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Mechanisms.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Mechanisms.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Menus.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Menus.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Menus.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Menus.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Ports.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Ports.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Ports.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Ports.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Registry.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Registry.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Registry.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Registry.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/TabFrames.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/TabFrames.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/TabFrames.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/TabFrames.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Windows.odc b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Windows.odc similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Windows.odc rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Windows.odc diff --git a/BlackBox/_LinuxOpenBSD_GUI/build b/BlackBox/_FreeBSDLinuxOpenBSD_GUI/build similarity index 100% rename from BlackBox/_LinuxOpenBSD_GUI/build rename to BlackBox/_FreeBSDLinuxOpenBSD_GUI/build diff --git a/BlackBox/_FreeBSDLinux_/Host/Mod/Console.odc b/BlackBox/_FreeBSDLinux_/Host/Mod/Console.odc deleted file mode 100644 index 7453f8f..0000000 Binary files a/BlackBox/_FreeBSDLinux_/Host/Mod/Console.odc and /dev/null differ diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Makefile b/BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile similarity index 65% rename from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Makefile rename to BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile index 6696eb9..9894048 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Makefile +++ b/BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile @@ -9,16 +9,16 @@ INCDIR ?= /usr/include all: mkioctl Ioctl.txt PY = python2.7 -DEFS = defs-ttycom defs-ioctl +DEFS = defs-tiocm defs-ioctl defs-ioctl: mkioctl ./mkioctl > ${.TARGET} -Ioctl.txt: Ioctl.txt.templ ${DEFS} +Ioctl.txt: Ioctl.txt.templ ${DEFS} libver osname machine ${PY} ./untempl.py Ioctl.txt.templ ${.TARGET} -defs-ttycom: - ./dumpdefs.py 3 1 s ${INCDIR}/sys/ttycom.h | grep TIOCM_ > ${.TARGET} +defs-tiocm: + ./dumpdefs.py 2 1 s ${INCDIR}/sys/ttycom.h | grep TIOCM_ > ${.TARGET} clean: rm -f mkioctl Ioctl.txt ${DEFS} diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c b/BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c similarity index 100% rename from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c rename to BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c diff --git a/BlackBox/_OpenBSD_GUI/Gtk2/Mod/GLib.odc b/BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/GLib.odc similarity index 100% rename from BlackBox/_OpenBSD_GUI/Gtk2/Mod/GLib.odc rename to BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/GLib.odc diff --git a/BlackBox/_OpenBSD_GUI/Gtk2/Mod/GObject.odc b/BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/GObject.odc similarity index 100% rename from BlackBox/_OpenBSD_GUI/Gtk2/Mod/GObject.odc rename to BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/GObject.odc diff --git a/BlackBox/_OpenBSD_GUI/Gtk2/Mod/Gdk.odc b/BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gdk.odc similarity index 100% rename from BlackBox/_OpenBSD_GUI/Gtk2/Mod/Gdk.odc rename to BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gdk.odc diff --git a/BlackBox/_OpenBSD_GUI/Gtk2/Mod/Gtk.odc b/BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gtk.odc similarity index 100% rename from BlackBox/_OpenBSD_GUI/Gtk2/Mod/Gtk.odc rename to BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gtk.odc diff --git a/BlackBox/_OpenBSD_GUI/Gtk2/Mod/Pango.odc b/BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Pango.odc similarity index 100% rename from BlackBox/_OpenBSD_GUI/Gtk2/Mod/Pango.odc rename to BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Pango.odc diff --git a/BlackBox/_FreeBSD_/BlackBox1.run b/BlackBox/_FreeBSD_/BlackBox1.run new file mode 100755 index 0000000..6344545 Binary files /dev/null and b/BlackBox/_FreeBSD_/BlackBox1.run differ diff --git a/BlackBox/_FreeBSD_/Comm/Mod/TCP.odc b/BlackBox/_FreeBSD_/Comm/Mod/TCP.odc new file mode 100644 index 0000000..1b244a6 Binary files /dev/null and b/BlackBox/_FreeBSD_/Comm/Mod/TCP.odc differ diff --git a/BlackBox/_FreeBSD_/Host/Mod/Files.odc b/BlackBox/_FreeBSD_/Host/Mod/Files.odc index 8f91c59..7df7c44 100644 Binary files a/BlackBox/_FreeBSD_/Host/Mod/Files.odc and b/BlackBox/_FreeBSD_/Host/Mod/Files.odc differ diff --git a/BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt b/BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt new file mode 100644 index 0000000..8db05a9 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt @@ -0,0 +1,43 @@ +MODULE LinIoctl ["libc.so.7"]; + + (* + FreeBSD 11.0 + i386 + *) + + CONST + TIOCM_LE* = {0}; (* line enable *) + TIOCM_DTR* = {1}; (* data terminal ready *) + TIOCM_RTS* = {2}; (* request to send *) + TIOCM_ST* = {3}; (* secondary transmit *) + TIOCM_SR* = {4}; (* secondary receive *) + TIOCM_CTS* = {5}; (* clear to send *) + TIOCM_DCD* = {6}; (* data carrier detect *) + TIOCM_RI* = {7}; (* ring indicate *) + TIOCM_DSR* = {8}; (* data set ready *) + + FIOCLEX* = 536897025; + FIONCLEX* = 536897026; + FIONREAD* = 1074030207; + FIONBIO* = -2147195266; + FIOASYNC* = -2147195267; + FIOSETOWN* = -2147195268; + FIOGETOWN* = 1074030203; + TIOCMGET* = 1074033770; + TIOCMSET* = -2147191699; + TIOCEXCL* = 536900621; + TIOCNXCL* = 536900622; + TIOCFLUSH* = -2147191792; + TIOCDRAIN* = 536900702; + TIOCOUTQ* = 1074033779; + TIOCSBRK* = 536900731; + TIOCCBRK* = 536900730; + TIOCSDTR* = 536900729; + TIOCCDTR* = 536900728; + TIOCMBIS* = -2147191700; + TIOCMBIC* = -2147191701; + + PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER; + PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER; + +END LinIoctl. \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/Libc.txt b/BlackBox/_FreeBSD_/Lin/Mod/Libc.txt index 0aeaa91..431e603 100644 --- a/BlackBox/_FreeBSD_/Lin/Mod/Libc.txt +++ b/BlackBox/_FreeBSD_/Lin/Mod/Libc.txt @@ -1,7 +1,7 @@ MODULE LinLibc ["libc.so.7"]; (* - FreeBSD 9.0 + FreeBSD 11.0 i386 *) @@ -18,9 +18,8 @@ MODULE LinLibc ["libc.so.7"]; MAP_SHARED* = {0}; (* share changes *) MAP_PRIVATE* = {1}; (* changes are private *) MAP_FIXED* = {4}; (* map addr must be exactly as requested *) - MAP_COPY* = MAP_PRIVATE; (* Obsolete *) - MAP_RENAME* = {5}; (* Sun: rename private pages to file *) - MAP_NORESERVE* = {6}; (* Sun: don't reserve needed swap area *) + MAP_RESERVED0020* = {5}; (* previously unimplemented MAP_RENAME *) + MAP_RESERVED0040* = {6}; (* previously unimplemented MAP_NORESERVE *) MAP_RESERVED0080* = {7}; (* previously misimplemented MAP_INHERIT *) MAP_RESERVED0100* = {8}; (* previously unimplemented MAP_NOEXTEND *) MAP_HASSEMAPHORE* = {9}; (* region may contain semaphores *) @@ -28,8 +27,10 @@ MODULE LinLibc ["libc.so.7"]; MAP_NOSYNC* = {11}; (* page to but do not sync underlying file *) MAP_FILE* = {}; (* map from file (default) *) MAP_ANON* = {12}; (* allocated from memory, swap space *) + MAP_EXCL* = {14}; (* for MAP_FIXED, fail if address is used *) MAP_NOCORE* = {17}; (* dont include these pages in a coredump *) MAP_PREFAULT_READ* = {18}; (* prefault mapping for reading *) + MAP_ALIGNMENT_SHIFT* = {3,4}; (* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *) @@ -103,6 +104,7 @@ MODULE LinLibc ["libc.so.7"]; SIGUSR2* = 31; (* user defined signal 2 *) SIGTHR* = 32; (* reserved by thread library. *) SIGLWP* = SIGTHR; + SIGLIBRT* = 33; (* reserved by real-time library. *) SIGEV_NONE* = 0; (* No async notification. *) SIGEV_SIGNAL* = 1; (* Generate a queued signal. *) SIGEV_THREAD* = 2; (* Call back from another pthread. *) @@ -304,11 +306,9 @@ MODULE LinLibc ["libc.so.7"]; EDOOFUS* = 88; (* Programming error *) ENOTCAPABLE* = 93; (* Capabilities insufficient *) ECAPMODE* = 94; (* Not permitted in capability mode *) - ELAST* = 94; (* Must be equal largest errno *) - ERESTART* = -1; (* restart syscall *) - EJUSTRETURN* = -2; (* don't modify regs, just return *) - ENOIOCTL* = -3; (* ioctl not handled by this layer *) - EDIRIOCTL* = -4; (* do direct ioctl in GEOM *) + ENOTRECOVERABLE* = 95; (* State not recoverable *) + EOWNERDEAD* = 96; (* Previous owner died *) + ELAST* = 96; (* Must be equal largest errno *) NAME_MAX* = 255; @@ -317,6 +317,10 @@ MODULE LinLibc ["libc.so.7"]; SEEK_CUR* = 1; SEEK_END* = 2; + STDIN_FILENO* = 0; + STDOUT_FILENO* = 1; + STDERR_FILENO* = 2; + P_tmpdir* = "/tmp"; (* O_RDWR, O_NONBLOCK (intFlags) *) @@ -330,6 +334,7 @@ MODULE LinLibc ["libc.so.7"]; O_EXEC* = {18}; (* Open for execute only *) O_TTY_INIT* = {19}; (* Restore default termios attributes *) O_CLOEXEC* = {20}; + O_VERIFY* = {21}; (* open only after verification *) O_RDONLY* = {}; (* open for reading only *) O_WRONLY* = {0}; (* open for writing only *) O_RDWR* = {1}; (* open for reading and writing *) @@ -343,6 +348,22 @@ MODULE LinLibc ["libc.so.7"]; O_NOCTTY* = {15}; (* don't assign controlling terminal *) + (* FreeBSD 11.0 /usr/include/time.h *) + CLOCK_REALTIME* = 0; + CLOCK_VIRTUAL* = 1; + CLOCK_PROF* = 2; + CLOCK_MONOTONIC* = 4; + CLOCK_UPTIME* = 5; (* FreeBSD-specific *) + CLOCK_UPTIME_PRECISE* = 7; (* FreeBSD-specific *) + CLOCK_UPTIME_FAST* = 8; (* FreeBSD-specific *) + CLOCK_REALTIME_PRECISE* = 9; (* FreeBSD-specific *) + CLOCK_REALTIME_FAST* = 10; (* FreeBSD-specific *) + CLOCK_MONOTONIC_PRECISE* = 11; (* FreeBSD-specific *) + CLOCK_MONOTONIC_FAST* = 12; (* FreeBSD-specific *) + CLOCK_SECOND* = 13; (* FreeBSD-specific *) + CLOCK_THREAD_CPUTIME_ID* = 14; + CLOCK_PROCESS_CPUTIME_ID* = 15; + TYPE StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR; PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR; @@ -357,6 +378,7 @@ MODULE LinLibc ["libc.so.7"]; ssize_t* = INTEGER; off_t* = LONGINT; clock_t* = INTEGER; + clockid_t* = INTEGER; time_t* = INTEGER; mode_t* = SHORTINT; pid_t* = INTEGER; @@ -555,6 +577,12 @@ MODULE LinLibc ["libc.so.7"]; d_name*: ARRAY [untagged] 255 + 1 (* 256 *) OF SHORTCHAR; END; + timespec_t* = RECORD [untagged] + (* FreeBSD 11.0 /usr/include/sys/_timespec.h *) + tv_sec*: time_t; (* seconds *) + tv_nsec*: long; (* and nanoseconds *) + END; + (* VAR stdin*: INTEGER; @@ -567,9 +595,13 @@ MODULE LinLibc ["libc.so.7"]; (* POSIX.1 *) PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int; *) +(* VAR errno*: INTEGER; stdin* ["__stdinp"]: PtrFILE; +*) + + PROCEDURE [ccall] __errno_location* ["__error"] (): PtrVoid; (* POSIX.1 *) PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int; @@ -578,6 +610,9 @@ MODULE LinLibc ["libc.so.7"]; (* ANSI C 89 *) PROCEDURE [ccall] clock* (): clock_t; + (* POSIX.1 *) + PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int; + PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid; (* BSD *) PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int; @@ -616,6 +651,7 @@ MODULE LinLibc ["libc.so.7"]; (* ANSI C 89 *) PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE; + PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE; PROCEDURE [ccall] fclose* (stream: PtrFILE): int; PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t; PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t; @@ -650,6 +686,7 @@ MODULE LinLibc ["libc.so.7"]; PROCEDURE [ccall] write* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t; PROCEDURE [ccall] read* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t; PROCEDURE [ccall] close* (d: int): int; + PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t; (* POSIX.1 *) PROCEDURE [ccall] sysconf* (name: int): long; diff --git a/BlackBox/_FreeBSD_/Lin/Mod/Net.txt b/BlackBox/_FreeBSD_/Lin/Mod/Net.txt new file mode 100644 index 0000000..f0ddb5d --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/Net.txt @@ -0,0 +1,241 @@ +MODULE LinNet ["libc.so.7"]; + + (* + FreeBSD 11.0 + i386 + *) + + CONST + NULL* = 0H; + + SOCKET_ERROR* = -1; + INVALID_SOCKET* = -1; + + INADDR_NONE* = -1; + INADDR_ANY* = 0; + + (* socket domains *) + AF_UNSPEC* = 0; (* unspecified *) + AF_UNIX* = 1; (* standardized name for AF_LOCAL *) + AF_INET* = 2; (* internetwork: UDP, TCP, etc. *) + AF_INET6* = 28; (* IPv6 *) + + (* socket types *) + SOCK_STREAM* = 1; (* stream socket *) + SOCK_DGRAM* = 2; (* datagram socket *) + SOCK_RAW* = 3; (* raw-protocol interface *) + SOCK_SEQPACKET* = 5; (* sequenced packet stream *) + + (* socket protocols *) + IPPROTO_IP* = 0; (* dummy for IP *) + IPPROTO_ICMP* = 1; (* control message protocol *) + IPPROTO_TCP* = 6; (* tcp *) + IPPROTO_UDP* = 17; (* user datagram protocol *) + + (* socket options *) + SO_DEBUG* = {0}; (* turn on debugging info recording *) + SO_ACCEPTCONN* = {1}; (* socket has had listen() *) + SO_REUSEADDR* = {2}; (* allow local address reuse *) + SO_KEEPALIVE* = {3}; (* keep connections alive *) + SO_DONTROUTE* = {4}; (* just use interface addresses *) + SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *) + SO_LINGER* = {7}; (* linger on close if data present *) + SO_OOBINLINE* = {8}; (* leave received OOB data in line *) + SO_NO_OFFLOAD* = {14}; (* socket cannot be offloaded *) + SO_NO_DDP* = {15}; (* disable direct data placement *) + SO_SNDBUF* = {0,12}; (* send buffer size *) + SO_RCVBUF* = {1,12}; (* receive buffer size *) + SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *) + SO_RCVLOWAT* = {2,12}; (* receive low-water mark *) + SO_SNDTIMEO* = {0,2,12}; (* send timeout *) + SO_RCVTIMEO* = {1,2,12}; (* receive timeout *) + SO_ERROR* = {0..2,12}; (* get error status and clear *) + SO_TYPE* = {3,12}; (* get socket type *) + + SHUT_RD* = 0; (* shut down the reading side *) + SHUT_WR* = 1; (* shut down the writing side *) + SHUT_RDWR* = 2; (* shut down both sides *) + + SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *) + + MSG_OOB* = {0}; (* process out-of-band data *) + MSG_PEEK* = {1}; (* peek at incoming message *) + MSG_DONTROUTE* = {2}; (* send without using routing tables *) + MSG_EOR* = {3}; (* data completes record *) + MSG_TRUNC* = {4}; (* data discarded before delivery *) + MSG_CTRUNC* = {5}; (* control data lost before delivery *) + MSG_WAITALL* = {6}; (* wait for full request or error *) + + SOMAXCONN* = 128; + + (* addrinfo.ai_flags *) + AI_PASSIVE* = {0}; (* get address to use bind() *) + AI_CANONNAME* = {1}; (* fill ai_canonname *) + AI_NUMERICHOST* = {2}; (* prevent host name resolution *) + AI_NUMERICSERV* = {3}; (* prevent service name resolution *) + AI_ALL* = {8}; (* IPv6 and IPv4-mapped (with AI_V4MAPPED) *) + AI_V4MAPPED_CFG* = {9}; (* accept IPv4-mapped if kernel supports *) + AI_ADDRCONFIG* = {10}; (* only if any address is assigned *) + AI_V4MAPPED* = {11}; (* accept IPv4-mapped IPv6 address *) + + (* getaddrinfo/getnameinfo/gai_strerror error codes *) + EAI_AGAIN* = 2; (* temporary failure in name resolution *) + EAI_BADFLAGS* = 3; (* invalid value for ai_flags *) + EAI_FAIL* = 4; (* non-recoverable failure in name resolution *) + EAI_FAMILY* = 5; (* ai_family not supported *) + EAI_MEMORY* = 6; (* memory allocation failure *) + EAI_NONAME* = 8; (* hostname nor servname provided, or not known *) + EAI_SERVICE* = 9; (* servname not supported for ai_socktype *) + EAI_SOCKTYPE* = 10; (* ai_socktype not supported *) + EAI_SYSTEM* = 11; (* system error returned in errno *) + EAI_BADHINTS* = 12; (* invalid value for hints *) + EAI_PROTOCOL* = 13; (* resolved protocol is unknown *) + EAI_OVERFLOW* = 14; (* argument buffer overflow *) + EAI_MAX* = 15; + + (* FreeBSD 11.0 /usr/include/sys/select.h *) + FD_SETSIZE = 1024; + _NFDBITS = 8 * 4; + + TYPE + u_int8_t = SHORTCHAR; + int8_t = SHORTCHAR; + uint16_t = SHORTINT; + (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *) + PtrVoid* = INTEGER; + short* = SHORTINT; + int* = INTEGER; + intFlags* = SET; + size_t* = INTEGER; + ssize_t* = INTEGER; + time_t* = INTEGER; + suseconds_t* = INTEGER; + socklen_t* = INTEGER; + in_addr_t* = INTEGER; + in_port_t* = SHORTINT; + nfds_t* = INTEGER; + sa_family_t* = SHORTCHAR; + + PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR; + + SOCKET* = int; + +(* + in_addr* = RECORD [untagged] + s_addr*: in_addr_t; + END; +*) + in_addr* = RECORD [untagged] + S_un*: RECORD [union] + S_un_b*: RECORD [untagged] + s_b1*: SHORTCHAR; + s_b2*: SHORTCHAR; + s_b3*: SHORTCHAR; + s_b4*: SHORTCHAR; + END; + S_un_w*: RECORD [untagged] + s_w1*: SHORTINT; + s_w2*: SHORTINT; + END; + S_addr*: in_addr_t; + END; + END; + + Ptrsockaddr* = POINTER [untagged] TO sockaddr; + sockaddr* = RECORD [untagged] + (* FreeBSD 11.0 /usr/include/sys/socket.h *) + sa_len*: SHORTCHAR; (* total length *) + sa_family*: sa_family_t; (* address family *) + sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *) + END; + + Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage; + sockaddr_storage* = RECORD [untagged] + (* FreeBSD 11.0 /usr/include/sys/_sockaddr_storage.h *) + ss_len*: SHORTCHAR; (* address length *) + ss_family*: sa_family_t; (* address family *) + __ss_pad1: ARRAY [untagged] 8 - 2 OF SHORTCHAR; + __ss_align: LONGINT; (* force desired struct alignment *) + __ss_pad2: ARRAY [untagged] 128 - 1 - 1 - (8 - 2) - 8 OF SHORTCHAR; + END; + + Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in; + sockaddr_in* = RECORD [untagged] + (* FreeBSD 11.0 /usr/include/netinet/in.h *) + sin_len*: SHORTCHAR; + sin_family*: sa_family_t; + sin_port*: in_port_t; + sin_addr*: in_addr; + sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR; + END; + + Ptraddrinfo* = POINTER [untagged] TO addrinfo; + addrinfo* = RECORD [untagged] + (* FreeBSD 11.0 /usr/include/netdb.h *) + ai_flags*: intFlags; + ai_family*: int; + ai_socktype*: int; + ai_protocol*: int; + ai_addrlen*: socklen_t; + ai_canonname*: PtrSTR; + ai_addr*: Ptrsockaddr; + ai_next*: Ptraddrinfo; + END; + + timeval* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + tv_sec*: time_t; (* seconds *) + tv_usec*: suseconds_t; (* and microseconds *) + END; + + pollfd* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + fd*: int; + events*: short; + revents*: short; + END; + + (* FreeBSD 11.0 /usr/include/sys/select.h *) + __fd_mask = SET; + fd_set* = ARRAY [untagged] (FD_SETSIZE + (_NFDBITS - 1)) DIV _NFDBITS OF __fd_mask; + + (* POSIX.1 *) + PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET; + PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; + PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int; + PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int; + PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int; + PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int; + PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int; + + PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t; + PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t; + + PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int; + + PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int; + +(* + PROCEDURE FD_ZERO (VAR set: Net.fd_set); + VAR i: INTEGER; + BEGIN + i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 + END FD_ZERO; + + PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); + BEGIN + INCL(set[fd DIV 32], fd MOD 32) + END FD_SET; +*) + + (* POSIX.1g *) + PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int; + PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo); + + PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR; + +END LinNet. \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/dumpdefs.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/dumpdefs.py new file mode 120000 index 0000000..1730591 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/dumpdefs.py @@ -0,0 +1 @@ +../gen-Libc/dumpdefs.py \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/libver b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/libver new file mode 100644 index 0000000..127fc98 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/libver @@ -0,0 +1 @@ +.7 \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/machine b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/machine new file mode 100644 index 0000000..fd32fa4 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/machine @@ -0,0 +1 @@ +i386 \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/osname b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/osname new file mode 100644 index 0000000..64f5283 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/osname @@ -0,0 +1 @@ +FreeBSD 11.0 \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/untempl.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/untempl.py new file mode 120000 index 0000000..5800713 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/untempl.py @@ -0,0 +1 @@ +../gen-Libc/untempl.py \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile index 07b85b3..fc56da2 100644 --- a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile @@ -20,7 +20,7 @@ clockspersec: defs-map: ./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep " MAP_" > ${.TARGET} - ./dumpdefs.py 2 2 s ${INCDIR}/sys/mman.h | grep " MAP_" >> ${.TARGET} + ./dumpdefs.py 2 2 s ${INCDIR}/sys/mman.h | grep " MAP_" | grep -v " = MAP_" >> ${.TARGET} defs-prot: ./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep " PROT_" > ${.TARGET} @@ -41,7 +41,7 @@ defs-sa: defs-errno: ./dumpdefs.py 2 0 i ${INCDIR}/sys/errno.h > ${.TARGET} ./dumpdefs.py 2 1 i ${INCDIR}/sys/errno.h >> ${.TARGET} - ./dumpdefs.py 2 2 i ${INCDIR}/sys/errno.h >> ${.TARGET} + ./dumpdefs.py 2 2 i ${INCDIR}/sys/errno.h | grep -v "= -" >> ${.TARGET} namemax: grep " NAME_MAX " ${INCDIR}/sys/syslimits.h | head -1 | awk '{print $$3}' | tr -d '\n' > ${.TARGET} diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/custom b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/custom index 164cf8d..14bdda7 100644 --- a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/custom +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/custom @@ -1,6 +1,10 @@ +(* VAR errno*: INTEGER; stdin* ["__stdinp"]: PtrFILE; +*) + + PROCEDURE [ccall] __errno_location* ["__error"] (): PtrVoid; (* POSIX.1 *) PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int; diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/defs-clockid b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/defs-clockid new file mode 100644 index 0000000..468e15d --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/defs-clockid @@ -0,0 +1,15 @@ + (* FreeBSD 11.0 /usr/include/time.h *) + CLOCK_REALTIME* = 0; + CLOCK_VIRTUAL* = 1; + CLOCK_PROF* = 2; + CLOCK_MONOTONIC* = 4; + CLOCK_UPTIME* = 5; (* FreeBSD-specific *) + CLOCK_UPTIME_PRECISE* = 7; (* FreeBSD-specific *) + CLOCK_UPTIME_FAST* = 8; (* FreeBSD-specific *) + CLOCK_REALTIME_PRECISE* = 9; (* FreeBSD-specific *) + CLOCK_REALTIME_FAST* = 10; (* FreeBSD-specific *) + CLOCK_MONOTONIC_PRECISE* = 11; (* FreeBSD-specific *) + CLOCK_MONOTONIC_FAST* = 12; (* FreeBSD-specific *) + CLOCK_SECOND* = 13; (* FreeBSD-specific *) + CLOCK_THREAD_CPUTIME_ID* = 14; + CLOCK_PROCESS_CPUTIME_ID* = 15; \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/fields-timespec b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/fields-timespec new file mode 100644 index 0000000..c4a5b7c --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/fields-timespec @@ -0,0 +1,3 @@ + (* FreeBSD 11.0 /usr/include/sys/_timespec.h *) + tv_sec*: time_t; (* seconds *) + tv_nsec*: long; (* and nanoseconds *) \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/osname b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/osname index 8190701..64f5283 100644 --- a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/osname +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/osname @@ -1 +1 @@ -FreeBSD 9.0 \ No newline at end of file +FreeBSD 11.0 \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/sizeofs.c b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/sizeofs.c index 42fb910..99f380a 100644 --- a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/sizeofs.c +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/sizeofs.c @@ -59,6 +59,7 @@ int main () D("ssize_t", sizeof(ssize_t), FALSE, TRUE); D("off_t", sizeof(off_t), FALSE, TRUE); D("clock_t", sizeof(clock_t), FALSE, TRUE); + D("clockid_t", sizeof(clockid_t), FALSE, TRUE); D("time_t", sizeof(time_t), FALSE, TRUE); D("mode_t", sizeof(mode_t), TRUE, TRUE); D("pid_t", sizeof(pid_t), FALSE, TRUE); diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile new file mode 100644 index 0000000..dadffc4 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile @@ -0,0 +1,52 @@ +# This is BSD Makefile +# BSD GNU +# ${.TARGET} $@ +# ${.ALLSRC} $^ +# ${.IMPSRC} $< + +INCDIR ?= /usr/include + +PY = python2.7 + +DEFS = defs-basictypes defs-af defs-sock defs-proto defs-shut defs-so defs-sol defs-msg defs-ai defs-eai defs-somaxconn + +all: Net.txt ${DEFS} + +Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type + ${PY} ./untempl.py Net.txt.templ ${.TARGET} + +defs-basictypes: sizeofs + ./sizeofs > ${.TARGET} + +defs-af: + ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " AF_" > ${.TARGET} + +defs-sock: + ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " SOCK_" > ${.TARGET} + +defs-proto: + ./dumpdefs.py 3 1 i ${INCDIR}/netinet/in.h | grep " IPPROTO_" > ${.TARGET} + +defs-sol: + ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep " SOL_" > ${.TARGET} + +defs-msg: + ./dumpdefs.py 2 1 s ${INCDIR}/sys/socket.h | grep " MSG_" > ${.TARGET} + +defs-somaxconn: + ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep " SOMAXCONN" > ${.TARGET} + +defs-so: + ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep " SO_" > ${.TARGET} + +defs-shut: + ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep " SHUT_" > ${.TARGET} + +defs-ai: + ./dumpdefs.py 3 1 s ${INCDIR}/netdb.h | grep " AI_" > ${.TARGET} + +defs-eai: + ./dumpdefs.py 3 1 i ${INCDIR}/netdb.h | grep " EAI_" > ${.TARGET} + +clean: + rm -f ${DEFS} Net.txt sizeofs diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-const b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-const new file mode 100644 index 0000000..99eac81 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-const @@ -0,0 +1,3 @@ + (* FreeBSD 11.0 /usr/include/sys/select.h *) + FD_SETSIZE = 1024; + _NFDBITS = 8 * 4; diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-type b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-type new file mode 100644 index 0000000..604bf5f --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-type @@ -0,0 +1,3 @@ + (* FreeBSD 11.0 /usr/include/sys/select.h *) + __fd_mask = SET; + fd_set* = ARRAY [untagged] (FD_SETSIZE + (_NFDBITS - 1)) DIV _NFDBITS OF __fd_mask; diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/dumpdefs.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/dumpdefs.py new file mode 120000 index 0000000..1730591 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/dumpdefs.py @@ -0,0 +1 @@ +../gen-Libc/dumpdefs.py \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-addrinfo b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-addrinfo new file mode 100644 index 0000000..0140000 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-addrinfo @@ -0,0 +1,9 @@ + (* FreeBSD 11.0 /usr/include/netdb.h *) + ai_flags*: intFlags; + ai_family*: int; + ai_socktype*: int; + ai_protocol*: int; + ai_addrlen*: socklen_t; + ai_canonname*: PtrSTR; + ai_addr*: Ptrsockaddr; + ai_next*: Ptraddrinfo; \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr new file mode 100644 index 0000000..239887f --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr @@ -0,0 +1,4 @@ + (* FreeBSD 11.0 /usr/include/sys/socket.h *) + sa_len*: SHORTCHAR; (* total length *) + sa_family*: sa_family_t; (* address family *) + sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *) \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_in b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_in new file mode 100644 index 0000000..9f5a721 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_in @@ -0,0 +1,6 @@ + (* FreeBSD 11.0 /usr/include/netinet/in.h *) + sin_len*: SHORTCHAR; + sin_family*: sa_family_t; + sin_port*: in_port_t; + sin_addr*: in_addr; + sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR; \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage new file mode 100644 index 0000000..1772596 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage @@ -0,0 +1,6 @@ + (* FreeBSD 11.0 /usr/include/sys/_sockaddr_storage.h *) + ss_len*: SHORTCHAR; (* address length *) + ss_family*: sa_family_t; (* address family *) + __ss_pad1: ARRAY [untagged] 8 - 2 OF SHORTCHAR; + __ss_align: LONGINT; (* force desired struct alignment *) + __ss_pad2: ARRAY [untagged] 128 - 1 - 1 - (8 - 2) - 8 OF SHORTCHAR; \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/libver b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/libver new file mode 100644 index 0000000..127fc98 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/libver @@ -0,0 +1 @@ +.7 \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/machine b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/machine new file mode 100644 index 0000000..fd32fa4 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/machine @@ -0,0 +1 @@ +i386 \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/osname b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/osname new file mode 100644 index 0000000..64f5283 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/osname @@ -0,0 +1 @@ +FreeBSD 11.0 \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/untempl.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/untempl.py new file mode 120000 index 0000000..5800713 --- /dev/null +++ b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/untempl.py @@ -0,0 +1 @@ +../gen-Libc/untempl.py \ No newline at end of file diff --git a/BlackBox/_FreeBSD_/Lin/Rsrc/loader/loader b/BlackBox/_FreeBSD_/Lin/Rsrc/loader/loader index 425a7b3..058053a 100755 Binary files a/BlackBox/_FreeBSD_/Lin/Rsrc/loader/loader and b/BlackBox/_FreeBSD_/Lin/Rsrc/loader/loader differ diff --git a/BlackBox/_FreeBSD_/System/Mod/Kernel.odc b/BlackBox/_FreeBSD_/System/Mod/Kernel.odc index 0bee377..0d57ce2 100644 Binary files a/BlackBox/_FreeBSD_/System/Mod/Kernel.odc and b/BlackBox/_FreeBSD_/System/Mod/Kernel.odc differ diff --git a/BlackBox/_FreeBSD_/libBB.so b/BlackBox/_FreeBSD_/libBB.so index 6ef9ef5..9b520c9 100644 Binary files a/BlackBox/_FreeBSD_/libBB.so and b/BlackBox/_FreeBSD_/libBB.so differ diff --git a/BlackBox/_FreeBSD_/libBB0.so b/BlackBox/_FreeBSD_/libBB0.so index e4df9fb..9c0a65d 100644 Binary files a/BlackBox/_FreeBSD_/libBB0.so and b/BlackBox/_FreeBSD_/libBB0.so differ diff --git a/BlackBox/_Linux_/Comm/Mod/TCP.odc b/BlackBox/_Linux_/Comm/Mod/TCP.odc index 9998408..b213fe6 100644 Binary files a/BlackBox/_Linux_/Comm/Mod/TCP.odc and b/BlackBox/_Linux_/Comm/Mod/TCP.odc differ diff --git a/BlackBox/_Linux_/Lin/Mod/Ioctl.txt b/BlackBox/_Linux_/Lin/Mod/Ioctl.txt index 0431f39..8a848ef 100644 --- a/BlackBox/_Linux_/Lin/Mod/Ioctl.txt +++ b/BlackBox/_Linux_/Lin/Mod/Ioctl.txt @@ -1,23 +1,20 @@ MODULE LinIoctl ["libc.so.6"]; (* - A. V. Shiryaev, 2012.11 - GNU/Linux i386 *) CONST - (* /usr/include/i386-linux-gnu/bits/ioctl-types.h *) - TIOCM_LE* = {0}; - TIOCM_DTR* = {1}; - TIOCM_RTS* = {2}; - TIOCM_ST* = {3}; - TIOCM_SR* = {4}; - TIOCM_CTS* = {5}; - TIOCM_CAR* = {6}; - TIOCM_RNG* = {7}; - TIOCM_DSR* = {8}; + TIOCM_LE* = {0}; + TIOCM_DTR* = {1}; + TIOCM_RTS* = {2}; + TIOCM_ST* = {3}; + TIOCM_SR* = {4}; + TIOCM_CTS* = {5}; + TIOCM_CAR* = {6}; + TIOCM_RNG* = {7}; + TIOCM_DSR* = {8}; FIOCLEX* = 21585; FIONCLEX* = 21584; @@ -37,4 +34,4 @@ MODULE LinIoctl ["libc.so.6"]; PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER; PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER; -END LinIoctl. +END LinIoctl. \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/Libc.odc b/BlackBox/_Linux_/Lin/Mod/Libc.odc index 4940bda..776f6d1 100644 Binary files a/BlackBox/_Linux_/Lin/Mod/Libc.odc and b/BlackBox/_Linux_/Lin/Mod/Libc.odc differ diff --git a/BlackBox/_Linux_/Lin/Mod/Libc.txt b/BlackBox/_Linux_/Lin/Mod/Libc.txt index d90abb0..feab677 100644 --- a/BlackBox/_Linux_/Lin/Mod/Libc.txt +++ b/BlackBox/_Linux_/Lin/Mod/Libc.txt @@ -246,6 +246,10 @@ MODULE LinLibc ["libc.so.6"]; SIGSTKSZ* = 8192; + STDIN_FILENO* = 0; + STDOUT_FILENO* = 1; + STDERR_FILENO* = 2; + TYPE __ftw_func_t* = PROCEDURE (fileName: PtrSTR; VAR [nil] stat: stat_t; flag: INTEGER): INTEGER; PtrVoid* = INTEGER; @@ -396,7 +400,9 @@ MODULE LinLibc ["libc.so.6"]; VAR timezone*: INTEGER; (* seconds from GMT *) +(* stdin*, stdout*, stderr* : PtrFILE; +*) PROCEDURE [ccall] calloc* (num, size: size_t): PtrVoid; PROCEDURE [ccall] clock* (): clock_t; @@ -406,6 +412,7 @@ MODULE LinLibc ["libc.so.6"]; PROCEDURE [ccall] fclose* (fp: PtrFILE): INTEGER; PROCEDURE [ccall] fflush* (fp: PtrFILE): INTEGER; PROCEDURE [ccall] fopen* (filename, mode: PtrSTR): PtrFILE; + PROCEDURE [ccall] fdopen* (fildes: INTEGER; mode: PtrSTR): PtrFILE; PROCEDURE [ccall] feof* (fp: PtrFILE): INTEGER; PROCEDURE [ccall] fread* (ptr: PtrVoid; size, nobj: size_t; stream: PtrFILE): size_t; PROCEDURE [ccall] fseek* (stream: PtrFILE; offset, origin: INTEGER): INTEGER; diff --git a/BlackBox/_Linux_/Lin/Mod/Net.txt b/BlackBox/_Linux_/Lin/Mod/Net.txt index 738f28a..c8c5289 100644 --- a/BlackBox/_Linux_/Lin/Mod/Net.txt +++ b/BlackBox/_Linux_/Lin/Mod/Net.txt @@ -1,30 +1,20 @@ MODULE LinNet ["libc.so.6"]; (* - A. V. Shiryaev, 2012.11 - GNU/Linux - 32-bit + i386 *) - IMPORT Libc := LinLibc; - CONST - INVALID_SOCKET* = -1; + NULL* = 0H; + SOCKET_ERROR* = -1; + INVALID_SOCKET* = -1; - (* /usr/include/i386-linux-gnu/bits/socket.h *) - SHUT_RD* = 0; - SHUT_WR* = 1; - SHUT_RDWR* = 2; - SOCK_STREAM* = 1; - SOCK_DGRAM* = 2; - SOCK_RAW* = 3; - SOCK_RDM* = 4; - SOCK_SEQPACKET* = 5; - SOCK_DCCP* = 6; - SOCK_PACKET* = 10; + INADDR_NONE* = -1; + INADDR_ANY* = 0; + (* socket domains *) PF_UNSPEC* = 0; (* Unspecified. *) PF_LOCAL* = 1; (* Local to host (pipes and file-domain). *) PF_UNIX* = PF_LOCAL; (* POSIX name for PF_LOCAL. *) @@ -66,10 +56,51 @@ MODULE LinNet ["libc.so.6"]; PF_CAIF* = 37; (* CAIF sockets. *) PF_ALG* = 38; (* Algorithm sockets. *) PF_NFC* = 39; (* NFC sockets. *) - PF_MAX* = 40; (* For now.. *) - SOMAXCONN* = 128; + PF_VSOCK* = 40; (* vSockets. *) + PF_MAX* = 41; (* For now.. *) - (* /usr/include/asm-generic/socket.h *) + (* socket types *) + (* /usr/include/i386-linux-gnu/bits/socket_type.h *) + SOCK_STREAM* = 1; + SOCK_DGRAM* = 2; + SOCK_RAW* = 3; + SOCK_RDM* = 4; + SOCK_SEQPACKET* = 5; + SOCK_DCCP* = 6; + SOCK_PACKET* = 10; + + (* socket protocols *) + IPPROTO_IP = 0; (* Dummy protocol for TCP. *) + IPPROTO_HOPOPTS* = 0; (* IPv6 Hop-by-Hop options. *) + IPPROTO_ICMP* = 1; (* Internet Control Message Protocol. *) + IPPROTO_IGMP* = 2; (* Internet Group Management Protocol. *) + IPPROTO_IPIP* = 4; (* IPIP tunnels (older KA9Q tunnels use 94). *) + IPPROTO_TCP* = 6; (* Transmission Control Protocol. *) + IPPROTO_EGP* = 8; (* Exterior Gateway Protocol. *) + IPPROTO_PUP* = 12; (* PUP protocol. *) + IPPROTO_UDP* = 17; (* User Datagram Protocol. *) + IPPROTO_IDP* = 22; (* XNS IDP protocol. *) + IPPROTO_TP* = 29; (* SO Transport Protocol Class 4. *) + IPPROTO_DCCP* = 33; (* Datagram Congestion Control Protocol. *) + IPPROTO_IPV6* = 41; (* IPv6 header. *) + IPPROTO_ROUTING* = 43; (* IPv6 routing header. *) + IPPROTO_FRAGMENT* = 44; (* IPv6 fragmentation header. *) + IPPROTO_RSVP* = 46; (* Reservation Protocol. *) + IPPROTO_GRE* = 47; (* General Routing Encapsulation. *) + IPPROTO_ESP* = 50; (* encapsulating security payload. *) + IPPROTO_AH* = 51; (* authentication header. *) + IPPROTO_ICMPV6* = 58; (* ICMPv6. *) + IPPROTO_NONE* = 59; (* IPv6 no next header. *) + IPPROTO_DSTOPTS* = 60; (* IPv6 destination options. *) + IPPROTO_MTP* = 92; (* Multicast Transport Protocol. *) + IPPROTO_ENCAP* = 98; (* Encapsulation Header. *) + IPPROTO_PIM* = 103; (* Protocol Independent Multicast. *) + IPPROTO_COMP* = 108; (* Compression Header Protocol. *) + IPPROTO_SCTP* = 132; (* Stream Control Transmission Protocol. *) + IPPROTO_UDPLITE* = 136; (* UDP-Lite protocol. *) + IPPROTO_RAW* = 255; (* Raw IP packets. *) + + (* socket options *) SO_DEBUG* = {0}; SO_REUSEADDR* = {1}; SO_TYPE* = {0,1}; @@ -86,6 +117,7 @@ MODULE LinNet ["libc.so.6"]; SO_PRIORITY* = {2,3}; SO_LINGER* = {0,2,3}; SO_BSDCOMPAT* = {1..3}; + SO_REUSEPORT* = {0..3}; SO_SECURITY_AUTHENTICATION* = {1,2,4}; SO_SECURITY_ENCRYPTION_TRANSPORT* = {0..2,4}; SO_SECURITY_ENCRYPTION_NETWORK* = {3,4}; @@ -103,141 +135,191 @@ MODULE LinNet ["libc.so.6"]; SO_PROTOCOL* = {1,2,5}; SO_DOMAIN* = {0..2,5}; SO_RXQ_OVFL* = {3,5}; + SO_WIFI_STATUS* = {0,3,5}; + SO_PEEK_OFF* = {1,3,5}; + SO_NOFCS* = {0,1,3,5}; + SO_LOCK_FILTER* = {2,3,5}; + SO_SELECT_ERR_QUEUE* = {0,2,3,5}; + SO_BUSY_POLL* = {1..3,5}; + SO_MAX_PACING_RATE* = {0..3,5}; - (* /usr/include/netinet/in.h *) - INADDR_NONE* = -1; - IPPROTO_IP = 0; (* Dummy protocol for TCP. *) - IPPROTO_HOPOPTS* = 0; (* IPv6 Hop-by-Hop options. *) - IPPROTO_ICMP* = 1; (* Internet Control Message Protocol. *) - IPPROTO_IGMP* = 2; (* Internet Group Management Protocol. *) - IPPROTO_IPIP* = 4; (* IPIP tunnels (older KA9Q tunnels use 94). *) - IPPROTO_TCP* = 6; (* Transmission Control Protocol. *) - IPPROTO_EGP* = 8; (* Exterior Gateway Protocol. *) - IPPROTO_PUP* = 12; (* PUP protocol. *) - IPPROTO_UDP* = 17; (* User Datagram Protocol. *) - IPPROTO_IDP* = 22; (* XNS IDP protocol. *) - IPPROTO_TP* = 29; (* SO Transport Protocol Class 4. *) - IPPROTO_DCCP* = 33; (* Datagram Congestion Control Protocol. *) - IPPROTO_IPV6* = 41; (* IPv6 header. *) - IPPROTO_ROUTING* = 43; (* IPv6 routing header. *) - IPPROTO_FRAGMENT* = 44; (* IPv6 fragmentation header. *) - IPPROTO_RSVP* = 46; (* Reservation Protocol. *) - IPPROTO_GRE* = 47; (* General Routing Encapsulation. *) - IPPROTO_ESP* = 50; (* encapsulating security payload. *) - IPPROTO_AH* = 51; (* authentication header. *) - IPPROTO_ICMPV6* = 58; (* ICMPv6. *) - IPPROTO_NONE* = 59; (* IPv6 no next header. *) - IPPROTO_DSTOPTS* = 60; (* IPv6 destination options. *) - IPPROTO_MTP* = 92; (* Multicast Transport Protocol. *) - IPPROTO_ENCAP* = 98; (* Encapsulation Header. *) - IPPROTO_PIM* = 103; (* Protocol Independent Multicast. *) - IPPROTO_COMP* = 108; (* Compression Header Protocol. *) - IPPROTO_SCTP* = 132; (* Stream Control Transmission Protocol. *) - IPPROTO_UDPLITE* = 136; (* UDP-Lite protocol. *) - IPPROTO_RAW* = 255; (* Raw IP packets. *) + (* /usr/include/i386-linux-gnu/sys/socket.h *) + SHUT_RD* = 0; + SHUT_WR* = 1; + SHUT_RDWR* = 2; + + SOL_SOCKET* = 1; + + (* /usr/include/i386-linux-gnu/bits/socket.h *) + MSG_OOB* = {0}; + MSG_PEEK* = {1}; + MSG_DONTROUTE* = {2}; + MSG_CTRUNC* = {3}; + MSG_PROXY* = {4}; + MSG_TRUNC* = {5}; + MSG_DONTWAIT* = {6}; + MSG_EOR* = {7}; + MSG_WAITALL* = {8}; + MSG_FIN* = {9}; + MSG_SYN* = {10}; + MSG_CONFIRM* = {11}; + MSG_RST* = {12}; + MSG_ERRQUEUE* = {13}; + MSG_NOSIGNAL* = {14}; + MSG_MORE* = {15}; + MSG_WAITFORONE* = {16}; + + SOMAXCONN* = 128; - (* /usr/include/asm-generic/param.h *) - MAXHOSTNAMELEN* = 64; (* max length of hostname *) + (* addrinfo.ai_flags *) + AI_PASSIVE* = {0}; (* Socket address is intended for `bind'. *) + AI_CANONNAME* = {1}; (* Request for canonical name. *) + AI_NUMERICHOST* = {2}; (* Don't use name resolution. *) + AI_V4MAPPED* = {3}; (* IPv4 mapped addresses are acceptable. *) + AI_ALL* = {4}; (* Return IPv4 mapped and IPv6 addresses. *) + AI_CANONIDN* = {7}; (* Translate canonical name from IDN format. *) + AI_NUMERICSERV* = {10}; (* Don't use name resolution. *) - (* /usr/include/netdb.h *) - NETDB_INTERNAL* = -1; (* See errno. *) - NETDB_SUCCESS* = 0; (* No problem. *) - HOST_NOT_FOUND* = 1; (* Authoritative Answer Host not found. *) - TRY_AGAIN* = 2; (* Non-Authoritative Host not found, or SERVERFAIL. *) - NO_RECOVERY* = 3; (* Non recoverable errors, FORMERR, REFUSED, NOTIMP. *) - NO_DATA* = 4; (* Valid name, no data record of requested type. *) + (* getaddrinfo/getnameinfo/gai_strerror error codes *) + EAI_BADFLAGS* = -1; (* Invalid value for `ai_flags' field. *) + EAI_NONAME* = -2; (* NAME or SERVICE is unknown. *) + EAI_AGAIN* = -3; (* Temporary failure in name resolution. *) + EAI_FAIL* = -4; (* Non-recoverable failure in name res. *) + EAI_FAMILY* = -6; (* `ai_family' not supported. *) + EAI_SOCKTYPE* = -7; (* `ai_socktype' not supported. *) + EAI_SERVICE* = -8; (* SERVICE not supported for `ai_socktype'. *) + EAI_MEMORY* = -10; (* Memory allocation failure. *) + EAI_SYSTEM* = -11; (* System error returned in `errno'. *) + EAI_OVERFLOW* = -12; (* Argument buffer overflow. *) + EAI_NODATA* = -5; (* No address associated with NAME. *) + EAI_ADDRFAMILY* = -9; (* Address family for NAME not supported. *) + EAI_INPROGRESS* = -100; (* Processing request in progress. *) + EAI_CANCELED* = -101; (* Request canceled. *) + EAI_NOTCANCELED* = -102; (* Request not canceled. *) + EAI_ALLDONE* = -103; (* All requests done. *) + EAI_INTR* = -104; (* Interrupted by a signal. *) + EAI_IDN_ENCODE* = -105; (* IDN encoding failed. *) (* /usr/include/i386-linux-gnu/bits/typesizes.h *) __FD_SETSIZE = 1024; TYPE - SOCKET* = INTEGER; + u_int8_t = SHORTCHAR; + int8_t = SHORTCHAR; + uint16_t = SHORTINT; + (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *) + PtrVoid* = INTEGER; + short* = SHORTINT; + int* = INTEGER; + intFlags* = SET; + size_t* = INTEGER; + ssize_t* = INTEGER; + time_t* = INTEGER; + suseconds_t* = INTEGER; + socklen_t* = INTEGER; + in_addr_t* = INTEGER; + in_port_t* = SHORTINT; + nfds_t* = INTEGER; + sa_family_t* = SHORTINT; - (* /usr/include/i386-linux-gnu/bits/types.h *) - socklen_t* = INTEGER; - (* /usr/include/i386-linux-gnu/bits/sockaddr.h *) - sa_family_t* = SHORTINT; (* unsigned short int *) - (* /usr/include/netinet/in.h *) - in_addr_t* = INTEGER; - in_port_t* = SHORTINT; + PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR; - (* /usr/include/i386-linux-gnu/bits/socket.h *) - sockaddr* = RECORD [untagged] - sa_family: sa_family_t; - sa_data: ARRAY [untagged] 14 OF SHORTCHAR; - END; + SOCKET* = int; - (* /usr/include/linux/in.h *) (* - in_addr* = INTEGER; + in_addr* = RECORD [untagged] + s_addr*: in_addr_t; + END; *) - in_addr* = RECORD [untagged] - S_un*: RECORD [union] - S_un_b*: RECORD [untagged] - s_b1*: SHORTCHAR; - s_b2*: SHORTCHAR; - s_b3*: SHORTCHAR; - s_b4*: SHORTCHAR; - END; - S_un_w*: RECORD [untagged] - s_w1*: SHORTINT; - s_w2*: SHORTINT; - END; - S_addr*: in_addr_t; + in_addr* = RECORD [untagged] + S_un*: RECORD [union] + S_un_b*: RECORD [untagged] + s_b1*: SHORTCHAR; + s_b2*: SHORTCHAR; + s_b3*: SHORTCHAR; + s_b4*: SHORTCHAR; + END; + S_un_w*: RECORD [untagged] + s_w1*: SHORTINT; + s_w2*: SHORTINT; END; + S_addr*: in_addr_t; END; + END; - (* /usr/include/linux/in.h *) - sockaddr_in* = RECORD [untagged] + Ptrsockaddr* = POINTER [untagged] TO sockaddr; + sockaddr* = RECORD [untagged] + (* /usr/include/i386-linux-gnu/bits/socket.h *) + sa_family: sa_family_t; + sa_data: ARRAY [untagged] 14 OF SHORTCHAR; + END; + + Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage; + sockaddr_storage* = RECORD [untagged] + (* /usr/include/i386-linux-gnu/bits/socket.h *) + sa_family: sa_family_t; + __ss_align: INTEGER; + __ss_padding: ARRAY [untagged] 128 - 2 * 4 OF SHORTCHAR; + END; + + Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in; + sockaddr_in* = RECORD [untagged] + (* /usr/include/linux/in.h *) sin_family*: sa_family_t; (* address family *) sin_port*: SHORTINT; (* port number *) sin_addr*: in_addr; (* internet address *) __pad: ARRAY [untagged] 8 OF SHORTCHAR; - END; + END; - (* /usr/include/netdb.h *) - Ptrhostent* = POINTER TO hostent; - hostent* = RECORD [untagged] - h_name*: Libc.PtrSTR; (* official name of host *) - h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *) - h_addrtype*: INTEGER; (* host address type *) - h_length*: INTEGER; (* length of address *) - h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *) - END; + Ptraddrinfo* = POINTER [untagged] TO addrinfo; + addrinfo* = RECORD [untagged] + (* /usr/include/netdb.h *) + ai_flags*: intFlags; (* input flags *) + ai_family*: int; (* protocol family for socket *) + ai_socktype*: int; (* socket type *) + ai_protocol*: int; (* protocol for socket *) + ai_addrlen*: socklen_t; (* length of socket-address *) + ai_addr*: Ptrsockaddr; (* socket-address for socket *) + ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *) + ai_next*: Ptraddrinfo; (* pointer to next in list *) + END; - (* /usr/include/linux/time.h *) - (* /usr/include/asm-generic/posix_types.h *) - timeval* = RECORD [untagged] - tv_sec*: INTEGER; (* seconds *) - tv_usec*: INTEGER; (* microseconds *) - END; + timeval* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + tv_sec*: time_t; (* seconds *) + tv_usec*: suseconds_t; (* and microseconds *) + END; + + pollfd* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + fd*: int; + events*: short; + revents*: short; + END; (* /usr/include/i386-linux-gnu/sys/select.h *) __fd_mask = SET; fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask; - VAR - h_errno*: INTEGER; - - PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET; - PROCEDURE [ccall] accept* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; - PROCEDURE [ccall] bind* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER; - PROCEDURE [ccall] connect* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER; - PROCEDURE [ccall] listen* (sockfd: SOCKET; backlog: INTEGER): INTEGER; - PROCEDURE [ccall] recv* (soskfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] send* (sockfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] shutdown* (sockfd: SOCKET; how: INTEGER): INTEGER; - PROCEDURE [ccall] getsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER; - PROCEDURE [ccall] setsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER; + (* POSIX.1 *) + PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET; + PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; + PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int; + PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int; + PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int; + PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int; + PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int; - PROCEDURE [ccall] htons* (hostshort: SHORTINT): SHORTINT; + PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t; + PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t; - PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent; - PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t; + PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int; - PROCEDURE [ccall] getsockname* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): INTEGER; - - PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR; + PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int; (* PROCEDURE FD_ZERO (VAR set: Net.fd_set); @@ -252,6 +334,10 @@ MODULE LinNet ["libc.so.6"]; END FD_SET; *) - PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER; + (* POSIX.1g *) + PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int; + PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo); + + PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR; -END LinNet. +END LinNet. \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile index 5fe037a..26054ee 100644 --- a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile +++ b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile @@ -9,16 +9,16 @@ INCDIR ?= /usr/include all: mkioctl Ioctl.txt PY = python2.7 -DEFS = defs-ioctl1 defs-ioctl +DEFS = defs-tiocm defs-ioctl defs-ioctl: mkioctl ./mkioctl > $@ -Ioctl.txt: Ioctl.txt.templ ${DEFS} +Ioctl.txt: Ioctl.txt.templ ${DEFS} libver osname machine ${PY} ./untempl.py Ioctl.txt.templ $@ -defs-ioctl1: - ./dumpdefs.py 3 0 s ${INCDIR}/i386-linux-gnu/bits/ioctl-types.h | grep TIOCM_ > $@ +defs-tiocm: + ./dumpdefs.py 2 0 s ${INCDIR}/i386-linux-gnu/bits/ioctl-types.h | grep TIOCM_ > $@ clean: rm -f mkioctl Ioctl.txt ${DEFS} diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/libver b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/libver new file mode 100644 index 0000000..ed44321 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/libver @@ -0,0 +1 @@ +.6 \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/machine b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/machine new file mode 100644 index 0000000..fd32fa4 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/machine @@ -0,0 +1 @@ +i386 \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/osname b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/osname new file mode 100644 index 0000000..48fc79c --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/osname @@ -0,0 +1 @@ +GNU/Linux \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/Makefile b/BlackBox/_Linux_/Lin/Mod/gen-Net/Makefile index 4f00e45..42ef267 100644 --- a/BlackBox/_Linux_/Lin/Mod/gen-Net/Makefile +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/Makefile @@ -1,25 +1,40 @@ -# This is GNU Makefile +# This is BSD Makefile # BSD GNU -# ${.TARGET} $@ +# $@ $@ # ${.ALLSRC} $^ # ${.IMPSRC} $< INCDIR ?= /usr/include -all: Net.txt dumphstrerrno - PY = python2.7 -DEFS = defs-socket defs-so -Net.txt: Net.txt.templ ${DEFS} defs-netdb defs-in defs-sock +DEFS = defs-basictypes defs-af defs-so defs-sol defs-ai defs-eai defs-somaxconn + +all: Net.txt ${DEFS} + +Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type ${PY} ./untempl.py Net.txt.templ $@ -defs-socket: +defs-basictypes: sizeofs + ./sizeofs > $@ + +defs-af: ./dumpdefs.py 3 1 i ${INCDIR}/i386-linux-gnu/bits/socket.h | grep " PF_" > $@ - ./dumpdefs.py 3 1 i ${INCDIR}/i386-linux-gnu/bits/socket.h | grep " SOMAXCONN" >> $@ + +defs-sol: + ./dumpdefs.py 2 1 i ${INCDIR}/asm-generic/socket.h | grep " SOL_" > $@ + +defs-somaxconn: + ./dumpdefs.py 2 1 i ${INCDIR}/i386-linux-gnu/bits/socket.h | grep " SOMAXCONN" > $@ defs-so: ./dumpdefs.py 3 1 s ${INCDIR}/asm-generic/socket.h | grep " SO_" > $@ +defs-ai: + ./dumpdefs.py 3 2 s ${INCDIR}/netdb.h | grep " AI_" > $@ + +defs-eai: + ./dumpdefs.py 3 2 i ${INCDIR}/netdb.h | grep " EAI_" > $@ + clean: - rm -f Net.txt ${DEFS} dumphstrerrno + rm -f ${DEFS} Net.txt sizeofs diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/Net.txt.templ b/BlackBox/_Linux_/Lin/Mod/gen-Net/Net.txt.templ deleted file mode 100644 index 756fa5e..0000000 --- a/BlackBox/_Linux_/Lin/Mod/gen-Net/Net.txt.templ +++ /dev/null @@ -1,139 +0,0 @@ -MODULE LinNet ["libc.so.6"]; - - (* - A. V. Shiryaev, 2012.11 - - GNU/Linux - 32-bit - *) - - IMPORT Libc := LinLibc; - - CONST - INVALID_SOCKET* = -1; - SOCKET_ERROR* = -1; - - (* /usr/include/i386-linux-gnu/bits/socket.h *) - SHUT_RD* = 0; - SHUT_WR* = 1; - SHUT_RDWR* = 2; -%%defs-sock%% -%%defs-socket%% - (* /usr/include/asm-generic/socket.h *) -%%defs-so%% - (* /usr/include/netinet/in.h *) - INADDR_NONE* = -1; -%%defs-in%% - (* /usr/include/asm-generic/param.h *) - MAXHOSTNAMELEN* = 64; (* max length of hostname *) - - (* /usr/include/netdb.h *) -%%defs-netdb%% - (* /usr/include/i386-linux-gnu/bits/typesizes.h *) - __FD_SETSIZE = 1024; - - TYPE - SOCKET* = INTEGER; - - (* /usr/include/i386-linux-gnu/bits/types.h *) - socklen_t* = INTEGER; - (* /usr/include/i386-linux-gnu/bits/sockaddr.h *) - sa_family_t* = SHORTINT; (* unsigned short int *) - (* /usr/include/netinet/in.h *) - in_addr_t* = INTEGER; - in_port_t* = SHORTINT; - - (* /usr/include/i386-linux-gnu/bits/socket.h *) - sockaddr* = RECORD [untagged] - sa_family: sa_family_t; - sa_data: ARRAY [untagged] 14 OF SHORTCHAR; - END; - - (* /usr/include/linux/in.h *) -(* - in_addr* = INTEGER; -*) - in_addr* = RECORD [untagged] - S_un*: RECORD [union] - S_un_b*: RECORD [untagged] - s_b1*: SHORTCHAR; - s_b2*: SHORTCHAR; - s_b3*: SHORTCHAR; - s_b4*: SHORTCHAR; - END; - S_un_w*: RECORD [untagged] - s_w1*: SHORTINT; - s_w2*: SHORTINT; - END; - S_addr*: in_addr_t; - END; - END; - - (* /usr/include/linux/in.h *) - sockaddr_in* = RECORD [untagged] - sin_family*: sa_family_t; (* address family *) - sin_port*: SHORTINT; (* port number *) - sin_addr*: in_addr; (* internet address *) - __pad: ARRAY [untagged] 8 OF SHORTCHAR; - END; - - (* /usr/include/netdb.h *) - Ptrhostent* = POINTER TO hostent; - hostent* = RECORD [untagged] - h_name*: Libc.PtrSTR; (* official name of host *) - h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *) - h_addrtype*: INTEGER; (* host address type *) - h_length*: INTEGER; (* length of address *) - h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *) - END; - - (* /usr/include/linux/time.h *) - (* /usr/include/asm-generic/posix_types.h *) - timeval* = RECORD [untagged] - tv_sec*: INTEGER; (* seconds *) - tv_usec*: INTEGER; (* microseconds *) - END; - - (* /usr/include/i386-linux-gnu/sys/select.h *) - __fd_mask = SET; - fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask; - - VAR - h_errno*: INTEGER; - - PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET; - PROCEDURE [ccall] accept* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; - PROCEDURE [ccall] bind* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER; - PROCEDURE [ccall] connect* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER; - PROCEDURE [ccall] listen* (sockfd: SOCKET; backlog: INTEGER): INTEGER; - PROCEDURE [ccall] recv* (soskfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] send* (sockfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] shutdown* (sockfd: SOCKET; how: INTEGER): INTEGER; - PROCEDURE [ccall] getsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER; - PROCEDURE [ccall] setsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER; - - PROCEDURE [ccall] htons* (hostshort: SHORTINT): SHORTINT; - - PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent; - PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t; - - PROCEDURE [ccall] getsockname* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): INTEGER; - - PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR; - -(* - PROCEDURE FD_ZERO (VAR set: Net.fd_set); - VAR i: INTEGER; - BEGIN - i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 - END FD_ZERO; - - PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); - BEGIN - INCL(set[fd DIV 32], fd MOD 32) - END FD_SET; -*) - - PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER; - -END LinNet. diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-const b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-const new file mode 100644 index 0000000..4e6a62d --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-const @@ -0,0 +1,2 @@ + (* /usr/include/i386-linux-gnu/bits/typesizes.h *) + __FD_SETSIZE = 1024; diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-type b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-type new file mode 100644 index 0000000..23da835 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-type @@ -0,0 +1,3 @@ + (* /usr/include/i386-linux-gnu/sys/select.h *) + __fd_mask = SET; + fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask; diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-msg b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-msg new file mode 100644 index 0000000..938b43d --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-msg @@ -0,0 +1,18 @@ + (* /usr/include/i386-linux-gnu/bits/socket.h *) + MSG_OOB* = {0}; + MSG_PEEK* = {1}; + MSG_DONTROUTE* = {2}; + MSG_CTRUNC* = {3}; + MSG_PROXY* = {4}; + MSG_TRUNC* = {5}; + MSG_DONTWAIT* = {6}; + MSG_EOR* = {7}; + MSG_WAITALL* = {8}; + MSG_FIN* = {9}; + MSG_SYN* = {10}; + MSG_CONFIRM* = {11}; + MSG_RST* = {12}; + MSG_ERRQUEUE* = {13}; + MSG_NOSIGNAL* = {14}; + MSG_MORE* = {15}; + MSG_WAITFORONE* = {16}; diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-netdb b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-netdb deleted file mode 100644 index 4b218bb..0000000 --- a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-netdb +++ /dev/null @@ -1,6 +0,0 @@ - NETDB_INTERNAL* = -1; (* See errno. *) - NETDB_SUCCESS* = 0; (* No problem. *) - HOST_NOT_FOUND* = 1; (* Authoritative Answer Host not found. *) - TRY_AGAIN* = 2; (* Non-Authoritative Host not found, or SERVERFAIL. *) - NO_RECOVERY* = 3; (* Non recoverable errors, FORMERR, REFUSED, NOTIMP. *) - NO_DATA* = 4; (* Valid name, no data record of requested type. *) diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-in b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-proto similarity index 100% rename from BlackBox/_Linux_/Lin/Mod/gen-Net/defs-in rename to BlackBox/_Linux_/Lin/Mod/gen-Net/defs-proto diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-shut b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-shut new file mode 100644 index 0000000..52bab53 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-shut @@ -0,0 +1,4 @@ + (* /usr/include/i386-linux-gnu/sys/socket.h *) + SHUT_RD* = 0; + SHUT_WR* = 1; + SHUT_RDWR* = 2; diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-sock b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-sock index 158217a..dbfa8da 100644 --- a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-sock +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-sock @@ -1,7 +1,8 @@ - SOCK_STREAM* = 1; - SOCK_DGRAM* = 2; - SOCK_RAW* = 3; - SOCK_RDM* = 4; - SOCK_SEQPACKET* = 5; - SOCK_DCCP* = 6; - SOCK_PACKET* = 10; + (* /usr/include/i386-linux-gnu/bits/socket_type.h *) + SOCK_STREAM* = 1; + SOCK_DGRAM* = 2; + SOCK_RAW* = 3; + SOCK_RDM* = 4; + SOCK_SEQPACKET* = 5; + SOCK_DCCP* = 6; + SOCK_PACKET* = 10; diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/dumphstrerrno.c b/BlackBox/_Linux_/Lin/Mod/gen-Net/dumphstrerrno.c deleted file mode 120000 index d87b25c..0000000 --- a/BlackBox/_Linux_/Lin/Mod/gen-Net/dumphstrerrno.c +++ /dev/null @@ -1 +0,0 @@ -../../../../_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-addrinfo b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-addrinfo new file mode 100644 index 0000000..be67885 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-addrinfo @@ -0,0 +1,9 @@ + (* /usr/include/netdb.h *) + ai_flags*: intFlags; (* input flags *) + ai_family*: int; (* protocol family for socket *) + ai_socktype*: int; (* socket type *) + ai_protocol*: int; (* protocol for socket *) + ai_addrlen*: socklen_t; (* length of socket-address *) + ai_addr*: Ptrsockaddr; (* socket-address for socket *) + ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *) + ai_next*: Ptraddrinfo; (* pointer to next in list *) \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr new file mode 100644 index 0000000..1e0d5f0 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr @@ -0,0 +1,3 @@ + (* /usr/include/i386-linux-gnu/bits/socket.h *) + sa_family: sa_family_t; + sa_data: ARRAY [untagged] 14 OF SHORTCHAR; \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_in b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_in new file mode 100644 index 0000000..bbeb0ae --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_in @@ -0,0 +1,5 @@ + (* /usr/include/linux/in.h *) + sin_family*: sa_family_t; (* address family *) + sin_port*: SHORTINT; (* port number *) + sin_addr*: in_addr; (* internet address *) + __pad: ARRAY [untagged] 8 OF SHORTCHAR; \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_storage b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_storage new file mode 100644 index 0000000..fbf8dd2 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_storage @@ -0,0 +1,4 @@ + (* /usr/include/i386-linux-gnu/bits/socket.h *) + sa_family: sa_family_t; + __ss_align: INTEGER; + __ss_padding: ARRAY [untagged] 128 - 2 * 4 OF SHORTCHAR; \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/libver b/BlackBox/_Linux_/Lin/Mod/gen-Net/libver new file mode 100644 index 0000000..ed44321 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/libver @@ -0,0 +1 @@ +.6 \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/machine b/BlackBox/_Linux_/Lin/Mod/gen-Net/machine new file mode 100644 index 0000000..fd32fa4 --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/machine @@ -0,0 +1 @@ +i386 \ No newline at end of file diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/osname b/BlackBox/_Linux_/Lin/Mod/gen-Net/osname new file mode 100644 index 0000000..48fc79c --- /dev/null +++ b/BlackBox/_Linux_/Lin/Mod/gen-Net/osname @@ -0,0 +1 @@ +GNU/Linux \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/BlackBox1.run b/BlackBox/_OpenBSD_/BlackBox1.run new file mode 100755 index 0000000..fb36a87 Binary files /dev/null and b/BlackBox/_OpenBSD_/BlackBox1.run differ diff --git a/BlackBox/_OpenBSD_/Comm/Mod/TCP.odc b/BlackBox/_OpenBSD_/Comm/Mod/TCP.odc index 03c1f86..e5c7a31 100644 Binary files a/BlackBox/_OpenBSD_/Comm/Mod/TCP.odc and b/BlackBox/_OpenBSD_/Comm/Mod/TCP.odc differ diff --git a/BlackBox/_OpenBSD_/Host/Mod/Console.odc b/BlackBox/_OpenBSD_/Host/Mod/Console.odc deleted file mode 100644 index 2c44d6c..0000000 Binary files a/BlackBox/_OpenBSD_/Host/Mod/Console.odc and /dev/null differ diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt b/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt index ed81f4d..7cc6abd 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt @@ -1,9 +1,9 @@ -MODULE LinDl ["ld.so"]; +MODULE LinDl ["libc.so.89.2"]; (* A. V. Shiryaev, 2012.09, 2013.08 - OpenBSD 5.4 + OpenBSD 5.6 32-bit *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt b/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt index e1a1f38..b03ca44 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt @@ -1,4 +1,4 @@ -MODULE LinIconv ["libiconv.so.6"]; +MODULE LinIconv ["libiconv.so.6.0"]; IMPORT Libc := LinLibc; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt b/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt index 51947f4..286fa75 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt @@ -1,23 +1,20 @@ -MODULE LinIoctl ["libc.so.70.0"]; +MODULE LinIoctl ["libc.so.89.2"]; (* - A. V. Shiryaev, 2012.11, 2013.08 - - OpenBSD 5.4 - 32-bit + OpenBSD 6.0 + i386 *) CONST - (* /usr/include/sys/ttycom.h *) - TIOCM_LE* = {0}; (* line enable *) - TIOCM_DTR* = {1}; (* data terminal ready *) - TIOCM_RTS* = {2}; (* request to send *) - TIOCM_ST* = {3}; (* secondary transmit *) - TIOCM_SR* = {4}; (* secondary receive *) - TIOCM_CTS* = {5}; (* clear to send *) - TIOCM_CAR* = {6}; (* carrier detect *) - TIOCM_RNG* = {7}; (* ring *) - TIOCM_DSR* = {8}; (* data set ready *) + TIOCM_LE* = {0}; (* line enable *) + TIOCM_DTR* = {1}; (* data terminal ready *) + TIOCM_RTS* = {2}; (* request to send *) + TIOCM_ST* = {3}; (* secondary transmit *) + TIOCM_SR* = {4}; (* secondary receive *) + TIOCM_CTS* = {5}; (* clear to send *) + TIOCM_CAR* = {6}; (* carrier detect *) + TIOCM_RNG* = {7}; (* ring *) + TIOCM_DSR* = {8}; (* data set ready *) FIOCLEX* = 536897025; FIONCLEX* = 536897026; @@ -43,4 +40,4 @@ MODULE LinIoctl ["libc.so.70.0"]; PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER; PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER; -END LinIoctl. +END LinIoctl. \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt b/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt index 7df4f73..b2d0251 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt @@ -1,7 +1,7 @@ -MODULE LinLibc ["libc.so.70.0"]; +MODULE LinLibc ["libc.so.89.2"]; (* - OpenBSD 5.4 + OpenBSD 6.0 i386 *) @@ -17,20 +17,14 @@ MODULE LinLibc ["libc.so.70.0"]; (* MAP_PRIVATE, MAP_ANON (intFlags) *) MAP_SHARED* = {0}; (* share changes *) MAP_PRIVATE* = {1}; (* changes are private *) - MAP_COPY* = {2}; (* "copy" region at mmap time *) MAP_FIXED* = {4}; (* map addr must be exactly as requested *) - MAP_RENAME* = {5}; (* Sun: rename private pages to file *) - MAP_NORESERVE* = {6}; (* Sun: don't reserve needed swap area *) - MAP_INHERIT* = {7}; (* region is retained after exec *) - MAP_NOEXTEND* = {8}; (* for MAP_FILE, don't change file size *) - MAP_HASSEMAPHORE* = {9}; (* region may contain semaphores *) - MAP_TRYFIXED* = {10}; (* attempt hint address, even within heap *) - MAP_FILE* = {}; (* map from file (default) *) MAP_ANON* = {12}; (* allocated from memory, swap space *) - MAP_FLAGMASK* = {0..2,4..12}; + MAP_ANONYMOUS* = MAP_ANON; (* alternate POSIX spelling *) + MAP_FLAGMASK* = {0..2,4..13}; MAP_INHERIT_SHARE* = {}; (* share with child *) MAP_INHERIT_COPY* = {0}; (* copy into child *) MAP_INHERIT_NONE* = {1}; (* absent from child *) + MAP_INHERIT_ZERO* = {0,1}; (* zero in child *) (* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *) @@ -297,12 +291,15 @@ MODULE LinLibc ["libc.so.70.0"]; ECONNREFUSED* = 61; (* Connection refused *) ELOOP* = 62; (* Too many levels of symbolic links *) ENAMETOOLONG* = 63; (* File name too long *) + EHOSTUNREACH* = 65; (* No route to host *) ENOTEMPTY* = 66; (* Directory not empty *) EDQUOT* = 69; (* Disk quota exceeded *) ESTALE* = 70; (* Stale NFS file handle *) ENOLCK* = 77; (* No locks available *) ENOSYS* = 78; (* Function not implemented *) EILSEQ* = 84; (* Illegal byte sequence *) + EOVERFLOW* = 87; (* Value too large to be stored in data type *) + ECANCELED* = 88; (* Operation canceled *) EIDRM* = 89; (* Identifier removed *) ENOMSG* = 90; (* No message of desired type *) ENOTSUP* = 91; (* Not supported *) @@ -312,13 +309,12 @@ MODULE LinLibc ["libc.so.70.0"]; ESHUTDOWN* = 58; (* Can't send after socket shutdown *) ETOOMANYREFS* = 59; (* Too many references: can't splice *) EHOSTDOWN* = 64; (* Host is down *) - EHOSTUNREACH* = 65; (* No route to host *) EPROCLIM* = 67; (* Too many processes *) EUSERS* = 68; (* Too many users *) EREMOTE* = 71; (* Too many levels of remote in path *) EBADRPC* = 72; (* RPC struct is bad *) ERPCMISMATCH* = 73; (* RPC version wrong *) - EPROGUNAVAIL* = 74; (* RPC prog. not avail *) + EPROGUNAVAIL* = 74; (* RPC program not available *) EPROGMISMATCH* = 75; (* Program version wrong *) EPROCUNAVAIL* = 76; (* Bad procedure for program *) EFTYPE* = 79; (* Inappropriate file type or format *) @@ -327,9 +323,7 @@ MODULE LinLibc ["libc.so.70.0"]; EIPSEC* = 82; (* IPsec processing failure *) ENOATTR* = 83; (* Attribute not found *) ENOMEDIUM* = 85; (* No medium found *) - EMEDIUMTYPE* = 86; (* Wrong Medium Type *) - EOVERFLOW* = 87; (* Conversion overflow *) - ECANCELED* = 88; (* Operation canceled *) + EMEDIUMTYPE* = 86; (* Wrong medium type *) ELAST* = 91; (* Must be equal largest errno *) ERESTART* = -1; (* restart syscall *) EJUSTRETURN* = -2; (* don't modify regs, just return *) @@ -341,6 +335,10 @@ MODULE LinLibc ["libc.so.70.0"]; SEEK_CUR* = 1; SEEK_END* = 2; + STDIN_FILENO* = 0; + STDOUT_FILENO* = 1; + STDERR_FILENO* = 2; + P_tmpdir* = "/tmp"; (* O_RDWR, O_NONBLOCK (intFlags) *) @@ -366,7 +364,6 @@ MODULE LinLibc ["libc.so.70.0"]; CLOCK_REALTIME* = 0; - CLOCK_VIRTUAL* = 1; CLOCK_PROCESS_CPUTIME_ID* = 2; CLOCK_MONOTONIC* = 3; CLOCK_THREAD_CPUTIME_ID* = 4; @@ -396,6 +393,8 @@ MODULE LinLibc ["libc.so.70.0"]; dev_t* = INTEGER; ino_t* = LONGINT; nlink_t* = INTEGER; + blkcnt_t = LONGINT; + blksize_t = INTEGER; int8_t* = SHORTCHAR; u_int8_t* = SHORTCHAR; int16_t* = SHORTINT; @@ -415,7 +414,7 @@ MODULE LinLibc ["libc.so.70.0"]; tmDesc* = RECORD [untagged] (* NOTE: check record size *) (* tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday [ , tm_gmtoff ] *) - (* OpenBSD 5.4 /usr/include/time.h *) + (* OpenBSD 6.0 /usr/include/time.h *) tm_sec*: int; (* seconds after the minute [0-60] *) tm_min*: int; (* minutes after the hour [0-59] *) tm_hour*: int; (* hours since midnight [0-23] *) @@ -432,7 +431,7 @@ MODULE LinLibc ["libc.so.70.0"]; Ptrsiginfo_t* = POINTER TO siginfo_t; siginfo_t = RECORD [untagged] (* si_code, fault address *) - (* OpenBSD 5.4 /usr/include/sys/siginfo.h *) + (* OpenBSD 5.9 /usr/include/sys/siginfo.h *) si_signo*: int; (* signal from signal.h *) si_code*: int; (* code from above *) si_errno*: int; (* error from errno.h *) @@ -465,7 +464,7 @@ MODULE LinLibc ["libc.so.70.0"]; Ptrucontext_t* = POINTER TO ucontext_t; ucontext_t = RECORD [untagged] (* IP, SP, FP *) - (* OpenBSD 5.4 /usr/include/i386/signal.h struct sigcontext *) + (* OpenBSD 5.9 /usr/include/i386/signal.h struct sigcontext *) sc_gs*: int; sc_fs*: int; sc_es*: int; @@ -491,7 +490,7 @@ MODULE LinLibc ["libc.so.70.0"]; sc_err*: int; sc_fpstate*: RECORD [union] - (* OpenBSD 5.4 /usr/include/i386/npx.h union savefpu *) + (* OpenBSD 5.9 /usr/include/i386/npx.h union savefpu *) (* sv_87*: RECORD [untagged] ... @@ -508,7 +507,7 @@ MODULE LinLibc ["libc.so.70.0"]; sa_sigaction*: PROCEDURE [ccall] (sig: INTEGER; siginfo: Ptrsiginfo_t; context: Ptrucontext_t), sa_flags*: intFlags, sa_mask*: sigset_t *) - (* OpenBSD 5.4 /usr/include/sys/signal.h *) + (* OpenBSD 5.9 /usr/include/sys/signal.h *) sa_sigaction*: PROCEDURE [ccall] (sig: int; siginfo: Ptrsiginfo_t; ctx: Ptrucontext_t); sa_mask*: sigset_t; sa_flags*: intFlags; @@ -518,7 +517,7 @@ MODULE LinLibc ["libc.so.70.0"]; (* ss_sp*: PtrVoid, ss_size*: size_t, ss_flags*: intFlags *) - (* OpenBSD 5.4 /usr/include/sys/signal.h *) + (* OpenBSD 5.9 /usr/include/sys/signal.h *) ss_sp*: PtrVoid; (* signal stack base *) ss_size*: size_t; (* signal stack length *) ss_flags*: intFlags; (* SS_DISABLE and/or SS_ONSTACK *) @@ -529,7 +528,7 @@ MODULE LinLibc ["libc.so.70.0"]; NOTE: check record size st_mode*: mode_t, st_size*: off_t, st_mtime*: time_t *) - (* OpenBSD 5.4 /usr/include/sys/stat.h *) + (* OpenBSD 5.9 /usr/include/sys/stat.h *) st_mode*: mode_t; st_dev*: dev_t; st_ino*: ino_t; @@ -546,8 +545,8 @@ MODULE LinLibc ["libc.so.70.0"]; st_ctimensec*: long; st_size*: off_t; - st_blocks*: int64_t; - st_blksize*: u_int32_t; + st_blocks*: blkcnt_t; + st_blksize*: blksize_t; st_flags*: u_int32_t; st_gen*: u_int32_t; @@ -563,7 +562,7 @@ MODULE LinLibc ["libc.so.70.0"]; (* d_name*: ARRAY [untagged] NAME_MAX + 1 OF SHORTCHAR *) - (* OpenBSD 5.4 /usr/include/sys/dirent.h *) + (* OpenBSD 5.9 /usr/include/sys/dirent.h *) d_fileno*: ino_t; (* file number of entry *) d_off*: off_t; (* offset after this entry *) d_reclen*: u_int16_t; (* length of this record *) @@ -574,7 +573,7 @@ MODULE LinLibc ["libc.so.70.0"]; END; timespec_t* = RECORD [untagged] - (* OpenBSD 5.4 /usr/include/time.h *) + (* OpenBSD 5.9 /usr/include/time.h *) tv_sec*: time_t; (* seconds *) tv_nsec*: long; (* and nanoseconds *) END; @@ -591,14 +590,16 @@ MODULE LinLibc ["libc.so.70.0"]; (* POSIX.1 *) PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int; *) +(* VAR (* OpenBSD: stdin, stdout, stderr *) - __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.2 /usr/include/stdio.h *) + __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.8 /usr/include/stdio.h *) (* stdin = SYSTEM.ADR(__sF[0]) stdout = SYSTEM.ADR(__sF[1]) stderr = SYSTEM.ADR(__sF[2]) *) +*) PROCEDURE [ccall] __errno_location* ["__errno"] (): PtrVoid; @@ -650,6 +651,7 @@ MODULE LinLibc ["libc.so.70.0"]; (* ANSI C 89 *) PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE; + PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE; PROCEDURE [ccall] fclose* (stream: PtrFILE): int; PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t; PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Net.txt b/BlackBox/_OpenBSD_/Lin/Mod/Net.txt index 4b74462..bee2677 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Net.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Net.txt @@ -1,24 +1,20 @@ -MODULE LinNet ["libc.so.70.0"]; +MODULE LinNet ["libc.so.89.2"]; (* - A. V. Shiryaev, 2012.11, 2013.08 - - OpenBSD 5.4 - 32-bit + OpenBSD 6.0 + i386 *) - IMPORT Libc := LinLibc; - CONST - INVALID_SOCKET* = -1; + NULL* = 0H; + SOCKET_ERROR* = -1; + INVALID_SOCKET* = -1; - (* /usr/include/sys/socket.h *) - SOCK_STREAM* = 1; (* stream socket *) - SOCK_DGRAM* = 2; (* datagram socket *) - SOCK_RAW* = 3; (* raw-protocol interface *) - SOCK_RDM* = 4; (* reliably-delivered message *) - SOCK_SEQPACKET* = 5; (* sequenced packet stream *) + INADDR_NONE* = -1; + INADDR_ANY* = 0; + + (* socket domains *) AF_UNSPEC* = 0; (* unspecified *) AF_LOCAL* = 1; (* local to host (pipes, portals) *) AF_UNIX* = AF_LOCAL; (* backward compatibility *) @@ -52,49 +48,15 @@ MODULE LinNet ["libc.so.70.0"]; AF_BLUETOOTH* = 32; (* Bluetooth *) AF_MPLS* = 33; (* MPLS *) AF_MAX* = 36; - SHUT_RD* = 0; - SHUT_WR* = 1; - SHUT_RDWR* = 2; - SOMAXCONN* = 128; - SO_DEBUG* = {0}; (* turn on debugging info recording *) - SO_ACCEPTCONN* = {1}; (* socket has had listen() *) - SO_REUSEADDR* = {2}; (* allow local address reuse *) - SO_KEEPALIVE* = {3}; (* keep connections alive *) - SO_DONTROUTE* = {4}; (* just use interface addresses *) - SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *) - SO_USELOOPBACK* = {6}; (* bypass hardware when possible *) - SO_LINGER* = {7}; (* linger on close if data present *) - SO_OOBINLINE* = {8}; (* leave received OOB data in line *) - SO_REUSEPORT* = {9}; (* allow local address & port reuse *) - SO_TIMESTAMP* = {11}; (* timestamp received dgram traffic *) - SO_BINDANY* = {12}; (* allow bind to any address *) - SO_SNDBUF* = {0,12}; (* send buffer size *) - SO_RCVBUF* = {1,12}; (* receive buffer size *) - SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *) - SO_RCVLOWAT* = {2,12}; (* receive low-water mark *) - SO_SNDTIMEO* = {0,2,12}; (* send timeout *) - SO_RCVTIMEO* = {1,2,12}; (* receive timeout *) - SO_ERROR* = {0..2,12}; (* get error status and clear *) - SO_TYPE* = {3,12}; (* get socket type *) - SO_NETPROC* = {5,12}; (* multiplex; network processing *) - SO_RTABLE* = {0,5,12}; (* routing table to be used *) - SO_PEERCRED* = {1,5,12}; (* get connect-time credentials *) - SO_SPLICE* = {0,1,5,12}; (* splice data to other socket *) - SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *) - MSG_OOB* = {0}; (* process out-of-band data *) - MSG_PEEK* = {1}; (* peek at incoming message *) - MSG_DONTROUTE* = {2}; (* send without using routing tables *) - MSG_EOR* = {3}; (* data completes record *) - MSG_TRUNC* = {4}; (* data discarded before delivery *) - MSG_CTRUNC* = {5}; (* control data lost before delivery *) - MSG_WAITALL* = {6}; (* wait for full request or error *) - MSG_DONTWAIT* = {7}; (* this message should be nonblocking *) - MSG_BCAST* = {8}; (* this message rec'd as broadcast *) - MSG_MCAST* = {9}; (* this message rec'd as multicast *) - MSG_NOSIGNAL* = {10}; (* do not send SIGPIPE *) - - (* /usr/include/netinet/in.h *) - INADDR_NONE* = -1; + + (* socket types *) + SOCK_STREAM* = 1; (* stream socket *) + SOCK_DGRAM* = 2; (* datagram socket *) + SOCK_RAW* = 3; (* raw-protocol interface *) + SOCK_RDM* = 4; (* reliably-delivered message *) + SOCK_SEQPACKET* = 5; (* sequenced packet stream *) + + (* socket protocols *) IPPROTO_IP* = 0; (* dummy for IP *) IPPROTO_HOPOPTS* = IPPROTO_IP; (* Hop-by-hop option header *) IPPROTO_ICMP* = 1; (* control message protocol *) @@ -134,126 +96,203 @@ MODULE LinNet ["libc.so.70.0"]; IPPROTO_DIVERT_RESP* = 01H; (* {0} *) (* divert response packets *) IPPROTO_DIVERT_INIT* = 02H; (* {1} *) (* divert packets initial direction *) - (* /usr/include/sys/param.h *) - MAXHOSTNAMELEN* = 256; (* max hostname size *) - - (* /usr/include/netdb.h *) - NETDB_INTERNAL* = -1; (* see errno *) - NETDB_SUCCESS* = 0; (* no problem *) - HOST_NOT_FOUND* = 1; (* Authoritative Answer Host not found *) - TRY_AGAIN* = 2; (* Non-Authoritative Host not found, or SERVERFAIL *) - NO_RECOVERY* = 3; (* Non recoverable errors, FORMERR, REFUSED, NOTIMP *) - NO_DATA* = 4; (* Valid name, no data record of requested type *) - NO_ADDRESS* = NO_DATA; (* no address *) - NI_MAXHOST* = MAXHOSTNAMELEN; (* max host name returned by getnameinfo *) - NI_MAXSERV* = 32; (* max serv. name length returned by getnameinfo *) - RRSET_VALIDATED* = 1; - ERRSET_SUCCESS* = 0; - ERRSET_NOMEMORY* = 1; - ERRSET_FAIL* = 2; - ERRSET_INVAL* = 3; - ERRSET_NONAME* = 4; - ERRSET_NODATA* = 5; - - (* /usr/include/sys/select.h *) + (* socket options *) + SO_DEBUG* = {0}; (* turn on debugging info recording *) + SO_ACCEPTCONN* = {1}; (* socket has had listen() *) + SO_REUSEADDR* = {2}; (* allow local address reuse *) + SO_KEEPALIVE* = {3}; (* keep connections alive *) + SO_DONTROUTE* = {4}; (* just use interface addresses *) + SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *) + SO_USELOOPBACK* = {6}; (* bypass hardware when possible *) + SO_LINGER* = {7}; (* linger on close if data present *) + SO_OOBINLINE* = {8}; (* leave received OOB data in line *) + SO_REUSEPORT* = {9}; (* allow local address & port reuse *) + SO_TIMESTAMP* = {11}; (* timestamp received dgram traffic *) + SO_BINDANY* = {12}; (* allow bind to any address *) + SO_SNDBUF* = {0,12}; (* send buffer size *) + SO_RCVBUF* = {1,12}; (* receive buffer size *) + SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *) + SO_RCVLOWAT* = {2,12}; (* receive low-water mark *) + SO_SNDTIMEO* = {0,2,12}; (* send timeout *) + SO_RCVTIMEO* = {1,2,12}; (* receive timeout *) + SO_ERROR* = {0..2,12}; (* get error status and clear *) + SO_TYPE* = {3,12}; (* get socket type *) + SO_NETPROC* = {5,12}; (* multiplex; network processing *) + SO_RTABLE* = {0,5,12}; (* routing table to be used *) + SO_PEERCRED* = {1,5,12}; (* get connect-time credentials *) + SO_SPLICE* = {0,1,5,12}; (* splice data to other socket *) + + SHUT_RD* = 0; + SHUT_WR* = 1; + SHUT_RDWR* = 2; + + SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *) + + MSG_OOB* = {0}; (* process out-of-band data *) + MSG_PEEK* = {1}; (* peek at incoming message *) + MSG_DONTROUTE* = {2}; (* send without using routing tables *) + MSG_EOR* = {3}; (* data completes record *) + MSG_TRUNC* = {4}; (* data discarded before delivery *) + MSG_CTRUNC* = {5}; (* control data lost before delivery *) + MSG_WAITALL* = {6}; (* wait for full request or error *) + MSG_DONTWAIT* = {7}; (* this message should be nonblocking *) + MSG_BCAST* = {8}; (* this message rec'd as broadcast *) + MSG_MCAST* = {9}; (* this message rec'd as multicast *) + MSG_NOSIGNAL* = {10}; (* do not send SIGPIPE *) + MSG_CMSG_CLOEXEC* = {11}; (* set FD_CLOEXEC on received fds *) + + SOMAXCONN* = 128; + + (* addrinfo.ai_flags *) + AI_PASSIVE* = {0}; (* socket address is intended for bind() *) + AI_CANONNAME* = {1}; (* request for canonical name *) + AI_NUMERICHOST* = {2}; (* don't ever try hostname lookup *) + AI_EXT* = {3}; (* enable non-portable extensions *) + AI_NUMERICSERV* = {4}; (* don't ever try servname lookup *) + AI_FQDN* = {5}; (* return the FQDN that was resolved *) + AI_ADDRCONFIG* = {6}; (* return configured address families only *) + + (* getaddrinfo/getnameinfo/gai_strerror error codes *) + EAI_BADFLAGS* = -1; (* invalid value for ai_flags *) + EAI_NONAME* = -2; (* name or service is not known *) + EAI_AGAIN* = -3; (* temporary failure in name resolution *) + EAI_FAIL* = -4; (* non-recoverable failure in name resolution *) + EAI_NODATA* = -5; (* no address associated with name *) + EAI_FAMILY* = -6; (* ai_family not supported *) + EAI_SOCKTYPE* = -7; (* ai_socktype not supported *) + EAI_SERVICE* = -8; (* service not supported for ai_socktype *) + EAI_ADDRFAMILY* = -9; (* address family for name not supported *) + EAI_MEMORY* = -10; (* memory allocation failure *) + EAI_SYSTEM* = -11; (* system error (code indicated in errno) *) + EAI_BADHINTS* = -12; (* invalid value for hints *) + EAI_PROTOCOL* = -13; (* resolved protocol is unknown *) + EAI_OVERFLOW* = -14; (* argument buffer overflow *) + + (* OpenBSD 6.0 /usr/include/sys/select.h *) FD_SETSIZE = 1024; __NBBY = 8; TYPE - SOCKET* = INTEGER; + u_int8_t = SHORTCHAR; + int8_t = SHORTCHAR; + uint16_t = SHORTINT; + (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *) + PtrVoid* = INTEGER; + short* = SHORTINT; + int* = INTEGER; + intFlags* = SET; + size_t* = INTEGER; + ssize_t* = INTEGER; + time_t* = LONGINT; + suseconds_t* = INTEGER; + socklen_t* = INTEGER; + in_addr_t* = INTEGER; + in_port_t* = SHORTINT; + nfds_t* = INTEGER; + sa_family_t* = SHORTCHAR; + + PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR; + + SOCKET* = int; - (* /usr/include/sys/_types.h *) - socklen_t* = INTEGER; - sa_family_t* = SHORTCHAR; - in_addr_t* = INTEGER; - in_port_t* = SHORTINT; +(* + in_addr* = RECORD [untagged] + s_addr*: in_addr_t; + END; +*) + in_addr* = RECORD [untagged] + S_un*: RECORD [union] + S_un_b*: RECORD [untagged] + s_b1*: SHORTCHAR; + s_b2*: SHORTCHAR; + s_b3*: SHORTCHAR; + s_b4*: SHORTCHAR; + END; + S_un_w*: RECORD [untagged] + s_w1*: SHORTINT; + s_w2*: SHORTINT; + END; + S_addr*: in_addr_t; + END; + END; - (* /usr/include/sys/socket.h *) - sockaddr* = RECORD [untagged] + Ptrsockaddr* = POINTER [untagged] TO sockaddr; + sockaddr* = RECORD [untagged] + (* OpenBSD /usr/include/sys/socket.h *) sa_len*: SHORTCHAR; (* total length *) sa_family*: sa_family_t; (* address family *) sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *) - END; - sockaddr_storage* = RECORD [untagged] + END; + + Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage; + sockaddr_storage* = RECORD [untagged] + (* OpenBSD 6.0 /usr/include/sys/socket.h *) ss_len*: SHORTCHAR; (* total length *) ss_family*: sa_family_t; (* address family *) __ss_pad1: ARRAY [untagged] 6 OF SHORTCHAR; (* align to quad *) __ss_pad2: LONGINT; (* force alignment for stupid compilers *) __ss_pad3: ARRAY [untagged] 240 OF SHORTCHAR; (* pad to a total of 256 bytes *) - END; - - (* /usr/include/netinet/in.h *) -(* - in_addr* = RECORD [untagged] - s_addr*: in_addr_t; - END; -*) - in_addr* = RECORD [untagged] - S_un*: RECORD [union] - S_un_b*: RECORD [untagged] - s_b1*: SHORTCHAR; - s_b2*: SHORTCHAR; - s_b3*: SHORTCHAR; - s_b4*: SHORTCHAR; - END; - S_un_w*: RECORD [untagged] - s_w1*: SHORTINT; - s_w2*: SHORTINT; - END; - S_addr*: in_addr_t; - END; - END; + END; - sockaddr_in* = RECORD [untagged] - sin_len*: SHORTCHAR; + Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in; + sockaddr_in* = RECORD [untagged] + (* OpenBSD /usr/include/netinet/in.h *) + sin_len*: u_int8_t; sin_family*: sa_family_t; sin_port*: in_port_t; sin_addr*: in_addr; - sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR; - END; + sin_zero*: ARRAY [untagged] 8 OF int8_t; + END; - (* /usr/include/netdb.h *) - Ptrhostent* = POINTER TO hostent; - hostent* = RECORD [untagged] - h_name*: Libc.PtrSTR; (* official name of host *) - h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *) - h_addrtype*: INTEGER; (* host address type *) - h_length*: INTEGER; (* length of address *) - h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *) - END; + Ptraddrinfo* = POINTER [untagged] TO addrinfo; + addrinfo* = RECORD [untagged] + (* OpenBSD 6.0 /usr/include/netdb.h *) + ai_flags*: intFlags; (* input flags *) + ai_family*: int; (* protocol family for socket *) + ai_socktype*: int; (* socket type *) + ai_protocol*: int; (* protocol for socket *) + ai_addrlen*: socklen_t; (* length of socket-address *) + ai_addr*: Ptrsockaddr; (* socket-address for socket *) + ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *) + ai_next*: Ptraddrinfo; (* pointer to next in list *) + END; - (* /usr/include/sys/time.h *) - timeval* = RECORD [untagged] - tv_sec*: INTEGER; (* seconds *) - tv_usec*: INTEGER; (* and microseconds *) - END; + timeval* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + tv_sec*: time_t; (* seconds *) + tv_usec*: suseconds_t; (* and microseconds *) + END; + + pollfd* = RECORD [untagged] + (* Linux, FreeBSD, OpenBSD *) + fd*: int; + events*: short; + revents*: short; + END; - (* /usr/include/sys/select.h *) + (* OpenBSD 6.0 /usr/include/sys/select.h *) __fd_mask = SET; fd_set* = ARRAY [untagged] (FD_SETSIZE + (SIZE(__fd_mask) * __NBBY - 1)) DIV (SIZE(__fd_mask) * __NBBY) OF __fd_mask; - VAR - h_errno*: INTEGER; + (* POSIX.1 *) + PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET; + PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; + PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int; + PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int; + PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int; + PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t; + PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int; + PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int; + PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int; - PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET; - PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; - PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER; - PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER; - PROCEDURE [ccall] listen* (s: SOCKET; backlog: INTEGER): INTEGER; - PROCEDURE [ccall] recv* (s: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] send* (s: SOCKET; msg: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] shutdown* (s: SOCKET; how: INTEGER): INTEGER; - PROCEDURE [ccall] getsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER; - PROCEDURE [ccall] setsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER; + PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t; + PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t; - PROCEDURE [ccall] htons* (host16: SHORTINT): SHORTINT; + PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int; - PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent; - PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t; - - PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): INTEGER; - - PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR; + PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int; (* PROCEDURE FD_ZERO (VAR set: Net.fd_set); @@ -268,6 +307,10 @@ MODULE LinNet ["libc.so.70.0"]; END FD_SET; *) - PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER; + (* POSIX.1g *) + PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int; + PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo); + + PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR; -END LinNet. +END LinNet. \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt b/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt index a3162c7..96c9ca2 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt @@ -1,9 +1,9 @@ -MODULE LinTermios ["libc.so.70.0"]; +MODULE LinTermios ["libc.so.89.2"]; (* - A. V. Shiryaev, 2012.11, 2013.08 + A. V. Shiryaev, 2012.11, 2013.08, 2015.09 - OpenBSD 5.4 + OpenBSD 5.8 32-bit *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver new file mode 100644 index 0000000..01f9f66 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver @@ -0,0 +1 @@ +.89.2 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/machine b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/machine new file mode 100644 index 0000000..fd32fa4 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/machine @@ -0,0 +1 @@ +i386 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname new file mode 100644 index 0000000..6fcf4b6 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname @@ -0,0 +1 @@ +OpenBSD 6.0 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom index e522bff..586533b 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom @@ -1,11 +1,13 @@ +(* VAR (* OpenBSD: stdin, stdout, stderr *) - __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.2 /usr/include/stdio.h *) + __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.8 /usr/include/stdio.h *) (* stdin = SYSTEM.ADR(__sF[0]) stdout = SYSTEM.ADR(__sF[1]) stderr = SYSTEM.ADR(__sF[2]) *) +*) PROCEDURE [ccall] __errno_location* ["__errno"] (): PtrVoid; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-dirent b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-dirent index 1fdc134..dcf09aa 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-dirent +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-dirent @@ -1,4 +1,4 @@ - (* OpenBSD 5.4 /usr/include/sys/dirent.h *) + (* OpenBSD 5.9 /usr/include/sys/dirent.h *) d_fileno*: ino_t; (* file number of entry *) d_off*: off_t; (* offset after this entry *) d_reclen*: u_int16_t; (* length of this record *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-sigaction b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-sigaction index e28a208..d7931fc 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-sigaction +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-sigaction @@ -1,4 +1,4 @@ - (* OpenBSD 5.4 /usr/include/sys/signal.h *) + (* OpenBSD 5.9 /usr/include/sys/signal.h *) sa_sigaction*: PROCEDURE [ccall] (sig: int; siginfo: Ptrsiginfo_t; ctx: Ptrucontext_t); sa_mask*: sigset_t; sa_flags*: intFlags; \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-siginfo b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-siginfo index 18b1899..e140d85 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-siginfo +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-siginfo @@ -1,4 +1,4 @@ - (* OpenBSD 5.4 /usr/include/sys/siginfo.h *) + (* OpenBSD 5.9 /usr/include/sys/siginfo.h *) si_signo*: int; (* signal from signal.h *) si_code*: int; (* code from above *) si_errno*: int; (* error from errno.h *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stack b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stack index 3136138..fa8962d 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stack +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stack @@ -1,4 +1,4 @@ - (* OpenBSD 5.4 /usr/include/sys/signal.h *) + (* OpenBSD 5.9 /usr/include/sys/signal.h *) ss_sp*: PtrVoid; (* signal stack base *) ss_size*: size_t; (* signal stack length *) ss_flags*: intFlags; (* SS_DISABLE and/or SS_ONSTACK *) \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stat b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stat index 20f9c0a..0300013 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stat +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stat @@ -1,4 +1,4 @@ - (* OpenBSD 5.4 /usr/include/sys/stat.h *) + (* OpenBSD 5.9 /usr/include/sys/stat.h *) st_mode*: mode_t; st_dev*: dev_t; st_ino*: ino_t; @@ -15,8 +15,8 @@ st_ctimensec*: long; st_size*: off_t; - st_blocks*: int64_t; - st_blksize*: u_int32_t; + st_blocks*: blkcnt_t; + st_blksize*: blksize_t; st_flags*: u_int32_t; st_gen*: u_int32_t; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec index ed5eb09..47cd29e 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec @@ -1,3 +1,3 @@ - (* OpenBSD 5.4 /usr/include/time.h *) + (* OpenBSD 5.9 /usr/include/time.h *) tv_sec*: time_t; (* seconds *) tv_nsec*: long; (* and nanoseconds *) \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-tm b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-tm index 4c70ef6..4030e26 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-tm +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-tm @@ -1,4 +1,4 @@ - (* OpenBSD 5.4 /usr/include/time.h *) + (* OpenBSD 6.0 /usr/include/time.h *) tm_sec*: int; (* seconds after the minute [0-60] *) tm_min*: int; (* minutes after the hour [0-59] *) tm_hour*: int; (* hours since midnight [0-23] *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-ucontext b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-ucontext index 43b443d..397ded8 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-ucontext +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-ucontext @@ -1,4 +1,4 @@ - (* OpenBSD 5.4 /usr/include/i386/signal.h struct sigcontext *) + (* OpenBSD 5.9 /usr/include/i386/signal.h struct sigcontext *) sc_gs*: int; sc_fs*: int; sc_es*: int; @@ -24,7 +24,7 @@ sc_err*: int; sc_fpstate*: RECORD [union] - (* OpenBSD 5.4 /usr/include/i386/npx.h union savefpu *) + (* OpenBSD 5.9 /usr/include/i386/npx.h union savefpu *) (* sv_87*: RECORD [untagged] ... diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver index 3d9c28b..8681f06 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver @@ -1 +1 @@ -.70.0 \ No newline at end of file +.86.0 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py index fdefe88..3a22993 100755 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py @@ -15,6 +15,7 @@ def main (): #include #include +#include static void D (const char *s, int e) { diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname index 6811404..3cc5971 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname @@ -1 +1 @@ -OpenBSD 5.4 \ No newline at end of file +OpenBSD 5.9 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c index b2ad10d..efd53bd 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c @@ -69,6 +69,8 @@ int main () D("dev_t", sizeof(dev_t), FALSE, TRUE); D("ino_t", sizeof(ino_t), FALSE, TRUE); D("nlink_t", sizeof(nlink_t), FALSE, TRUE); + D("blkcnt_t", sizeof(blkcnt_t), FALSE, FALSE); + D("blksize_t", sizeof(blksize_t), FALSE, FALSE); D("int8_t", sizeof(int8_t), FALSE, TRUE); D("u_int8_t", sizeof(u_int8_t), FALSE, TRUE); D("int16_t", sizeof(int16_t), FALSE, TRUE); diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Makefile b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Makefile index 9fe82db..dadffc4 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Makefile +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Makefile @@ -6,28 +6,47 @@ INCDIR ?= /usr/include -all: Net.txt dumphstrerrno - PY = python2.7 -DEFS = defs-socket defs-in defs-netdb -Net.txt: Net.txt.templ ${DEFS} +DEFS = defs-basictypes defs-af defs-sock defs-proto defs-shut defs-so defs-sol defs-msg defs-ai defs-eai defs-somaxconn + +all: Net.txt ${DEFS} + +Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type ${PY} ./untempl.py Net.txt.templ ${.TARGET} -defs-socket: +defs-basictypes: sizeofs + ./sizeofs > ${.TARGET} + +defs-af: + ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " AF_" > ${.TARGET} + +defs-sock: ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " SOCK_" > ${.TARGET} - ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " AF_" >> ${.TARGET} - ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " SHUT_" >> ${.TARGET} - ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " SOMAXCONN" >> ${.TARGET} - ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep " SO_" >> ${.TARGET} - ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep " SOL_" >> ${.TARGET} - ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep " MSG_" >> ${.TARGET} - -defs-in: + +defs-proto: ./dumpdefs.py 3 1 i ${INCDIR}/netinet/in.h | grep " IPPROTO_" > ${.TARGET} -defs-netdb: - ./dumpdefs.py 3 2 i ${INCDIR}/netdb.h > ${.TARGET} +defs-sol: + ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep " SOL_" > ${.TARGET} + +defs-msg: + ./dumpdefs.py 2 1 s ${INCDIR}/sys/socket.h | grep " MSG_" > ${.TARGET} + +defs-somaxconn: + ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep " SOMAXCONN" > ${.TARGET} + +defs-so: + ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep " SO_" > ${.TARGET} + +defs-shut: + ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep " SHUT_" > ${.TARGET} + +defs-ai: + ./dumpdefs.py 3 1 s ${INCDIR}/netdb.h | grep " AI_" > ${.TARGET} + +defs-eai: + ./dumpdefs.py 3 1 i ${INCDIR}/netdb.h | grep " EAI_" > ${.TARGET} clean: - rm -f Net.txt ${DEFS} dumphstrerrno + rm -f ${DEFS} Net.txt sizeofs diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ deleted file mode 100644 index 29b9011..0000000 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ +++ /dev/null @@ -1,141 +0,0 @@ -MODULE LinNet ["libc.so.70.0"]; - - (* - A. V. Shiryaev, 2012.11, 2013.08 - - OpenBSD 5.4 - 32-bit - *) - - IMPORT Libc := LinLibc; - - CONST - INVALID_SOCKET* = -1; - SOCKET_ERROR* = -1; - - (* /usr/include/sys/socket.h *) -%%defs-socket%% - (* /usr/include/netinet/in.h *) - INADDR_NONE* = -1; -%%defs-in%% - (* /usr/include/sys/param.h *) - MAXHOSTNAMELEN* = 256; (* max hostname size *) - - (* /usr/include/netdb.h *) -%%defs-netdb%% - (* /usr/include/sys/select.h *) - FD_SETSIZE = 1024; - __NBBY = 8; - - TYPE - SOCKET* = INTEGER; - - (* /usr/include/sys/_types.h *) - socklen_t* = INTEGER; - sa_family_t* = SHORTCHAR; - in_addr_t* = INTEGER; - in_port_t* = SHORTINT; - - (* /usr/include/sys/socket.h *) - sockaddr* = RECORD [untagged] - sa_len*: SHORTCHAR; (* total length *) - sa_family*: sa_family_t; (* address family *) - sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *) - END; - sockaddr_storage* = RECORD [untagged] - ss_len*: SHORTCHAR; (* total length *) - ss_family*: sa_family_t; (* address family *) - __ss_pad1: ARRAY [untagged] 6 OF SHORTCHAR; (* align to quad *) - __ss_pad2: LONGINT; (* force alignment for stupid compilers *) - __ss_pad3: ARRAY [untagged] 240 OF SHORTCHAR; (* pad to a total of 256 bytes *) - END; - - (* /usr/include/netinet/in.h *) -(* - in_addr* = RECORD [untagged] - s_addr*: in_addr_t; - END; -*) - in_addr* = RECORD [untagged] - S_un*: RECORD [union] - S_un_b*: RECORD [untagged] - s_b1*: SHORTCHAR; - s_b2*: SHORTCHAR; - s_b3*: SHORTCHAR; - s_b4*: SHORTCHAR; - END; - S_un_w*: RECORD [untagged] - s_w1*: SHORTINT; - s_w2*: SHORTINT; - END; - S_addr*: in_addr_t; - END; - END; - - sockaddr_in* = RECORD [untagged] - sin_len*: SHORTCHAR; - sin_family*: sa_family_t; - sin_port*: in_port_t; - sin_addr*: in_addr; - sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR; - END; - - (* /usr/include/netdb.h *) - Ptrhostent* = POINTER TO hostent; - hostent* = RECORD [untagged] - h_name*: Libc.PtrSTR; (* official name of host *) - h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *) - h_addrtype*: INTEGER; (* host address type *) - h_length*: INTEGER; (* length of address *) - h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *) - END; - - (* /usr/include/sys/time.h *) - timeval* = RECORD [untagged] - tv_sec*: INTEGER; (* seconds *) - tv_usec*: INTEGER; (* and microseconds *) - END; - - (* /usr/include/sys/select.h *) - __fd_mask = SET; - fd_set* = ARRAY [untagged] (FD_SETSIZE + (SIZE(__fd_mask) * __NBBY - 1)) DIV (SIZE(__fd_mask) * __NBBY) OF __fd_mask; - - VAR - h_errno*: INTEGER; - - PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET; - PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET; - PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER; - PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER; - PROCEDURE [ccall] listen* (s: SOCKET; backlog: INTEGER): INTEGER; - PROCEDURE [ccall] recv* (s: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] send* (s: SOCKET; msg: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t; - PROCEDURE [ccall] shutdown* (s: SOCKET; how: INTEGER): INTEGER; - PROCEDURE [ccall] getsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER; - PROCEDURE [ccall] setsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER; - - PROCEDURE [ccall] htons* (host16: SHORTINT): SHORTINT; - - PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent; - PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t; - - PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): INTEGER; - - PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR; - -(* - PROCEDURE FD_ZERO (VAR set: Net.fd_set); - VAR i: INTEGER; - BEGIN - i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 - END FD_ZERO; - - PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); - BEGIN - INCL(set[fd DIV 32], fd MOD 32) - END FD_SET; -*) - - PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER; - -END LinNet. diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-const b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-const new file mode 100644 index 0000000..e9939f3 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-const @@ -0,0 +1,3 @@ + (* OpenBSD 6.0 /usr/include/sys/select.h *) + FD_SETSIZE = 1024; + __NBBY = 8; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-type b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-type new file mode 100644 index 0000000..7c936d5 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-type @@ -0,0 +1,3 @@ + (* OpenBSD 6.0 /usr/include/sys/select.h *) + __fd_mask = SET; + fd_set* = ARRAY [untagged] (FD_SETSIZE + (SIZE(__fd_mask) * __NBBY - 1)) DIV (SIZE(__fd_mask) * __NBBY) OF __fd_mask; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c deleted file mode 100644 index e839256..0000000 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -static void D (const char *s, int e) -{ - printf("%s, %s\n", s, hstrerror(e)); -} - -int main (int argc, char *argv[]) -{ - D("NETDB_INTERNAL", NETDB_INTERNAL); - D("NETDB_SUCCESS", NETDB_SUCCESS); - D("HOST_NOT_FOUND", HOST_NOT_FOUND); - D("TRY_AGAIN", TRY_AGAIN); - D("NO_RECOVERY", NO_RECOVERY); - D("NO_DATA", NO_DATA); - - return 0; -} diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-addrinfo b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-addrinfo new file mode 100644 index 0000000..1c9c112 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-addrinfo @@ -0,0 +1,9 @@ + (* OpenBSD 6.0 /usr/include/netdb.h *) + ai_flags*: intFlags; (* input flags *) + ai_family*: int; (* protocol family for socket *) + ai_socktype*: int; (* socket type *) + ai_protocol*: int; (* protocol for socket *) + ai_addrlen*: socklen_t; (* length of socket-address *) + ai_addr*: Ptrsockaddr; (* socket-address for socket *) + ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *) + ai_next*: Ptraddrinfo; (* pointer to next in list *) \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr new file mode 100644 index 0000000..8024438 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr @@ -0,0 +1,4 @@ + (* OpenBSD /usr/include/sys/socket.h *) + sa_len*: SHORTCHAR; (* total length *) + sa_family*: sa_family_t; (* address family *) + sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *) \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_in b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_in new file mode 100644 index 0000000..b4893d3 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_in @@ -0,0 +1,6 @@ + (* OpenBSD /usr/include/netinet/in.h *) + sin_len*: u_int8_t; + sin_family*: sa_family_t; + sin_port*: in_port_t; + sin_addr*: in_addr; + sin_zero*: ARRAY [untagged] 8 OF int8_t; \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage new file mode 100644 index 0000000..27ace91 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage @@ -0,0 +1,6 @@ + (* OpenBSD 6.0 /usr/include/sys/socket.h *) + ss_len*: SHORTCHAR; (* total length *) + ss_family*: sa_family_t; (* address family *) + __ss_pad1: ARRAY [untagged] 6 OF SHORTCHAR; (* align to quad *) + __ss_pad2: LONGINT; (* force alignment for stupid compilers *) + __ss_pad3: ARRAY [untagged] 240 OF SHORTCHAR; (* pad to a total of 256 bytes *) \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver new file mode 100644 index 0000000..01f9f66 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver @@ -0,0 +1 @@ +.89.2 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/machine b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/machine new file mode 100644 index 0000000..fd32fa4 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/machine @@ -0,0 +1 @@ +i386 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname new file mode 100644 index 0000000..6fcf4b6 --- /dev/null +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname @@ -0,0 +1 @@ +OpenBSD 6.0 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ index 055af28..5ef897d 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ @@ -1,9 +1,9 @@ -MODULE LinTermios ["libc.so.70.0"]; +MODULE LinTermios ["libc.so.86.0"]; (* - A. V. Shiryaev, 2012.11, 2013.08 + A. V. Shiryaev, 2012.11, 2013.08, 2015.09 - OpenBSD 5.4 + OpenBSD 5.8 32-bit *) diff --git a/BlackBox/_OpenBSD_/Lin/Rsrc/loader/Makefile b/BlackBox/_OpenBSD_/Lin/Rsrc/loader/Makefile index f4104dd..855cd8a 100644 --- a/BlackBox/_OpenBSD_/Lin/Rsrc/loader/Makefile +++ b/BlackBox/_OpenBSD_/Lin/Rsrc/loader/Makefile @@ -11,7 +11,7 @@ all: loader # -pthread required to dlopen libraries that depends on pthread loader: loader.c - ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -pthread + ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -pthread -Wl,-z,'wxneeded' clean: rm -f loader diff --git a/BlackBox/_OpenBSD_/Lin/Rsrc/loader/loader b/BlackBox/_OpenBSD_/Lin/Rsrc/loader/loader index bea6f87..67d4065 100755 Binary files a/BlackBox/_OpenBSD_/Lin/Rsrc/loader/loader and b/BlackBox/_OpenBSD_/Lin/Rsrc/loader/loader differ diff --git a/BlackBox/_OpenBSD_/System/Mod/Kernel.odc b/BlackBox/_OpenBSD_/System/Mod/Kernel.odc index fc065a2..d754e3d 100644 Binary files a/BlackBox/_OpenBSD_/System/Mod/Kernel.odc and b/BlackBox/_OpenBSD_/System/Mod/Kernel.odc differ diff --git a/BlackBox/_OpenBSD_/libBB.so b/BlackBox/_OpenBSD_/libBB.so index 62b54f7..2f57f6b 100644 Binary files a/BlackBox/_OpenBSD_/libBB.so and b/BlackBox/_OpenBSD_/libBB.so differ diff --git a/BlackBox/_OpenBSD_/libBB0.so b/BlackBox/_OpenBSD_/libBB0.so index aac734e..8c5cfb0 100644 Binary files a/BlackBox/_OpenBSD_/libBB0.so and b/BlackBox/_OpenBSD_/libBB0.so differ