aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-01-11 18:25:37 +0100
committerMax <msuraev@sysmocom.de>2018-01-17 09:42:40 +0000
commite661277b48e3f13c5f630bd31c4759e766c33a40 (patch)
treef346d5c363335b9f12657108f4331ddee0c766a4
parent6f539aa259585b23d3054b8e5fab8164f8aea6f6 (diff)
Add GTP message names
-rw-r--r--gtp/gtp.c45
-rw-r--r--gtp/gtp.h6
2 files changed, 51 insertions, 0 deletions
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 @@ const char *gtp_version()
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 */