osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/libgtpnl/+/35989?usp=email )
Change subject: gtp-genl: display gtp device in listing
......................................................................
gtp-genl: display gtp device in listing
Display the device that the tunnel belongs to, users need this
information to delete tunnels.
Change-Id: I888723a8318c04772f7d22a042e69fa6e9ef2239
---
M src/gtp-genl.c
1 file changed, 18 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libgtpnl refs/changes/89/35989/1
diff --git a/src/gtp-genl.c b/src/gtp-genl.c
index 3b7c3ef..33a78d8 100644
--- a/src/gtp-genl.c
+++ b/src/gtp-genl.c
@@ -141,6 +141,7 @@
EXPORT_SYMBOL(gtp_del_tunnel);
struct gtp_pdp {
+ uint32_t ifidx;
uint32_t version;
union {
struct {
@@ -181,6 +182,7 @@
case GTPA_PEER_ADDRESS:
case GTPA_MS_ADDRESS:
case GTPA_VERSION:
+ case GTPA_LINK:
if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0) {
perror("mnl_attr_validate");
return MNL_CB_ERROR;
@@ -210,6 +212,8 @@
mnl_attr_parse(nlh, sizeof(*genl), genl_gtp_validate_cb, tb);
+ if (tb[GTPA_LINK])
+ pdp.ifidx = mnl_attr_get_u32(tb[GTPA_LINK]);
if (tb[GTPA_TID])
pdp.u.v0.tid = mnl_attr_get_u64(tb[GTPA_TID]);
if (tb[GTPA_I_TEI])
@@ -245,6 +249,8 @@
return MNL_CB_ERROR;
}
+ printf("%s ", if_indextoname(pdp.ifidx, buf));
+
if (tb[GTPA_VERSION])
pdp.version = mnl_attr_get_u32(tb[GTPA_VERSION]);
--
To view, visit
https://gerrit.osmocom.org/c/libgtpnl/+/35989?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libgtpnl
Gerrit-Branch: master
Gerrit-Change-Id: I888723a8318c04772f7d22a042e69fa6e9ef2239
Gerrit-Change-Number: 35989
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange