]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/ip.h
[IPV6] SNMP: Use put_unaligned() instead of memcpy().
[karo-tx-linux.git] / include / net / ip.h
index 412e8114667d514d7969825059cf3a00c04088da..f41ce07f6700c031c58ef93003db3355bb3b6b01 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/types.h>
 #include <linux/ip.h>
 #include <linux/in.h>
+#include <linux/skbuff.h>
 
 #include <net/inet_sock.h>
 #include <net/snmp.h>
@@ -43,6 +44,11 @@ struct inet_skb_parm
 #define IPSKB_REROUTED         16
 };
 
+static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
+{
+       return ip_hdr(skb)->ihl * 4;
+}
+
 struct ipcm_cookie
 {
        __be32                  addr;
@@ -74,7 +80,6 @@ struct msghdr;
 struct net_device;
 struct packet_type;
 struct rtable;
-struct sk_buff;
 struct sockaddr;
 
 extern void            ip_mc_dropsocket(struct sock *);
@@ -97,7 +102,7 @@ extern int           ip_mc_output(struct sk_buff *skb);
 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, struct sock *sk, int ipfragok);
+extern int             ip_queue_xmit(struct sk_buff *skb, int ipfragok);
 extern void            ip_init(void);
 extern int             ip_append_data(struct sock *sk,
                                       int getfrag(void *from, char *to, int offset, int len,
@@ -135,7 +140,7 @@ static inline void ip_tr_mc_map(__be32 addr, char *buf)
 
 struct ip_reply_arg {
        struct kvec iov[1];   
-       u32         csum; 
+       __wsum      csum;
        int         csumoffset; /* u16 offset of csum in iov[0].iov_base */
                                /* -1 if not needed */ 
 }; 
@@ -161,6 +166,9 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
 #define NET_ADD_STATS_BH(field, adnd)  SNMP_ADD_STATS_BH(net_statistics, field, adnd)
 #define NET_ADD_STATS_USER(field, adnd)        SNMP_ADD_STATS_USER(net_statistics, field, adnd)
 
+extern int snmp_mib_init(void *ptr[2], size_t mibsize, size_t mibalign);
+extern void snmp_mib_free(void *ptr[2]);
+
 extern int sysctl_local_port_range[2];
 extern int sysctl_ip_default_ttl;
 extern int sysctl_ip_nonlocal_bind;
@@ -192,9 +200,9 @@ extern void ipfrag_init(void);
 static inline
 int ip_decrease_ttl(struct iphdr *iph)
 {
-       u32 check = iph->check;
-       check += htons(0x0100);
-       iph->check = check + (check>=0xFFFF);
+       u32 check = (__force u32)iph->check;
+       check += (__force u32)htons(0x0100);
+       iph->check = (__force __sum16)(check + (check>=0xFFFF));
        return --iph->ttl;
 }
 
@@ -376,8 +384,7 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
                         size_t *lenp, loff_t *ppos);
 int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
                                  void __user *oldval, size_t __user *oldlenp,
-                                 void __user *newval, size_t newlen, 
-                                 void **context);
+                                 void __user *newval, size_t newlen);
 #ifdef CONFIG_PROC_FS
 extern int ip_misc_proc_init(void);
 #endif