Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/27217 )
Change subject: libosmo-tlv: add versatile TLV de- and encoder
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS2:
> what's the alternative you have in mind?
What we already discussed, and which I think you don't like. Something similar to existing osmocom TLV encdec in libosmocore and the one in open5gs, where a set of structs define the scope of each IE.
This way protocols are specified in a declarative way rather than imperative/programatic way.
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27217
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ib0fd00d9f288ffe13b7e67701f3e47073587404a
Gerrit-Change-Number: 27217
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 17 Mar 2022 17:21:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/27218
to look at the new patch set (#6).
Change subject: libosmo-tlv: add auto dec/enc to/from structs
......................................................................
libosmo-tlv: add auto dec/enc to/from structs
Add osmo_tlv_coding: describe the value part of a TLV (decode and
encode), describe a struct with its members, and get/put readily decoded
structs from/to a raw PDU, directly.
With osmo_tlv_coding defined for a protocol's tags, we only deal with
encoded PDUs or fully decoded C structs, no TLV related
re-implementations clutter up the message handling code.
A usage example is given in tlv_dec_enc_test. The first real use will be
the PFCP protocol in osmo-upf.git.
With osmo_tlv_coding, there still is a lot of monkey work involved in
describing the decoded structs. A subsequent patch adds a generator for
osmo_tlv_coding and message structs from tag value lists.
Related: SYS#5599
Change-Id: I65de793105882a452124ee58adb0e58469e6e796
---
M include/osmocom/tlv/Makefile.am
A include/osmocom/tlv/tlv_dec_enc.h
M src/libosmo-tlv/Makefile.am
A src/libosmo-tlv/tlv_dec_enc.c
M tests/libosmo-tlv/Makefile.am
A tests/libosmo-tlv/tlv_dec_enc_test.c
A tests/libosmo-tlv/tlv_dec_enc_test.ok
M tests/testsuite.at
8 files changed, 1,288 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/18/27218/6
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27218
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I65de793105882a452124ee58adb0e58469e6e796
Gerrit-Change-Number: 27218
Gerrit-PatchSet: 6
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/27217 )
Change subject: libosmo-tlv: add versatile TLV de- and encoder
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS2:
> As I stated previously here and privately in previous versions, I'm not really liking the approach o […]
what's the alternative you have in mind?
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27217
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ib0fd00d9f288ffe13b7e67701f3e47073587404a
Gerrit-Change-Number: 27217
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 17 Mar 2022 17:15:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-upf/+/27530 )
Change subject: tweak license headers
......................................................................
tweak license headers
I wrote a simple tool that puts the same license headers in all .[hc]
files. These tweaks are the result of running that tool on already
merged files.
Related: SYS#5599
Change-Id: I1f542534903fce9d68fce11f16822e9fbead89ec
---
M include/osmocom/upf/upf.h
M src/osmo-upf/osmo_upf_main.c
M src/osmo-upf/upf.c
3 files changed, 56 insertions(+), 25 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/30/27530/1
diff --git a/include/osmocom/upf/upf.h b/include/osmocom/upf/upf.h
index 503c5a4..c3c7849 100644
--- a/include/osmocom/upf/upf.h
+++ b/include/osmocom/upf/upf.h
@@ -1,4 +1,27 @@
/* Global definitions for OsmoUPF */
+/*
+ * (C) 2021-2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * All Rights Reserved.
+ *
+ * Author: Neels Janosch Hofmeyr <nhofmeyr(a)sysmocom.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
#pragma once
struct ctrl_handle;
diff --git a/src/osmo-upf/osmo_upf_main.c b/src/osmo-upf/osmo_upf_main.c
index ddd1b44..f81eab1 100644
--- a/src/osmo-upf/osmo_upf_main.c
+++ b/src/osmo-upf/osmo_upf_main.c
@@ -1,20 +1,23 @@
-/* (C) 2021-2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
- * All Rights Reserved
+/*
+ * (C) 2021-2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * All Rights Reserved.
*
- * Author: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
+ * Author: Neels Janosch Hofmeyr <nhofmeyr(a)sysmocom.de>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * SPDX-License-Identifier: GPL-2.0+
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/lienses/>.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
diff --git a/src/osmo-upf/upf.c b/src/osmo-upf/upf.c
index 8932d92..6463e32 100644
--- a/src/osmo-upf/upf.c
+++ b/src/osmo-upf/upf.c
@@ -1,18 +1,23 @@
-/* (C) 2021-2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
- * All Rights Reserved
+/*
+ * (C) 2021-2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * All Rights Reserved.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * Author: Neels Janosch Hofmeyr <nhofmeyr(a)sysmocom.de>
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * SPDX-License-Identifier: GPL-2.0+
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27530
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I1f542534903fce9d68fce11f16822e9fbead89ec
Gerrit-Change-Number: 27530
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/27218
to look at the new patch set (#5).
Change subject: libosmo-tlv: add auto dec/enc to/from structs
......................................................................
libosmo-tlv: add auto dec/enc to/from structs
Add osmo_tlv_coding: describe the value part of a TLV (decode and
encode), describe a struct with its members, and get/put readily decoded
structs from/to a raw PDU, directly.
With osmo_tlv_coding defined for a protocol's tags, we only deal with
encoded PDUs or fully decoded C structs, no TLV related
re-implementations clutter up the message handling code.
A usage example is given in tlv_dec_enc_test. The first real use will be
the PFCP protocol in osmo-upf.git.
With osmo_tlv_coding, there still is a lot of monkey work involved in
describing the decoded structs. A subsequent patch adds a generator for
osmo_tlv_coding and message structs from tag value lists.
Related: SYS#5599
Change-Id: I65de793105882a452124ee58adb0e58469e6e796
---
M include/osmocom/tlv/Makefile.am
A include/osmocom/tlv/tlv_dec_enc.h
M src/libosmo-tlv/Makefile.am
A src/libosmo-tlv/tlv_dec_enc.c
M tests/libosmo-tlv/Makefile.am
A tests/libosmo-tlv/tlv_dec_enc_test.c
A tests/libosmo-tlv/tlv_dec_enc_test.ok
M tests/testsuite.at
8 files changed, 1,288 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/18/27218/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27218
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I65de793105882a452124ee58adb0e58469e6e796
Gerrit-Change-Number: 27218
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/27219
to look at the new patch set (#4).
Change subject: libosmo-tlv: add C code generator for IE structs and arrays
......................................................................
libosmo-tlv: 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-tlv, 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-tlv/test_tlv_gen/.
Related: SYS#5599
Change-Id: Ifb3ea54d2797ce060b95834aa117725ec2d6c4cf
---
M configure.ac
M include/osmocom/tlv/Makefile.am
A include/osmocom/tlv/tlv_gen.h
M src/libosmo-tlv/Makefile.am
A src/libosmo-tlv/tlv_gen.c
M tests/libosmo-tlv/Makefile.am
A tests/libosmo-tlv/test_tlv_gen/Makefile.am
A tests/libosmo-tlv/test_tlv_gen/gen__myproto_ies_auto.c
A tests/libosmo-tlv/test_tlv_gen/myproto_ies_custom.c
A tests/libosmo-tlv/test_tlv_gen/myproto_ies_custom.h
A tests/libosmo-tlv/test_tlv_gen/tlv_gen_test.c
A tests/libosmo-tlv/test_tlv_gen/tlv_gen_test.ok
M tests/testsuite.at
13 files changed, 1,442 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/19/27219/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27219
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ifb3ea54d2797ce060b95834aa117725ec2d6c4cf
Gerrit-Change-Number: 27219
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/27217
to look at the new patch set (#3).
Change subject: libosmo-tlv: add versatile TLV de- and encoder
......................................................................
libosmo-tlv: add versatile TLV de- and encoder
An all new TLV parser supporting:
- Any size of T and L (determined by callback function),
- "Grouped IEs", so that an IE payload is a nested IE structure,
- optional/mandatory/multi-occurence IEs.
Will be used for PFCP message decoding and encoding, a T16L16V protocol
which requires above features.
Previously, the way we deal with TLVs causes a lot of code
re-implementation. The TL decoding is taken care of by the API, but for
encoding, we essentially re-implement the TL encoding for each protocol
and each encoded message. This API is an improvement in that we only
once implement the TL coding (or just use osmo_t8l8v_cfg /
osmo_t16l16v_cfg), get symmetric de- and encoding of the TL, and only
need to deal with the value part of each IE.
The common pattern of
- store TL preliminarily,
- write V data and
- update L after V is complete
is conveniently done by osmo_tlv_put_update_tl().
Related: SYS#5599
Change-Id: Ib0fd00d9f288ffe13b7e67701f3e47073587404a
---
M configure.ac
M include/osmocom/Makefile.am
A include/osmocom/tlv/Makefile.am
A include/osmocom/tlv/tlv.h
M src/Makefile.am
A src/libosmo-tlv/Makefile.am
A src/libosmo-tlv/tlv.c
M tests/Makefile.am
A tests/libosmo-tlv/Makefile.am
A tests/libosmo-tlv/tlv_test.c
A tests/libosmo-tlv/tlv_test.ok
M tests/testsuite.at
12 files changed, 1,258 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/17/27217/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27217
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ib0fd00d9f288ffe13b7e67701f3e47073587404a
Gerrit-Change-Number: 27217
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/27529
to look at the new patch set (#3).
Change subject: libosmo-tlv: add TLIV capability
......................................................................
libosmo-tlv: add TLIV capability
During code review, it was indicated that some TLV protocols that we
will likely deal with in the near future also employ an I, and instance
value of a tag. Add TLIV support.
A usage example for a manually implemented TLIV structure is found in
tests/libosmo-tlv/tlv_test.c.
A usage example for a generated TLIV protocol is found in
tests/libosmo-tlv/test_tliv/.
Related: SYS#5599
Change-Id: I0a076e54dfba6038cc779cb7c8f3967d212226aa
---
M configure.ac
M include/osmocom/tlv/tlv.h
M include/osmocom/tlv/tlv_dec_enc.h
M include/osmocom/tlv/tlv_gen.h
M src/libosmo-tlv/tlv.c
M src/libosmo-tlv/tlv_dec_enc.c
M src/libosmo-tlv/tlv_gen.c
M tests/libosmo-tlv/Makefile.am
A tests/libosmo-tlv/test_tliv/Makefile.am
A tests/libosmo-tlv/test_tliv/gen__myproto_ies_auto.c
A tests/libosmo-tlv/test_tliv/myproto_ies_custom.c
A tests/libosmo-tlv/test_tliv/myproto_ies_custom.h
A tests/libosmo-tlv/test_tliv/tliv_test.c
A tests/libosmo-tlv/test_tliv/tliv_test.ok
M tests/libosmo-tlv/tlv_dec_enc_test.c
M tests/libosmo-tlv/tlv_test.c
M tests/libosmo-tlv/tlv_test.ok
M tests/testsuite.at
18 files changed, 941 insertions(+), 175 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/29/27529/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27529
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I0a076e54dfba6038cc779cb7c8f3967d212226aa
Gerrit-Change-Number: 27529
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset