Skip to content

Commit

Permalink
gtp: Add support for checking GTP device type
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wojciech Drewek authored and Tony Nguyen committed Mar 11, 2022
1 parent e3acda7 commit 81dd984
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/net/gtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81dd984

Please sign in to comment.