[PATCH] osmo-ggsn[master]: Add GTP message names

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Tue Jan 16 15:38:39 UTC 2018


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/5758

to look at the new patch set (#2).

Add GTP message names

Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e
---
M gtp/gtp.c
M gtp/gtp.h
2 files changed, 51 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/58/5758/2

diff --git a/gtp/gtp.c b/gtp/gtp.c
index b36e0c6..0d6d896 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -86,6 +86,51 @@
 	return VERSION;
 }
 
+const struct value_string gtp_type_names[] = {
+	{ GTP_ECHO_REQ,        "Echo Request" },
+	{ GTP_ECHO_RSP,        "Echo Response" },
+	{ GTP_NOT_SUPPORTED,   "Version Not Supported" },
+	{ GTP_ALIVE_REQ,       "Node Alive Request" },
+	{ GTP_ALIVE_RSP,       "Node Alive Response" },
+	{ GTP_REDIR_REQ,       "Redirection Request" },
+	{ GTP_REDIR_RSP,       "Redirection Response" },
+	{ GTP_CREATE_PDP_REQ,  "Create PDP Context Request" },
+	{ GTP_CREATE_PDP_RSP,  "Create PDP Context Response" },
+	{ GTP_UPDATE_PDP_REQ,  "Update PDP Context Request" },
+	{ GTP_UPDATE_PDP_RSP,  "Update PDP Context Response" },
+	{ GTP_DELETE_PDP_REQ,  "Delete PDP Context Request" },
+	{ GTP_DELETE_PDP_RSP,  "Delete PDP Context Response" },
+	{ GTP_ERROR,           "Error Indication" },
+	{ GTP_PDU_NOT_REQ,     "PDU Notification Request" },
+	{ GTP_PDU_NOT_RSP,     "PDU Notification Response" },
+	{ GTP_PDU_NOT_REJ_REQ, "PDU Notification Reject Request" },
+	{ GTP_PDU_NOT_REJ_RSP, "PDU Notification Reject Response" },
+	{ GTP_SUPP_EXT_HEADER, "Supported Extension Headers Notification" },
+	{ GTP_SND_ROUTE_REQ,   "Send Routeing Information for GPRS Request" },
+	{ GTP_SND_ROUTE_RSP,   "Send Routeing Information for GPRS Response" },
+	{ GTP_FAILURE_REQ,     "Failure Report Request" },
+	{ GTP_FAILURE_RSP,     "Failure Report Response" },
+	{ GTP_MS_PRESENT_REQ,  "Note MS GPRS Present Request" },
+	{ GTP_MS_PRESENT_RSP,  "Note MS GPRS Present Response" },
+	{ GTP_IDEN_REQ,        "Identification Request" },
+	{ GTP_IDEN_RSP,        "Identification Response" },
+	{ GTP_SGSN_CONTEXT_REQ,"SGSN Context Request" },
+	{ GTP_SGSN_CONTEXT_RSP,"SGSN Context Response" },
+	{ GTP_SGSN_CONTEXT_ACK,"SGSN Context Acknowledge" },
+	{ GTP_FWD_RELOC_REQ,   "Forward Relocation Request" },
+	{ GTP_FWD_RELOC_RSP,   "Forward Relocation Response" },
+	{ GTP_FWD_RELOC_COMPL, "Forward Relocation Complete" },
+	{ GTP_RELOC_CANCEL_REQ,"Relocation Cancel Request" },
+	{ GTP_RELOC_CANCEL_RSP,"Relocation Cancel Response" },
+	{ GTP_FWD_SRNS,        "Forward SRNS Context" },
+	{ GTP_FWD_RELOC_ACK,   "Forward Relocation Complete Acknowledge" },
+	{ GTP_FWD_SRNS_ACK,    "Forward SRNS Context Acknowledge" },
+	{ GTP_DATA_TRAN_REQ,   "Data Record Transfer Request" },
+	{ GTP_DATA_TRAN_RSP,   "Data Record Transfer Response" },
+	{ GTP_GPDU,            "G-PDU" },
+	{ 0, NULL }
+};
+
 /* gtp_new */
 /* gtp_free */
 
diff --git a/gtp/gtp.h b/gtp/gtp.h
index d189ded..8f8e293 100644
--- a/gtp/gtp.h
+++ b/gtp/gtp.h
@@ -12,6 +12,8 @@
 #ifndef _GTP_H
 #define _GTP_H
 
+#include <osmocom/core/utils.h>
+
 #define GTP_MODE_GGSN 1
 #define GTP_MODE_SGSN 2
 
@@ -85,6 +87,10 @@
 /* 242-254 For future use. */
 #define GTP_GPDU            255	/* G-PDU */
 
+extern const struct value_string gtp_type_names[];
+static inline const char *gtp_type_name(uint8_t val)
+{ return get_value_string(gtp_type_names, val); }
+
 /* GTP information element cause codes from 29.060 v3.9.0 7.7 */
 /*                                                            */
 #define GTPCAUSE_REQ_IMSI                   0	/* Request IMSI */

-- 
To view, visit https://gerrit.osmocom.org/5758
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list