summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/ip_compat.h
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>1997-05-25 15:45:04 +0000
committerdarrenr <darrenr@FreeBSD.org>1997-05-25 15:45:04 +0000
commite0610b5498ab54082ddadbfebd47280245e3e0f8 (patch)
treef9876809ef0dd75bd4671d4afb7d3488f1972a5f /contrib/ipfilter/ip_compat.h
parentd25503500842fdd0550710a7afb953d1b8f20f00 (diff)
downloadFreeBSD-src-e0610b5498ab54082ddadbfebd47280245e3e0f8.zip
FreeBSD-src-e0610b5498ab54082ddadbfebd47280245e3e0f8.tar.gz
Import version 3.2alpha7
Diffstat (limited to 'contrib/ipfilter/ip_compat.h')
-rw-r--r--contrib/ipfilter/ip_compat.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/contrib/ipfilter/ip_compat.h b/contrib/ipfilter/ip_compat.h
index c1fbfce..cbb3239 100644
--- a/contrib/ipfilter/ip_compat.h
+++ b/contrib/ipfilter/ip_compat.h
@@ -1,15 +1,15 @@
/*
- * (C)opyright 1993, 1994, 1995 by Darren Reed.
+ * (C)opyright 1993-1997 by Darren Reed.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and due credit is given
* to the original author and the contributors.
*
* @(#)ip_compat.h 1.8 1/14/96
- * $Id: ip_compat.h,v 2.0.2.6 1997/04/02 12:23:17 darrenr Exp $
+ * $Id: ip_compat.h,v 2.0.2.11 1997/05/04 05:29:02 darrenr Exp $
*/
-#ifndef __IP_COMPAT_H_
+#ifndef __IP_COMPAT_H__
#define __IP_COMPAT_H__
#ifndef __P
@@ -24,6 +24,22 @@
#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
#endif
+#if defined(_KERNEL) && !defined(KERNEL)
+#define KERNEL
+#endif
+#if defined(KERNEL) && !defined(_KERNEL)
+#define _KERNEL
+#endif
+
+#if defined(__SVR4) || defined(__svr4__)
+#define index strchr
+# ifndef _KERNEL
+# define bzero(a,b) memset(a,0,b)
+# define bcmp memcmp
+# define bcopy(a,b,c) memmove(b,a,c)
+# endif
+#endif
+
#if SOLARIS
# define MTYPE(m) ((m)->b_datap->db_type)
# include <sys/ioccom.h>
@@ -58,8 +74,10 @@
#if BSD > 199306
# define USE_QUAD_T
# define U_QUAD_T u_quad_t
+# define QUAD_T quad_t
#else
# define U_QUAD_T u_long
+# define QUAD_T long
#endif
#ifndef MAX
@@ -167,6 +185,7 @@ extern ill_t *get_unit __P((char *));
# define UIOMOVE(a,b,c,d) uiomove(a,b,c,d)
# define SLEEP(id, n) sleep((id), PZERO+1)
# define KFREE(x) kmem_free((char *)(x), sizeof(*(x)))
+# define KFREES(x,s) kmem_free((char *)(x), (s))
# if SOLARIS
typedef struct qif {
struct qif *qf_next;
@@ -219,13 +238,16 @@ extern vm_map_t kmem_map;
# define KMALLOC(a,b,c) (a) = (b)kmem_alloc(kmem_map, (c))
# define KFREE(x) kmem_free(kmem_map, (vm_offset_t)(x), \
sizeof(*(x)))
+# define KFREES(x,s) kmem_free(kmem_map, (vm_offset_t)(x), (s))
*/
# ifdef M_PFIL
# define KMALLOC(a, b, c) MALLOC((a), b, (c), M_PFIL, M_NOWAIT)
# define KFREE(x) FREE((x), M_PFIL)
+# define KFREES(x,s) FREE((x), M_PFIL)
# else
# define KMALLOC(a, b, c) MALLOC((a), b, (c), M_TEMP, M_NOWAIT)
# define KFREE(x) FREE((x), M_TEMP)
+# define KFREES(x,s) FREE((x), M_TEMP)
# endif
# define UIOMOVE(a,b,c,d) uiomove(a,b,d)
# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0)
@@ -238,7 +260,9 @@ extern vm_map_t kmem_map;
# define SPLX(x) (void) splx(x)
# endif
# endif
+# define PANIC(x,y) if (x) panic y
#else
+# define PANIC(x,y) ;
# define MUTEX_ENTER(x) ;
# define MUTEX_EXIT(x) ;
# define SPLNET(x) ;
@@ -246,6 +270,7 @@ extern vm_map_t kmem_map;
# define SPLX(x) ;
# define KMALLOC(a,b,c) (a) = (b)malloc(c)
# define KFREE(x) free(x)
+# define KFREES(x,s) free(x)
# define GETUNIT(x) get_unit(x)
# define IRCOPY(a,b,c) bcopy((a), (b), (c))
# define IWCOPY(a,b,c) bcopy((a), (b), (c))
@@ -365,6 +390,7 @@ struct ipovly {
# define KMALLOC(a,b,c) (a) = (b)kmalloc((c), GFP_ATOMIC)
# define KFREE(x) kfree_s((x), sizeof(*(x)))
+# define KFREES(x,s) kfree_s((x), (s))
# define IRCOPY(a,b,c) { \
error = verify_area(VERIFY_READ, \
(b) ,sizeof((b))); \
OpenPOWER on IntegriCloud