Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

update docs

This commit is contained in:
bol-van
2026-02-03 22:33:10 +03:00
parent c436470b18
commit 831cf02ad5
3 changed files with 49 additions and 2 deletions

View File

@@ -214,3 +214,7 @@ v0.8.1
* nfqws2: conntrack_feed * nfqws2: conntrack_feed
* winws2: use windivert bulk mode * winws2: use windivert bulk mode
* nfqws2: template free import * nfqws2: template free import
0.9.1
* nfqws2: 'stat', 'clock_getfloattime' luacalls

View File

@@ -75,6 +75,7 @@
- [uname](#uname) - [uname](#uname)
- [clock\_gettime](#clock_gettime) - [clock\_gettime](#clock_gettime)
- [getpid](#getpid) - [getpid](#getpid)
- [stat](#stat)
- [Packet handling options](#packet-handling-options) - [Packet handling options](#packet-handling-options)
- [standard reconstruct](#standard-reconstruct) - [standard reconstruct](#standard-reconstruct)
- [standard rawsend](#standard-rawsend) - [standard rawsend](#standard-rawsend)
@@ -1954,9 +1955,11 @@ On Windows, it returns a string starting with "CYGWIN" followed by the version.
``` ```
function clock_gettime() function clock_gettime()
function clock_getfloattime()
``` ```
Retrieves the precise time. Returns two values: Unix time in seconds and the nanosecond component. The built-in `os.time()` function does not provide nanoseconds. clock_gettime retrieves the precise time. Returns two values: Unix time in seconds and the nanosecond component. The built-in `os.time()` function does not provide nanoseconds.
clock_getfloattime returns unixtime in the floating point format. Nanoseconds go to the fractional part.
#### getpid #### getpid
@@ -1968,6 +1971,24 @@ function gettid()
- `getpid()` returns the current process identifier (PID). - `getpid()` returns the current process identifier (PID).
- `gettid()` returns the current thread identifier (TID). - `gettid()` returns the current thread identifier (TID).
#### stat
```
function stat(filename)
```
If successful returns the following table :
| Field | Type | Description |
| :------- | :----- | :---------- |
| type | string | file type : file, dir, symlink, socket, blockdev, chardev, fifo, unknown |
| size | number | file size |
| mtime | number | modification unixtime in floating point format |
| inode | number | inode. In Windows doesn't fit into number datatype in luajit but fits into integer datatype of Lua5.3+ |
| dev | number | device id |
In case of error returns 3 values : nil, error string, error number (errno).
### Packet handling options ### Packet handling options
The following functions use standard sets of options: `rawsend` and `reconstruct`. The following functions use standard sets of options: `rawsend` and `reconstruct`.

View File

@@ -72,6 +72,7 @@
- [uname](#uname) - [uname](#uname)
- [clock\_gettime](#clock_gettime) - [clock\_gettime](#clock_gettime)
- [getpid](#getpid) - [getpid](#getpid)
- [stat](#stat)
- [Опции по работе с пакетами](#опции-по-работе-с-пакетами) - [Опции по работе с пакетами](#опции-по-работе-с-пакетами)
- [standard reconstruct](#standard-reconstruct) - [standard reconstruct](#standard-reconstruct)
- [standard rawsend](#standard-rawsend) - [standard rawsend](#standard-rawsend)
@@ -2101,9 +2102,11 @@ function uname()
``` ```
function clock_gettime() function clock_gettime()
function clock_getfloattime()
``` ```
Узнать точное время. Возвращает 2 значения - unixtime в секундах и наносекунды. Встроенная функция `os.time()` не выдает наносекунды. Узнать точное время. clock_gettime возвращает 2 значения - unixtime в секундах и наносекунды. Встроенная функция `os.time()` не выдает наносекунды.
clock_getfloattime возвращает unixtime в формате с плавающей точкой. Наносекунды идут в дробную часть.
#### getpid #### getpid
@@ -2115,6 +2118,25 @@ function gettid()
- getpid() возвращает идентификатор текущего процесса - PID - getpid() возвращает идентификатор текущего процесса - PID
- gettid() возвращает идентификатор текущего потока - TID - gettid() возвращает идентификатор текущего потока - TID
#### stat
```
function stat(filename)
```
В случае успеха возвращает таблицу :
| Поле | Тип | Описание |
| :------- | :----- | :---------- |
| type | string | тип файла : file, dir, symlink, socket, blockdev, chardev, fifo, unknown |
| size | number | размер файла |
| mtime | number | unixtime время модификации в формате с плавающей точкой |
| inode | number | inode. на Windows не влезает в тип number luajit, но влезает в integer Lua 5.3+ |
| dev | number | device id |
В случае неудачи возвращает 3 результата : nil, строка ошибки, код ошибки errno.
### Опции по работе с пакетами ### Опции по работе с пакетами
В следующих функциях будут использоваться стандартные наборы опций - rawsend и reconstruct. В следующих функциях будут использоваться стандартные наборы опций - rawsend и reconstruct.