]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/udp.h
[UDP]: Restore missing inDatagrams increments
[linux-2.6-omap-h63xx.git] / include / net / udp.h
index 98755ebaf163cfe788b4117167cfeaf1a861f269..98cb09ca3a27e548c108d63f986a4b2084139145 100644 (file)
@@ -139,6 +139,12 @@ extern int         udp_lib_setsockopt(struct sock *sk, int level, int optname,
                                   int (*push_pending_frames)(struct sock *));
 
 DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
+DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6);
+
+/* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */
+DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics);
+DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
+
 /*
  *     SNMP statistics for UDP and UDP-Lite
  */
@@ -149,6 +155,25 @@ DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
        if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field);         \
        else            SNMP_INC_STATS_BH(udp_statistics, field);    }  while(0)
 
+#define UDP6_INC_STATS_BH(field, is_udplite)                         do  {  \
+       if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field);         \
+       else            SNMP_INC_STATS_BH(udp_stats_in6, field);    } while(0)
+#define UDP6_INC_STATS_USER(field, is_udplite)                        do {    \
+       if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field);         \
+       else            SNMP_INC_STATS_USER(udp_stats_in6, field);    } while(0)
+
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+#define UDPX_INC_STATS_BH(sk, field) \
+       do { \
+               if ((sk)->sk_family == AF_INET) \
+                       UDP_INC_STATS_BH(field, 0); \
+               else \
+                       UDP6_INC_STATS_BH(field, 0); \
+       } while (0);
+#else
+#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(field, 0)
+#endif
+
 /* /proc */
 struct udp_seq_afinfo {
        struct module           *owner;