summaryrefslogtreecommitdiff
path: root/include/net/gtp.h
diff options
context:
space:
mode:
authorWojciech Drewek <wojciech.drewek@intel.com>2022-03-04 17:40:46 +0100
committerTony Nguyen <anthony.l.nguyen@intel.com>2022-03-11 08:28:27 -0800
commit81dd9849fa4911f76a14f354a048865894b9751e (patch)
tree095f351e1df4f440e0d9d40cbdae56089d97a949 /include/net/gtp.h
parente3acda7ade0a36c5cbebc2b54d30b7f08a4ba29b (diff)
downloadlwn-81dd9849fa4911f76a14f354a048865894b9751e.tar.gz
lwn-81dd9849fa4911f76a14f354a048865894b9751e.zip
gtp: Add support for checking GTP device type
Add a function that checks if a net device type is GTP. Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> Reviewed-by: Harald Welte <laforge@gnumonks.org> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'include/net/gtp.h')
-rw-r--r--include/net/gtp.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/gtp.h b/include/net/gtp.h
index 23c2aaae8a42..c1d6169df331 100644
--- a/include/net/gtp.h
+++ b/include/net/gtp.h
@@ -63,6 +63,12 @@ struct gtp_pdu_session_info { /* According to 3GPP TS 38.415. */
u8 qfi;
};
+static inline bool netif_is_gtp(const struct net_device *dev)
+{
+ return dev->rtnl_link_ops &&
+ !strcmp(dev->rtnl_link_ops->kind, "gtp");
+}
+
#define GTP1_F_NPDU 0x01
#define GTP1_F_SEQ 0x02
#define GTP1_F_EXTHDR 0x04