From: Wojciech Drewek Date: Fri, 4 Mar 2022 16:40:46 +0000 (+0100) Subject: gtp: Add support for checking GTP device type X-Git-Tag: v5.18-rc1~136^2~98^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81dd9849fa4911f76a14f354a048865894b9751e;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Harald Welte Signed-off-by: Tony Nguyen --- diff --git a/include/net/gtp.h b/include/net/gtp.h index 23c2aaae8a422..c1d6169df331e 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