pespin submitted this change.
Improve logging reading packets from gtp device
Change-Id: Ic3d9ea319122acbaf99ca7d6ff615b5812a085f8
---
M src/osmo-upf/upf_gtpu_echo.c
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/src/osmo-upf/upf_gtpu_echo.c b/src/osmo-upf/upf_gtpu_echo.c
index f4bbb76..ae370e6 100644
--- a/src/osmo-upf/upf_gtpu_echo.c
+++ b/src/osmo-upf/upf_gtpu_echo.c
@@ -13,8 +13,12 @@
#define GTP1U_PORT 2152
enum gtp1u_msgt {
- GTP1U_MSGTYPE_ECHO_REQ = 1,
- GTP1U_MSGTYPE_ECHO_RSP = 2,
+ GTP1U_MSGTYPE_ECHO_REQ = 1,
+ GTP1U_MSGTYPE_ECHO_RSP = 2,
+ GTP1U_MSGTYPE_ERRR_IND = 26,
+ GTP1U_MSGTYPE_SUPP_EXT_HDR_NOTIF = 31,
+ GTP1U_MSGTYPE_END_MARKER = 254,
+ GTP1U_MSGTYPE_GPDU = 255,
};
enum gtp1u_iei {
@@ -159,7 +163,7 @@
return rc;
}
-int upf_gtpu_echo_read_cb(struct osmo_fd *ofd, unsigned int what)
+int upf_gtpu_read_cb(struct osmo_fd *ofd, unsigned int what)
{
struct upf_gtp_dev *dev = ofd->data;
@@ -208,8 +212,18 @@
case GTP1U_MSGTYPE_ECHO_RSP:
rx_echo_resp(dev, &remote, h, sz);
return 0;
+ case GTP1U_MSGTYPE_ERRR_IND:
+ /* 3GPP TS 29.281 7.3.1: Log "Tunnel Endpoint Identifier Data I" and "GTP-U Peer Address" */
+ LOG_GTP_DEV(dev, LOGL_NOTICE, "%s rx: GTPv1-U Error Indication not supported\n",
+ osmo_sockaddr_to_str(&remote));
+ return 0;
+ case GTP1U_MSGTYPE_GPDU:
+ LOG_GTP_DEV(dev, LOGL_NOTICE, "%s rx: GTPv1-U PDU TEID=0x%08x over slow path not supported\n",
+ osmo_sockaddr_to_str(&remote), osmo_load32be(&h->tei));
+ return 0;
default:
- LOG_GTP_DEV(dev, LOGL_ERROR, "rx: GTPv1-U message type %u not supported\n", h->msg_type);
+ LOG_GTP_DEV(dev, LOGL_ERROR, "%s rx: GTPv1-U message type %u not supported\n",
+ osmo_sockaddr_to_str(&remote), h->msg_type);
return -1;
}
}
@@ -226,7 +240,7 @@
/* make sure there is no cb yet that this would be replacing. */
OSMO_ASSERT(dev->gtpv1.ofd.cb == NULL);
- dev->gtpv1.ofd.cb = upf_gtpu_echo_read_cb;
+ dev->gtpv1.ofd.cb = upf_gtpu_read_cb;
dev->gtpv1.ofd.data = dev;
return 0;
}
To view, visit change 39419. To unsubscribe, or for help writing mail filters, visit settings.