[IPV4]: struct ipcm_cookie annotation
[cascardo/linux.git] / include / net / ip.h
index e4563bb..b40bd2f 100644 (file)
 #ifndef _IP_H
 #define _IP_H
 
-#include <linux/config.h>
 #include <linux/types.h>
-#include <linux/socket.h>
 #include <linux/ip.h>
 #include <linux/in.h>
-#include <linux/netdevice.h>
-#include <linux/inetdevice.h>
-#include <linux/in_route.h>
-#include <net/route.h>
-#include <net/arp.h>
+
+#include <net/inet_sock.h>
 #include <net/snmp.h>
 
 struct sock;
@@ -41,15 +36,16 @@ struct inet_skb_parm
        struct ip_options       opt;            /* Compiled IP options          */
        unsigned char           flags;
 
-#define IPSKB_MASQUERADED      1
-#define IPSKB_TRANSLATED       2
-#define IPSKB_FORWARDED                4
-#define IPSKB_XFRM_TUNNEL_SIZE 8
+#define IPSKB_FORWARDED                1
+#define IPSKB_XFRM_TUNNEL_SIZE 2
+#define IPSKB_XFRM_TRANSFORMED 4
+#define IPSKB_FRAG_COMPLETE    8
+#define IPSKB_REROUTED         16
 };
 
 struct ipcm_cookie
 {
-       u32                     addr;
+       __be32                  addr;
        int                     oif;
        struct ip_options       *opt;
 };
@@ -74,6 +70,13 @@ extern rwlock_t ip_ra_lock;
 
 #define IP_FRAG_TIME   (30 * HZ)               /* fragment lifetime    */
 
+struct msghdr;
+struct net_device;
+struct packet_type;
+struct rtable;
+struct sk_buff;
+struct sockaddr;
+
 extern void            ip_mc_dropsocket(struct sock *);
 extern void            ip_mc_dropdevice(struct net_device *dev);
 extern int             igmp_mc_proc_init(void);
@@ -83,7 +86,7 @@ extern int            igmp_mc_proc_init(void);
  */
 
 extern int             ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
-                                             u32 saddr, u32 daddr,
+                                             __be32 saddr, __be32 daddr,
                                              struct ip_options *opt);
 extern int             ip_rcv(struct sk_buff *skb, struct net_device *dev,
                               struct packet_type *pt, struct net_device *orig_dev);
@@ -91,7 +94,7 @@ extern int            ip_local_deliver(struct sk_buff *skb);
 extern int             ip_mr_input(struct sk_buff *skb);
 extern int             ip_output(struct sk_buff *skb);
 extern int             ip_mc_output(struct sk_buff *skb);
-extern int             ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*));
+extern int             ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
 extern int             ip_do_nat(struct sk_buff *skb);
 extern void            ip_send_check(struct iphdr *ip);
 extern int             ip_queue_xmit(struct sk_buff *skb, int ipfragok);
@@ -143,7 +146,6 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
 struct ipv4_config
 {
        int     log_martians;
-       int     autoconfig;
        int     no_pmtu_disc;
 };
 
@@ -168,6 +170,7 @@ extern int sysctl_ipfrag_high_thresh;
 extern int sysctl_ipfrag_low_thresh;
 extern int sysctl_ipfrag_time;
 extern int sysctl_ipfrag_secret_interval;
+extern int sysctl_ipfrag_max_dist;
 
 /* From inetpeer.c */
 extern int inet_peer_threshold;
@@ -182,6 +185,8 @@ extern int sysctl_ip_dynaddr;
 extern void ipfrag_init(void);
 
 #ifdef CONFIG_INET
+#include <net/dst.h>
+
 /* The function in 2.2 was invalid, producing wrong result for
  * check=0xFEFF. It was noticed by Arthur Skawina _year_ ago. --ANK(000625) */
 static inline
@@ -310,7 +315,6 @@ enum ip_defrag_users
        IP_DEFRAG_CALL_RA_CHAIN,
        IP_DEFRAG_CONNTRACK_IN,
        IP_DEFRAG_CONNTRACK_OUT,
-       IP_DEFRAG_NAT_OUT,
        IP_DEFRAG_VS_IN,
        IP_DEFRAG_VS_OUT,
        IP_DEFRAG_VS_FWD
@@ -331,7 +335,7 @@ extern int ip_net_unreachable(struct sk_buff *skb);
  *     Functions provided by ip_options.c
  */
  
-extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, u32 daddr, struct rtable *rt, int is_frag);
+extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, __be32 daddr, struct rtable *rt, int is_frag);
 extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb);
 extern void ip_options_fragment(struct sk_buff *skb);
 extern int ip_options_compile(struct ip_options *opt, struct sk_buff *skb);
@@ -351,6 +355,10 @@ extern void        ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb);
 extern int     ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc);
 extern int     ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen);
 extern int     ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen);
+extern int     compat_ip_setsockopt(struct sock *sk, int level,
+                       int optname, char __user *optval, int optlen);
+extern int     compat_ip_getsockopt(struct sock *sk, int level,
+                       int optname, char __user *optval, int __user *optlen);
 extern int     ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *));
 
 extern int     ip_recv_error(struct sock *sk, struct msghdr *msg, int len);