| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * INET An implementation of the TCP/IP protocol suite for the LINUX |
|---|
| 3 | 4 | * operating system. INET is implemented using the BSD Socket |
|---|
| .. | .. |
|---|
| 8 | 9 | * Version: @(#)ip.h 1.0.2 04/28/93 |
|---|
| 9 | 10 | * |
|---|
| 10 | 11 | * Authors: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or |
|---|
| 13 | | - * modify it under the terms of the GNU General Public License |
|---|
| 14 | | - * as published by the Free Software Foundation; either version |
|---|
| 15 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 16 | 12 | */ |
|---|
| 17 | 13 | #ifndef _LINUX_IP_H |
|---|
| 18 | 14 | #define _LINUX_IP_H |
|---|
| .. | .. |
|---|
| 34 | 30 | { |
|---|
| 35 | 31 | return (struct iphdr *)skb_transport_header(skb); |
|---|
| 36 | 32 | } |
|---|
| 33 | + |
|---|
| 34 | +static inline unsigned int ip_transport_len(const struct sk_buff *skb) |
|---|
| 35 | +{ |
|---|
| 36 | + return ntohs(ip_hdr(skb)->tot_len) - skb_network_header_len(skb); |
|---|
| 37 | +} |
|---|
| 37 | 38 | #endif /* _LINUX_IP_H */ |
|---|