From 586d67665d3439769bd896b9f5779970ab127955 Mon Sep 17 00:00:00 2001 From: Paul ALNET Date: Thu, 7 Mar 2024 11:41:02 +0100 Subject: [PATCH] doc: usage --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 63ba6f7..668a8f0 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,39 @@ zip LACAU-ALNET-TP1.zip tsock_v*.c README.md ## Running -TODO help output +``` +usage: ./t_sockv1 <-u> [-ps] [host] +parameters: host With -s, address of the host to connect to. Required with -s. + port Port to connect or bind to. Required. +options: -p Runs a TCP/UDP sink. Incompatible with -s. + -s Runs a TCP/UDP faucet. Incompatible with -p. + -u Use UDP instead of TCP. Required. + +usage: ./t_sockv2 [-psu] [host] +parameters: host With -s, address of the host to connect to. Required with -s. + port Port to connect or bind to. Required. +options: -p Runs a TCP/UDP sink. Incompatible with -s. + -s Runs a TCP/UDP faucet. Incompatible with -p. + -u Use UDP instead of TCP. + +usage: ./t_sockv3 [-psu] [-n nb_messages] [-l mess_length] [host] +parameters: host With -s, address of the host to connect to. Required with -s. + port Port to connect or bind to. Required. +options: -l mess_length Size of the messages to send. Min 5. Max 1400. Default 30. + -n nb_messages Number of messages to send. Min 1. Default 10. Ignored with -p. + -p Runs a TCP/UDP sink. Incompatible with -s. + -s Runs a TCP/UDP faucet. Incompatible with -p. + -u Use UDP instead of TCP. +``` + +Example usage of v3 : + +``` +./t_sockv3 -p -l 15 4000 # receiver +./t_sockv3 -s -l 15 localhost 4000 # sender +``` + + ## Roadmap