fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/29480 )
Change subject: llc: add value-string for enum osmo_gprs_llc_xid_type
......................................................................
llc: add value-string for enum osmo_gprs_llc_xid_type
Change-Id: I90b6a1aa4e13984f4c43245df1308d0c3f82636f
---
M include/osmocom/gprs/llc/llc.h
M src/llc/Makefile.am
A src/llc/llc_xid.c
3 files changed, 50 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/80/29480/1
diff --git a/include/osmocom/gprs/llc/llc.h b/include/osmocom/gprs/llc/llc.h
index 7a4ac03..7c4ea45 100644
--- a/include/osmocom/gprs/llc/llc.h
+++ b/include/osmocom/gprs/llc/llc.h
@@ -85,6 +85,13 @@
OSMO_GPRS_LLC_XID_T_RESET = 12,
};
+extern const struct value_string osmo_gprs_llc_xid_type_names[];
+
+static inline const char *osmo_gprs_llc_xid_type_name(enum osmo_gprs_llc_xid_type val)
+{
+ return get_value_string(osmo_gprs_llc_xid_type_names, val);
+}
+
/* Section 4.5.2 Logical Link States + Annex C.2 */
enum osmo_gprs_llc_lle_state {
OSMO_GPRS_LLC_LLES_UNASSIGNED = 1, /* No TLLI yet */
diff --git a/src/llc/Makefile.am b/src/llc/Makefile.am
index a301a89..6c0e680 100644
--- a/src/llc/Makefile.am
+++ b/src/llc/Makefile.am
@@ -24,6 +24,7 @@
libosmo_gprs_llc_la_SOURCES = \
crc24.c \
llc_pdu.c \
+ llc_xid.c \
misc.c \
$(NULL)
diff --git a/src/llc/llc_xid.c b/src/llc/llc_xid.c
new file mode 100644
index 0000000..1705e5d
--- /dev/null
+++ b/src/llc/llc_xid.c
@@ -0,0 +1,42 @@
+/* GPRS LLC protocol implementation as per 3GPP TS 44.064 */
+
+/* (C) 2009-2010 by Harald Welte <laforge(a)gnumonks.org>
+ * (C) 2022 by Sysmocom s.f.m.c. GmbH
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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/>.
+ *
+ */
+
+#include <osmocom/core/utils.h>
+
+#include <osmocom/gprs/llc/llc.h>
+
+const struct value_string osmo_gprs_llc_xid_type_names[] = {
+ { OSMO_GPRS_LLC_XID_T_VERSION, "LLC-Version" },
+ { OSMO_GPRS_LLC_XID_T_IOV_UI, "IOV-UI" },
+ { OSMO_GPRS_LLC_XID_T_IOV_I, "IOV-I" },
+ { OSMO_GPRS_LLC_XID_T_T200, "T200" },
+ { OSMO_GPRS_LLC_XID_T_N200, "N200" },
+ { OSMO_GPRS_LLC_XID_T_N201_U, "N201-U" },
+ { OSMO_GPRS_LLC_XID_T_N201_I, "N201-I" },
+ { OSMO_GPRS_LLC_XID_T_mD, "mD" },
+ { OSMO_GPRS_LLC_XID_T_mU, "mU" },
+ { OSMO_GPRS_LLC_XID_T_kD, "kD" },
+ { OSMO_GPRS_LLC_XID_T_kU, "kU" },
+ { OSMO_GPRS_LLC_XID_T_L3_PAR, "L3-Params" },
+ { OSMO_GPRS_LLC_XID_T_RESET, "Reset" },
+ { 0, NULL }
+};
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/29480
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I90b6a1aa4e13984f4c43245df1308d0c3f82636f
Gerrit-Change-Number: 29480
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin, dexter.
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/29361 )
Change subject: pcu_sock: check size of primitive
......................................................................
Patch Set 2:
(4 comments)
File include/osmocom/bsc/pcu_if.h:
Robot Comment from checkpatch (run ID jenkins-gerrit-osmo-bsc-lint-905):
https://gerrit.osmocom.org/c/osmo-bsc/+/29361/comment/dd66f43b_0c3d8c58
PS2, Line 8: #define PCUIF_HDR_SIZE ( sizeof(struct gsm_pcu_if) - sizeof(((struct gsm_pcu_if *)0)->u) )
space prohibited after that open parenthesis '('
Robot Comment from checkpatch (run ID jenkins-gerrit-osmo-bsc-lint-905):
https://gerrit.osmocom.org/c/osmo-bsc/+/29361/comment/583033d3_c0498f1f
PS2, Line 8: #define PCUIF_HDR_SIZE ( sizeof(struct gsm_pcu_if) - sizeof(((struct gsm_pcu_if *)0)->u) )
space prohibited before that close parenthesis ')'
File src/osmo-bsc/pcu_sock.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-osmo-bsc-lint-905):
https://gerrit.osmocom.org/c/osmo-bsc/+/29361/comment/8666ecb5_4dafd5ed
PS2, Line 451: #define CHECK_IF_MSG_SIZE(prim_len, prim_msg) \
do {} while (0) macros should not be semicolon terminated
Robot Comment from checkpatch (run ID jenkins-gerrit-osmo-bsc-lint-905):
https://gerrit.osmocom.org/c/osmo-bsc/+/29361/comment/5e7c14f0_983bc394
PS2, Line 459: } while(0);
space required before the open parenthesis '('
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/29361
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I247c6f4b5a7a22d17a060a558c4ceb9221ca7351
Gerrit-Change-Number: 29361
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 26 Sep 2022 09:39:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment