Discussion:
[Linuxptp-devel] [PATCH 0/3] Store and config clock description
Geoff Salmon
2013-01-30 14:33:45 UTC
Permalink
This patch set adds a clock_description struct to the clock which
holds some of the data needed for the CLOCK_DESCRIPTION management
message. There's also a patch for configuring the description.

You'll see the first patch adds a StaticPTPText struct that includes
storage space for the string. This avoids any dynamic memory
allocation and simplifies setting the string value. There will only
ever be a handful of StaticPTPStructs, so the wasted memory won't
exceed a couple kilobytes.

StaticPTPText's can also enforce symbol length restrictions and I've
added strlen_utf8 in util.c to determine the symbol length of utf8
strings. However, it won't detect invalid utf8 or account for
combining characters. Dealing with how to count combining characters
is a rabbit hole we probably don't want to go down, but detecting
invalid utf8 data may be a good idea in the future, especially when
the user description can be set remotely using a management message.

Geoff Salmon (3):
adds StaticPTPText and functions for setting PTPText and
StaticPTPText
adds clock description
config clock description

clock.c | 9 ++++++++-
clock.h | 9 ++++++++-
config.c | 36 ++++++++++++++++++++++++++++++++++++
config.h | 2 ++
ddt.h | 16 ++++++++++++++++
ds.h | 8 ++++++++
ptp4l.c | 9 ++++++++-
util.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
util.h | 38 ++++++++++++++++++++++++++++++++++++++
9 files changed, 182 insertions(+), 3 deletions(-)
--
1.7.9.5
Loading...