2 # SPDX-License-Identifier: GPL-2.0
4 # A simple program for generating traffic for the toeplitz test.
6 # This program sends packets periodically for, conservatively, 20 seconds. The
7 # intent is for the calling program to kill this program once it is no longer
8 # needed, rather than waiting for the 20 second expiration.
11 expiration
=$
((SECONDS
+20))
12 while [[ "${SECONDS}" -lt "${expiration}" ]]
14 if [[ "${PROTO}" == "-u" ]]; then
15 echo "msg $i" | nc
"${IPVER}" -u -w 0 "${ADDR}" "${PORT}"
17 echo "msg $i" | nc
"${IPVER}" -w 0 "${ADDR}" "${PORT}"