mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-upf.git
synced 2025-10-23 08:12:03 +00:00
Improve logging reading packets from gtp device
Change-Id: Ic3d9ea319122acbaf99ca7d6ff615b5812a085f8
This commit is contained in:
@@ -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 @@ int upf_gtpu_echo_req_tx(struct upf_gtp_dev *dev, const struct osmo_sockaddr *re
|
||||
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 @@ int upf_gtpu_echo_read_cb(struct osmo_fd *ofd, unsigned int what)
|
||||
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 @@ int upf_gtpu_echo_setup(struct upf_gtp_dev *dev)
|
||||
/* 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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user