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