From e011b04c6b2e31bdc46320e5d8a4f48715681f15 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 12 Jan 2022 02:58:02 +0100 Subject: libosmo-gtlv: add C code generator for IE structs and arrays Defining a protocol of message types with lists of IEs bears a lot of repetitive, copy-paste-error-prone writing out of data structures. Add a third layer to libosmo-gtlv, which allows helpful code generation. By non-repetitive data structures that briefly describe the protocol's messages and IEs, generate possibly repetitive IE list arrays and decoded-struct definitions automatically, avoiding grunt work errors. I tried C macros for this at first, but it became too convoluted. Generating C code that can be read and grepped makes things easier. A usage example is found in tests/libosmo-gtlv/test_gtlv_gen/. Related: SYS#5599 Change-Id: Ifb3ea54d2797ce060b95834aa117725ec2d6c4cf --- include/osmocom/gtlv/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'include/osmocom/gtlv/Makefile.am') diff --git a/include/osmocom/gtlv/Makefile.am b/include/osmocom/gtlv/Makefile.am index a7c10a6..fc0cff2 100644 --- a/include/osmocom/gtlv/Makefile.am +++ b/include/osmocom/gtlv/Makefile.am @@ -1,6 +1,7 @@ tlv_HEADERS = \ gtlv.h \ gtlv_dec_enc.h \ + gtlv_gen.h \ $(NULL) tlvdir = $(includedir)/osmocom/gtlv -- cgit v1.2.3