How erezgeva/libptpmgmt works
Project type and purpose
• This is a mono-repo for libptpmgmt:
• A core C++ library implementing IEEE-1588 PTP management messaging
• A thin C wrapper exposing a C API
• SWIG-based language bindings (Go, Python, Perl, Ruby, PHP, Lua, Tcl)
• Two CLI tools (pmc, phc_ctl) built on the library
• A ‘Clock Manager’ framework (clkmgr) that uses the library to monitor and configure local PTP clocks
• Sample applications, unit tests, system tests, packaging recipes and CI pipelines
File structure
• Top-level directories
• src/ — C++ implementation of messages, serialization, sockets, TLVs, utilities
• pub/ — C wrapper headers & wrapper glue for C API
• swig/ — SWIG interface files for Go
• wrappers/ — language-specific SWIG wrappers and test code
• clkmgr/ — Clock Manager code (client state, proxy, configuration)
• ptp-tools/ — pmc & phc_ctl CLI tool impls
• sample/, hmac/, uctest/, utest/ — sample apps and C/C++ unit tests
• tools/ — CI scripts, packaging helpers, code-style, release automation
• packaging dirs (debian/, rpm/, archlinux/, gentoo/)
• Build and config files (Makefile, configure.ac, .gitlab/ and .github/ workflows)
README for additional insights
• Core lib namespace: ptpmgmt (C wrapper prefixes: ptpmgmt_)
• Implements get/set/command of all management TLVs via UDP-IPv4/IPv6, Ethernet or Unix socket to ptp4l
• Library is data-oriented: structures + message builders/parsers
• SWIG wrappers generate idiomatic bindings per language
• Clock Manager uses the library to collect telemetry and expose an API to local apps
• pmc, phc_ctl are reference tools built on the library