ip.h (888dc273ea4e7ca332a6f73d10dfc8f2b212c803) ip.h (b7034146756b9e91cc059b19df7fe4defd4d7de7)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * Definitions for the IP module.
8 *
9 * Version: @(#)ip.h 1.0.2 05/07/93
10 *
11 * Authors: Ross Biro
12 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
13 * Alan Cox, <gw4pts@gw4pts.ampr.org>
14 *
15 * Changes:
16 * Mike McLagan : Routing by source
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the IP module.
7 *
8 * Version: @(#)ip.h 1.0.2 05/07/93
9 *
10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Alan Cox, <gw4pts@gw4pts.ampr.org>
13 *
14 * Changes:
15 * Mike McLagan : Routing by source
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
17 */
18#ifndef _IP_H
19#define _IP_H
20
21#include <linux/types.h>
22#include <linux/ip.h>
23#include <linux/in.h>
24#include <linux/skbuff.h>

--- 131 unchanged lines hidden (view full) ---

156 struct net_device *orig_dev);
157int ip_local_deliver(struct sk_buff *skb);
158void ip_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int proto);
159int ip_mr_input(struct sk_buff *skb);
160int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb);
161int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb);
162int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
163 int (*output)(struct net *, struct sock *, struct sk_buff *));
21 */
22#ifndef _IP_H
23#define _IP_H
24
25#include <linux/types.h>
26#include <linux/ip.h>
27#include <linux/in.h>
28#include <linux/skbuff.h>

--- 131 unchanged lines hidden (view full) ---

160 struct net_device *orig_dev);
161int ip_local_deliver(struct sk_buff *skb);
162void ip_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int proto);
163int ip_mr_input(struct sk_buff *skb);
164int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb);
165int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb);
166int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
167 int (*output)(struct net *, struct sock *, struct sk_buff *));
168
169struct ip_fraglist_iter {
170 struct sk_buff *frag;
171 struct iphdr *iph;
172 int offset;
173 unsigned int hlen;
174};
175
176void ip_fraglist_init(struct sk_buff *skb, struct iphdr *iph,
177 unsigned int hlen, struct ip_fraglist_iter *iter);
178void ip_fraglist_prepare(struct sk_buff *skb, struct ip_fraglist_iter *iter);
179
180static inline struct sk_buff *ip_fraglist_next(struct ip_fraglist_iter *iter)
181{
182 struct sk_buff *skb = iter->frag;
183
184 iter->frag = skb->next;
185 skb_mark_not_on_list(skb);
186
187 return skb;
188}
189
190struct ip_frag_state {
191 struct iphdr *iph;
192 unsigned int hlen;
193 unsigned int ll_rs;
194 unsigned int mtu;
195 unsigned int left;
196 int offset;
197 int ptr;
198 __be16 not_last_frag;
199};
200
201void ip_frag_init(struct sk_buff *skb, unsigned int hlen, unsigned int ll_rs,
202 unsigned int mtu, struct ip_frag_state *state);
203struct sk_buff *ip_frag_next(struct sk_buff *skb,
204 struct ip_frag_state *state);
205
164void ip_send_check(struct iphdr *ip);
165int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
166int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
167
168int __ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
169 __u8 tos);
170void ip_init(void);
171int ip_append_data(struct sock *sk, struct flowi4 *fl4,

--- 553 unchanged lines hidden ---
206void ip_send_check(struct iphdr *ip);
207int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
208int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
209
210int __ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
211 __u8 tos);
212void ip_init(void);
213int ip_append_data(struct sock *sk, struct flowi4 *fl4,

--- 553 unchanged lines hidden ---