xref: /linux/include/linux/ip.h (revision 6a674e9c75b17e7a88ff15b3c2e269eed54f7cfb)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  * INET		An implementation of the TCP/IP protocol suite for the LINUX
31da177e4SLinus Torvalds  *		operating system.  INET is implemented using the  BSD Socket
41da177e4SLinus Torvalds  *		interface as the means of communication with the user level.
51da177e4SLinus Torvalds  *
61da177e4SLinus Torvalds  *		Definitions for the IP protocol.
71da177e4SLinus Torvalds  *
81da177e4SLinus Torvalds  * Version:	@(#)ip.h	1.0.2	04/28/93
91da177e4SLinus Torvalds  *
101da177e4SLinus Torvalds  * Authors:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
111da177e4SLinus Torvalds  *
121da177e4SLinus Torvalds  *		This program is free software; you can redistribute it and/or
131da177e4SLinus Torvalds  *		modify it under the terms of the GNU General Public License
141da177e4SLinus Torvalds  *		as published by the Free Software Foundation; either version
151da177e4SLinus Torvalds  *		2 of the License, or (at your option) any later version.
161da177e4SLinus Torvalds  */
171da177e4SLinus Torvalds #ifndef _LINUX_IP_H
181da177e4SLinus Torvalds #define _LINUX_IP_H
191da177e4SLinus Torvalds 
20eddc9ec5SArnaldo Carvalho de Melo #include <linux/skbuff.h>
21607ca46eSDavid Howells #include <uapi/linux/ip.h>
22eddc9ec5SArnaldo Carvalho de Melo 
23eddc9ec5SArnaldo Carvalho de Melo static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
24eddc9ec5SArnaldo Carvalho de Melo {
25eddc9ec5SArnaldo Carvalho de Melo 	return (struct iphdr *)skb_network_header(skb);
26eddc9ec5SArnaldo Carvalho de Melo }
27b0061ce4SArnaldo Carvalho de Melo 
28*6a674e9cSJoseph Gasparakis static inline struct iphdr *inner_ip_hdr(const struct sk_buff *skb)
29*6a674e9cSJoseph Gasparakis {
30*6a674e9cSJoseph Gasparakis 	return (struct iphdr *)skb_inner_network_header(skb);
31*6a674e9cSJoseph Gasparakis }
32*6a674e9cSJoseph Gasparakis 
33b0061ce4SArnaldo Carvalho de Melo static inline struct iphdr *ipip_hdr(const struct sk_buff *skb)
34b0061ce4SArnaldo Carvalho de Melo {
359c70220bSArnaldo Carvalho de Melo 	return (struct iphdr *)skb_transport_header(skb);
36b0061ce4SArnaldo Carvalho de Melo }
371da177e4SLinus Torvalds #endif	/* _LINUX_IP_H */
38