haproxy/src
Baptiste Assmann e279ca6bbe MINOR: sample: Add converts to parses MQTT messages
This patch implements a couple of converters to validate and extract data from a
MQTT (Message Queuing Telemetry Transport) message. The validation consists of a
few checks as well as "packet size" validation. The extraction can get any field
from the variable header and the payload.

This is limited to CONNECT and CONNACK packet types only. All other messages are
considered as invalid. It is not a problem for now because only the first packet
on each side can be parsed (CONNECT for the client and CONNACK for the server).

MQTT 3.1.1 and 5.0 are supported.

Reviewed and Fixed by Christopher Faulet <cfaulet@haproxy.com>
2020-11-05 19:27:03 +01:00
..
51d.c CLEANUP: Do not use a fixed type for 'sizeof' in 'calloc' 2020-09-12 20:31:25 +02:00
acl.c MINOR: arg: Use chunk_destroy() to release string arguments 2020-08-07 14:27:54 +02:00
action.c MEDIUM: tcp-rules: Warn if a track-sc* content rule doesn't depend on content 2020-10-02 15:50:26 +02:00
activity.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
applet.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
arg.c CLEANUP: Do not use a fixed type for 'sizeof' in 'calloc' 2020-09-12 20:31:25 +02:00
auth.c BUG/MINOR: auth: report valid crypto(3) support depending on build options 2020-09-08 14:34:04 +02:00
backend.c MEDIUM: fwlc: re-enable per-server queuing up to maxqueue 2020-10-22 18:30:25 +02:00
base64.c REORG: include: move base64.h, errors.h and hash.h from common to to haproxy/ 2020-06-11 10:18:56 +02:00
cache.c BUG/MINOR: cache: Inverted variables in http_calc_maxage function 2020-10-30 14:29:29 +01:00
calltrace.c BUILD: trace: include tools.h 2020-09-25 17:54:48 +02:00
cfgparse-global.c MEDIUM: config: remove the deprecated and dangerous global "debug" directive 2020-10-09 19:18:45 +02:00
cfgparse-listen.c MEDIUM: proxy: remove obsolete "monitor-net" 2020-10-15 21:47:04 +02:00
cfgparse-ssl.c BUILD: ssl: use feature macros for detecting ec curves manipulation support 2020-11-05 15:08:41 +01:00
cfgparse-tcp.c MINOR: receiver: move the FOREIGN and V6ONLY options from listener to settings 2020-09-16 22:08:07 +02:00
cfgparse-unix.c MINOR: listener: create a new struct "settings" in bind_conf 2020-09-16 20:13:13 +02:00
cfgparse.c MINOR: backend: replace the lbprm lock with an rwlock 2020-10-17 18:51:41 +02:00
channel.c MINOR: channel: new getword and getchar functions on channel. 2020-10-07 17:17:27 +02:00
check.c BUG/MINOR: checks: Report a socket error before any connection attempt 2020-11-03 10:23:00 +01:00
chunk.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
cli.c MINOR: mworker/cli: the master CLI use its own applet 2020-11-05 10:28:53 +01:00
compression.c BUILD: compression: make gcc 10 happy with free_zlib() 2020-06-14 08:00:19 +02:00
connection.c MINOR: connection: make sockaddr_alloc() take the address to be copied 2020-10-15 21:47:56 +02:00
da.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
debug.c BUG/MINOR: debug: Don't dump the lua stack if it is not initialized 2020-07-27 09:37:18 +02:00
dgram.c REORG: dgram: rename proto_udp to dgram 2020-06-11 10:18:59 +02:00
dict.c REORG: include: move THREAD_LOCAL and __decl_thread() to compiler.h 2020-06-11 10:18:59 +02:00
dns.c MINOR: dns/stats: integrate dns counters in stats 2020-10-05 12:02:14 +02:00
dynbuf.c REORG: buffer: rename buffer.c to dynbuf.c 2020-06-29 09:26:59 +02:00
eb32sctree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
eb32tree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
eb64tree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebimtree.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
ebistree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebmbtree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebpttree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebsttree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebtree.c BUG/MEDIUM: ebtree: use a byte-per-byte memcmp() to compare memory blocks 2020-06-16 11:30:33 +02:00
ev_epoll.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_evports.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_kqueue.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_poll.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_select.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
extcheck.c BUG/MINOR: extcheck: add missing checks on extchk_setenv() 2020-10-24 13:07:39 +02:00
fcgi-app.c BUG/MEDIUM: fcgi-app: fix memory leak in fcgi_flt_http_headers 2020-07-15 20:23:29 +02:00
fcgi.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
fd.c MINOR: fd: report an error message when failing initial allocations 2020-10-13 18:15:33 +02:00
filters.c BUG/MINOR: filters: Skip disabled proxies during startup only 2020-11-03 16:51:48 +01:00
fix.c MINOR: sample: Add converters to parse FIX messages 2020-11-05 19:26:30 +01:00
flt_http_comp.c CLEANUP: compression: Make use of http_get_etag_type() 2020-10-22 16:59:36 +02:00
flt_spoe.c BUG/MEDIUM: spoe: Unset variable instead of set it if no data provided 2020-10-16 19:53:17 +02:00
flt_trace.c CLEANUP: assorted typo fixes in the code and comments 2020-07-31 11:18:07 +02:00
freq_ctr.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
frontend.c REORG: listener: move the receiving FD to struct receiver 2020-09-16 22:08:03 +02:00
h1.c BUILD: tree-wide: cast arguments to tolower/toupper to unsigned char 2020-07-05 21:50:02 +02:00
h1_htx.c MEDIUM: htx: Add a flag on a HTX message when no more data are expected 2020-07-22 16:43:32 +02:00
h2.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
haproxy.c BUG/MINOR: proxy/server: Skip per-proxy/server post-check for disabled proxies 2020-11-03 10:23:00 +01:00
hash.c REORG: include: move base64.h, errors.h and hash.h from common to to haproxy/ 2020-06-11 10:18:56 +02:00
hlua.c BUG/MINOR: lua: initialize sample before using it 2020-10-29 18:52:44 +01:00
hlua_fcn.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
hpack-dec.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
hpack-enc.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
hpack-huff.c REORG: include: move hpack*.h to haproxy/ and split hpack-tbl 2020-06-11 10:18:57 +02:00
hpack-tbl.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
http.c MINOR: http: Add etag comparison function 2020-10-22 16:06:20 +02:00
http_acl.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
http_act.c MINOR: http-rules: Add set-pathq and replace-pathq actions 2020-09-04 11:41:46 +02:00
http_ana.c BUG/MINOR: cache: Manage multiple values in cache-control header value 2020-10-30 13:28:34 +01:00
http_conv.c CLEANUP: assorted typo fixes in the code and comments 2020-07-06 14:34:32 +02:00
http_fetch.c BUG/MINOR: http-fetch: Don't set the sample type during the htx prefetch 2020-09-18 11:06:24 +02:00
http_htx.c BUG/MINOR: http-htx: Expect no body for 204/304 internal HTTP responses 2020-10-09 10:02:09 +02:00
http_rules.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
htx.c CLEANUP: assorted typo fixes in the code and comments 2020-07-06 14:34:32 +02:00
lb_chash.c MINOR: lb/chash: use a read lock in chash_get_server_hash() 2020-10-17 20:15:49 +02:00
lb_fas.c MINOR: lb/first: use a read lock in fas_get_next_server() 2020-10-17 19:49:49 +02:00
lb_fwlc.c MEDIUM: fwlc: re-enable per-server queuing up to maxqueue 2020-10-22 18:30:25 +02:00
lb_fwrr.c MINOR: backend: replace the lbprm lock with an rwlock 2020-10-17 18:51:41 +02:00
lb_map.c MINOR: lb/map: use seek lock and read locks where appropriate 2020-10-17 19:04:27 +02:00
listener.c BUG/MEDIUM: listener: only enable a listening listener if needed 2020-11-04 14:22:42 +01:00
log.c BUG/MINOR: log: fix risk of null deref on error path 2020-10-27 10:35:32 +01:00
lru.c MINOR: lru: new function to delete <nb> least recently used keys 2016-01-11 07:31:35 +01:00
mailers.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
map.c MINOR: arg: Use chunk_destroy() to release string arguments 2020-08-07 14:27:54 +02:00
mqtt.c MINOR: sample: Add converts to parses MQTT messages 2020-11-05 19:27:03 +01:00
mux_fcgi.c MEDIUM: fcgi: remove conn from session on detach 2020-10-15 15:19:34 +02:00
mux_h1.c BUG/MEDIUM: mux-h1: Get the session from the H1S when capturing bad messages 2020-10-16 19:53:17 +02:00
mux_h2.c CLEANUP: mux-h2: Remove the h1 parser state from the h2 stream 2020-11-04 15:02:24 +01:00
mux_pt.c BUG/MEDIUM: mux-pt: Release the tasklet during an HTTP upgrade 2020-11-03 10:50:00 +01:00
mworker-prog.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
mworker.c MINOR: protocol: register the receiver's I/O handler and not the protocol's 2020-10-15 21:47:56 +02:00
namespace.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
pattern.c CLEANUP: pattern: fix spelling/grammatical/copy-paste in comments 2020-10-31 13:14:10 +01:00
payload.c MINOR: arg: Use chunk_destroy() to release string arguments 2020-08-07 14:27:54 +02:00
peers.c BUG/MINOR: peers: Possible unexpected peer seesion reset after collisions. 2020-10-16 17:45:58 +02:00
pipe.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
pool.c MINOR: pools: move the LRU cache heads to thread_info 2020-06-29 10:36:37 +02:00
proto_sockpair.c MEDIUM: listeners: make use of fd_want_recv_safe() to enable early receivers 2020-11-04 14:22:42 +01:00
proto_tcp.c MEDIUM: listeners: make use of fd_want_recv_safe() to enable early receivers 2020-11-04 14:22:42 +01:00
proto_udp.c MEDIUM: listeners: make use of fd_want_recv_safe() to enable early receivers 2020-11-04 14:22:42 +01:00
proto_uxst.c MEDIUM: listeners: make use of fd_want_recv_safe() to enable early receivers 2020-11-04 14:22:42 +01:00
protocol.c CLEANUP: protocol: remove the now unused <handler> field of proto_fam->bind() 2020-10-15 21:47:56 +02:00
proxy.c MINOR: proxy/cli: only take a read lock in "show errors" 2020-10-22 17:32:28 +02:00
queue.c BUG/MEDIUM: queue: fix unsafe proxy pointer when counting nbpend 2020-10-24 12:57:41 +02:00
raw_sock.c MINOR: raw_sock: Report the number of bytes emitted using the splicing 2020-07-15 14:08:14 +02:00
regex.c OPTIM: regex: PCRE2 use JIT match when JIT optimisation occured. 2020-08-14 07:53:40 +02:00
ring.c CLEANUP: fix all duplicated semicolons 2020-08-10 08:49:38 +02:00
sample.c MINOR: sample: Add converts to parses MQTT messages 2020-11-05 19:27:03 +01:00
server.c BUG/MEDIUM: server: make it possible to kill last idle connections 2020-11-05 09:12:20 +01:00
session.c MINOR: session: simplify error path in session_accept_fd() 2020-10-15 21:47:56 +02:00
sha1.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
shctx.c REORG: include: split global.h into haproxy/global{,-t}.h 2020-06-11 10:18:58 +02:00
signal.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
sink.c MINOR: connection: make sockaddr_alloc() take the address to be copied 2020-10-15 21:47:56 +02:00
sock.c MINOR: sock: add a check against cross worker<->master socket activities 2020-11-04 15:05:50 +01:00
sock_inet.c CLEANUP: protocol: remove the now unused <handler> field of proto_fam->bind() 2020-10-15 21:47:56 +02:00
sock_unix.c CLEANUP: protocol: remove the now unused <handler> field of proto_fam->bind() 2020-10-15 21:47:56 +02:00
ssl_ckch.c MEDIUM: ssl: ssl-load-extra-del-ext work only with .crt 2020-10-23 18:41:08 +02:00
ssl_crtlist.c CLEANUP: ssl: "bundle" is not an OpenSSL wording 2020-10-02 18:11:47 +02:00
ssl_sample.c BUILD: ssl: use HAVE_OPENSSL_KEYLOG instead of OpenSSL versions 2020-11-03 14:54:15 +01:00
ssl_sock.c BUILD: ssl: use feature macros for detecting ec curves manipulation support 2020-11-05 15:08:41 +01:00
ssl_utils.c CLEANUP: ssl: ssl_sock_crt2der semicolon and spaces 2020-08-07 15:38:40 +02:00
stats.c MINOR: stats: do not display empty stat module title on html 2020-11-03 17:04:22 +01:00
stick_table.c BUG/MEDIUM: stick-table: limit the time spent purging old entries 2020-11-03 18:02:42 +01:00
stream.c BUG/MEDIUM: lb: Always lock the server when calling server_{take,drop}_conn 2020-10-17 09:29:43 +02:00
stream_interface.c MINOR: stream-int: Be sure to have a mux to do sends and receives 2020-07-30 09:39:20 +02:00
task.c CLEANUP: task: remove the unused and mishandled global_rqueue_size 2020-10-19 14:08:13 +02:00
tcp_act.c REORG: tcp: move TCP actions from proto_tcp.c to tcp_act.c 2020-08-28 18:51:36 +02:00
tcp_rules.c MEDIUM: tcp-rules: Use a dedicated expiration date for tcp ruleset 2020-07-30 09:31:09 +02:00
tcp_sample.c MINOR: listener: prefer to retrieve the socket's settings via the receiver 2020-09-16 22:08:07 +02:00
tcpcheck.c MINOR: connection: make sockaddr_alloc() take the address to be copied 2020-10-15 21:47:56 +02:00
thread.c CLEANUP: threads: don't register an initcall when not debugging 2020-10-19 14:08:13 +02:00
time.c CLEANUP: assorted typo fixes in the code and comments 2020-07-06 14:34:32 +02:00
tools.c BUILD: tools: fix minor build issue on isspace() 2020-10-01 18:05:48 +02:00
trace.c MEDIUM: log/sink: re-work and merge of build message API. 2020-07-15 17:50:12 +02:00
uri_auth.c CLEANUP: Do not use a fixed type for 'sizeof' in 'calloc' 2020-09-12 20:31:25 +02:00
vars.c CLEANUP: Add static void vars_deinit() 2020-07-07 16:52:35 +02:00
version.c BUILD: Fix build by including haproxy/global.h 2020-06-16 23:36:04 +02:00
wdt.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
wurfl.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
xprt_handshake.c REORG: include: move stream_interface.h to haproxy/stream_interface{,-t}.h 2020-06-11 10:18:58 +02:00
xxhash.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00