[NETFILTER]: x_tables: add missing try to load conntrack from match/targets
[cascardo/linux.git] / net / dccp / dccp.h
index 363fa52..a0900bf 100644 (file)
 #include <net/tcp.h>
 #include "ackvec.h"
 
+/*
+ *     DCCP - specific warning and debugging macros.
+ */
+#define DCCP_WARN(fmt, a...) LIMIT_NETDEBUG(KERN_WARNING "%s: " fmt,       \
+                                                       __FUNCTION__, ##a)
+#define DCCP_CRIT(fmt, a...) printk(KERN_CRIT fmt " at %s:%d/%s()\n", ##a, \
+                                        __FILE__, __LINE__, __FUNCTION__)
+#define DCCP_BUG(a...)       do { DCCP_CRIT("BUG: " a); dump_stack(); } while(0)
+#define DCCP_BUG_ON(cond)    do { if (unlikely((cond) != 0))              \
+                                    DCCP_BUG("\"%s\" holds (exception!)", \
+                                             __stringify(cond));          \
+                            } while (0)
+
+#ifdef MODULE
+#define DCCP_PRINTK(enable, fmt, args...)      do { if (enable)             \
+                                                       printk(fmt, ##args); \
+                                               } while(0)
+#else
+#define DCCP_PRINTK(enable, fmt, args...)      printk(fmt, ##args)
+#endif
+#define DCCP_PR_DEBUG(enable, fmt, a...)       DCCP_PRINTK(enable, KERN_DEBUG \
+                                                 "%s: " fmt, __FUNCTION__, ##a)
+
 #ifdef CONFIG_IP_DCCP_DEBUG
 extern int dccp_debug;
-
-#define dccp_pr_debug(format, a...) \
-       do { if (dccp_debug) \
-               printk(KERN_DEBUG "%s: " format, __FUNCTION__ , ##a); \
-       } while (0)
-#define dccp_pr_debug_cat(format, a...) do { if (dccp_debug) \
-                                            printk(format, ##a); } while (0)
+#define dccp_pr_debug(format, a...)      DCCP_PR_DEBUG(dccp_debug, format, ##a)
+#define dccp_pr_debug_cat(format, a...)   DCCP_PRINTK(dccp_debug, format, ##a)
 #else
 #define dccp_pr_debug(format, a...)
 #define dccp_pr_debug_cat(format, a...)
@@ -62,8 +80,6 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo);
 
 #define DCCP_RTO_MAX ((unsigned)(120 * HZ)) /* FIXME: using TCP value */
 
-#define DCCP_XMIT_TIMEO 30000 /* Time/msecs for blocking transmit per packet */
-
 /* sysctl variables for DCCP */
 extern int  sysctl_dccp_request_retries;
 extern int  sysctl_dccp_retries1;
@@ -74,6 +90,7 @@ extern int  sysctl_dccp_feat_tx_ccid;
 extern int  sysctl_dccp_feat_ack_ratio;
 extern int  sysctl_dccp_feat_send_ack_vector;
 extern int  sysctl_dccp_feat_send_ndp_count;
+extern int  sysctl_dccp_tx_qlen;
 
 /* is seq1 < seq2 ? */
 static inline int before48(const u64 seq1, const u64 seq2)
@@ -415,6 +432,7 @@ static inline void timeval_sub_usecs(struct timeval *tv,
                tv->tv_sec--;
                tv->tv_usec += USEC_PER_SEC;
        }
+       DCCP_BUG_ON(tv->tv_sec < 0);
 }
 
 #ifdef CONFIG_SYSCTL