/
githubmirror
/
rsyslog
Обзор
Документация
Войти
/
githubmirror
/
rsyslog
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/rscript_int2Hex.sh
27 строк
807 B
Rainer Gerhards
tests: bind IPv4-only imtcp listeners to loopback
05 июл 2026, 15:39
05 июл 2026, 15:39
3c858bc
Код
Авторство
О чём код?
#!/bin/bash # add 2017-02-09 by Jan Gerhards, released under ASL 2.0 . ${srcdir:=.}/diag.sh init generate_conf add_conf ' module(load="../plugins/imtcp/.libs/imtcp") input(type="imtcp" address="127.0.0.1" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port") set $!ip!v0 = int2hex(""); set $!ip!v1 = int2hex("0"); set $!ip!v2 = int2hex("1"); set $!ip!v4 = int2hex("375894"); set $!ip!v6 = int2hex("16"); set $!ip!v8 = int2hex("4294967295"); set $!ip!e1 = int2hex("a"); template(name="outfmt" type="string" string="%!ip%\n") local4.* action(type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="outfmt") ' startup tcpflood -m1 -y shutdown_when_empty wait_shutdown export EXPECTED='{ "v0": "0", "v1": "0", "v2": "1", "v4": "5bc56", "v6": "10", "v8": "ffffffff", "e1": "NAN" }' cmp_exact exit_test