]> git.ipfire.org Git - thirdparty/util-linux.git/commit
logger: Add support to logger for RFC6587 octet counting
authorAlex Bligh <alex@alex.org.uk>
Wed, 15 Jul 2015 18:01:48 +0000 (19:01 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 29 Jul 2015 08:33:25 +0000 (10:33 +0200)
commitb6b67955ef31ff4f26a05c2de8bf1679a20d64ba
tree4878e8bd86aefc21fda93ce45207f7e96eae1851
parent8abdb91211895355b4f8ae9422f03927cacf5ef9
logger: Add support to logger for RFC6587 octet counting

This patch adds support to logger for RFC6587 octet counting.
RFC6587 provides support for two sorts of framing:

1. Octet counting (at RFC6587 s3.4.1)

   In essence each frame is preceded by a decimal length and a
   space.

2. Non-transparent framing (at RFC6587 s3.4.2), also called
   'octet stuffing'

   In essence each frame is terminated by a `\n`

Prior to this patch, logger used option 2 (non-transparent framing)
on TCP, and used no framing on UDP. After this patch, the default
behaviour is unchanged, but if the '--octet-count' option is supplied,
option 1 is used for both TCP and UDP. Arguably octet count framing
makes little sense on UDP, but some servers provide it and this
allows testing of those servers.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
misc-utils/logger.1
misc-utils/logger.c