Added the new version for dummynet.
[ipfw.git] / dummynet / missing.h
index d18f503..5b04dce 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef _MISSING_H_
 #define _MISSING_H_
 
+#include <sys/cdefs.h>
+
 #ifdef _WIN32
 
 #ifndef DEFINE_SPINLOCK
@@ -50,6 +52,7 @@
 
 #else  /* __linux__ */
 
+#define MALLOC_DECLARE(x)      /* nothing */
 #include <linux/time.h>                /* do_gettimeofday */
 #include <netinet/ip.h>                /* local version */
 struct inpcb;
@@ -122,7 +125,11 @@ struct malloc_type {
 
 #define CTASSERT(x)
 
-#define log(_level, fmt, arg...)  printk(KERN_ERR fmt, ##arg)
+/* log... does not use the first argument */
+#define        LOG_ERR         0x100
+#define        LOG_INFO        0x200
+#define log(_level, fmt, arg...)  do {                 \
+       int __unused x=_level;printk(KERN_ERR fmt, ##arg); } while (0)
 
 /*
  * gettimeofday would be in sys/time.h but it is not
@@ -263,6 +270,10 @@ int in_cksum(struct mbuf *m, int len);
 #define INADDR_TO_IFP(a, b) b = NULL
 #define pf_find_mtag(a) NULL
 #define pf_get_mtag(a) NULL
+/* we don't pullup, fail */
+#define m_pullup(m, x)                                 \
+       ((m)->m_len >= x ? (m) : (netisr_dispatch(-1, m), NULL))
+
 #ifndef _WIN32
 #define AF_LINK AF_ASH /* ? our sys/socket.h */
 #endif
@@ -389,7 +400,6 @@ struct sock *inet_lookup(
         const __be32 saddr, const __be16 sport,
         const __be32 daddr, const __be16 dport,
         const int dif);
-static int inet_iif(const struct sk_buff *skb);
 struct sock *tcp_v4_lookup(u32 saddr, u16 sport, u32 daddr, u16 dport, int dif);
 #endif /* Linux < 2.6 */
 
@@ -504,4 +514,6 @@ extern  ip_fw_chk_t     *ip_fw_chk_ptr;
 #define SYSCTL_VNET_PROC       SYSCTL_PROC
 #define SYSCTL_VNET_INT                SYSCTL_INT
 
+int my_mod_register(struct moduledata *mod, const char *name, int order);
+
 #endif /* !_MISSING_H_ */