Commit Graph

10 Commits

Author SHA1 Message Date
Willy Tarreau 8dd672523f BUILD: makefile: move default verbosity settings to include/make/verbose.mk
The $(Q), $(V), $(cmd_xx) handling needs to be reused in sub-project
makefiles and it's a pain to maintain inside the main makefile. Let's
just move that into a new subdir include/make/ with a dedicated file
"verbose.mk". It slightly cleans up the makefile in addition.
2022-11-17 10:56:35 +01:00
Willy Tarreau d575661d40 BUILD: makefile: properly pass CC to sub-projects
The "poll" and "tcploop" sub-projects have their own makefiles. But
since the cmd_* commands were migrated from "echo" to $(info) with
make 3.81, the command is confusingly displayed in the top-level
makefile before entering the directory, even making one think that
the build occurred.

Let's instead propagate the verbosity level through the sub-projects
and let them adapt their own cmd_CC. For now this peans a little bit
of duplication for poll and tcploop.
2022-11-17 10:56:35 +01:00
Willy Tarreau 2d7cd3e4ca DEV: tcploop: add minimal UDP support
Passing "-u" turns to SOCK_DGRAM + IPPROTO_UDP, which still allows
bind/connect()/recv()/send() and can be convenient for experimentation
purposes.
2022-06-08 14:42:15 +02:00
Willy Tarreau d493331d47 DEV: tcploop: add a new "bind" command to bind to ip/port.
The Listen command automatically relies on it (without passing its
argument), and both Listen and Connect now support working with the
existing socket, so that it's possible to Bind an ip:port on an
existing socket or to create a new one for the purpose of listening
or connecting. It now becomes possible to do:

   tcploop 0 L1234 C8888

to connect from port 1234 to port 8888.
2022-06-08 14:42:15 +02:00
Willy Tarreau cb284c7a62 DEV: tcploop: permit port 0 to ease handling of default options
This will also be convenient when binding to an IP and no port.
2022-06-08 14:42:15 +02:00
Willy Tarreau ff13dadaa5 DEV: tcploop: factor out the socket creation
This will later permit to separately bind() before connect(). Let's
first deal with existing sockets.
2022-06-08 14:42:15 +02:00
Willy Tarreau 542bf0a7bb DEV: tcploop: make it possible to change the target address of a connect()
Sometimes it's more convenient to be able to specify where to connect on
the connect() statement, let's make it possible to pass it in argument to
the C command.
2022-06-08 14:42:15 +02:00
Willy Tarreau 7184ca23c6 DEV: tcploop: make the current address the default address
It's difficult to refine bind/connect right now, let's make the address
optionall by turning it to the default one.
2022-06-08 14:42:15 +02:00
Willy Tarreau 98028c8d0a DEV: tcploop: reorder options in the usage message
Options have become difficult to find, let's reorder them alphabetically.
2022-06-08 14:42:15 +02:00
Willy Tarreau 074ebcde29 CONTRIB: move some dev-specific tools to dev/
The following directories were moved from contrib/ to dev/ to make their
use case a bit clearer. In short, only developers are expected to ever
go there. The makefile was updated to build and clean from these ones.

base64/  flags/  hpack/  plug_qdisc/  poll/  tcploop/  trace/
2021-04-02 17:48:42 +02:00