aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 0d2281b4b27a..e44b1a44f67a 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -72,13 +72,27 @@ struct ipcm_cookie {
72 __be32 addr; 72 __be32 addr;
73 int oif; 73 int oif;
74 struct ip_options_rcu *opt; 74 struct ip_options_rcu *opt;
75 __u8 tx_flags;
76 __u8 ttl; 75 __u8 ttl;
77 __s16 tos; 76 __s16 tos;
78 char priority; 77 char priority;
79 __u16 gso_size; 78 __u16 gso_size;
80}; 79};
81 80
81static inline void ipcm_init(struct ipcm_cookie *ipcm)
82{
83 *ipcm = (struct ipcm_cookie) { .tos = -1 };
84}
85
86static inline void ipcm_init_sk(struct ipcm_cookie *ipcm,
87 const struct inet_sock *inet)
88{
89 ipcm_init(ipcm);
90
91 ipcm->sockc.tsflags = inet->sk.sk_tsflags;
92 ipcm->oif = inet->sk.sk_bound_dev_if;
93 ipcm->addr = inet->inet_saddr;
94}
95
82#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) 96#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
83#define PKTINFO_SKB_CB(skb) ((struct in_pktinfo *)((skb)->cb)) 97#define PKTINFO_SKB_CB(skb) ((struct in_pktinfo *)((skb)->cb))
84 98
@@ -138,6 +152,8 @@ int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk,
138 struct ip_options_rcu *opt); 152 struct ip_options_rcu *opt);
139int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, 153int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
140 struct net_device *orig_dev); 154 struct net_device *orig_dev);
155void ip_list_rcv(struct list_head *head, struct packet_type *pt,
156 struct net_device *orig_dev);
141int ip_local_deliver(struct sk_buff *skb); 157int ip_local_deliver(struct sk_buff *skb);
142int ip_mr_input(struct sk_buff *skb); 158int ip_mr_input(struct sk_buff *skb);
143int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb); 159int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb);
@@ -148,7 +164,8 @@ void ip_send_check(struct iphdr *ip);
148int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb); 164int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
149int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb); 165int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
150 166
151int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl); 167int __ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
168 __u8 tos);
152void ip_init(void); 169void ip_init(void);
153int ip_append_data(struct sock *sk, struct flowi4 *fl4, 170int ip_append_data(struct sock *sk, struct flowi4 *fl4,
154 int getfrag(void *from, char *to, int offset, int len, 171 int getfrag(void *from, char *to, int offset, int len,
@@ -174,6 +191,12 @@ struct sk_buff *ip_make_skb(struct sock *sk, struct flowi4 *fl4,
174 struct ipcm_cookie *ipc, struct rtable **rtp, 191 struct ipcm_cookie *ipc, struct rtable **rtp,
175 struct inet_cork *cork, unsigned int flags); 192 struct inet_cork *cork, unsigned int flags);
176 193
194static inline int ip_queue_xmit(struct sock *sk, struct sk_buff *skb,
195 struct flowi *fl)
196{
197 return __ip_queue_xmit(sk, skb, fl, inet_sk(sk)->tos);
198}
199
177static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4) 200static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4)
178{ 201{
179 return __ip_make_skb(sk, fl4, &sk->sk_write_queue, &inet_sk(sk)->cork.base); 202 return __ip_make_skb(sk, fl4, &sk->sk_write_queue, &inet_sk(sk)->cork.base);