home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / trace / tcpdump-2.2.1 / bpf / net / bpf_compat.h next >
Encoding:
C/C++ Source or Header  |  1992-05-22  |  1.5 KB  |  34 lines

  1. /*
  2.  * Copyright (c) 1992 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Lawrence Berkeley Laboratory,
  11.  * Berkeley, CA.  The name of the University may not be used to
  12.  * endorse or promote products derived from this software without
  13.  * specific prior written permission.
  14.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  15.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  16.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  17.  *
  18.  * @(#) $Header: bpf_compat.h,v 1.1 92/05/22 15:33:20 mccanne Exp $ (LBL)
  19.  */
  20.  
  21. /*
  22.  * Some hacks for compatibility across SunOS and 4.4BSD.  We emulate
  23.  * malloc and free with mbuf clusters.  We store a pointer to
  24.  * the mbuf in the first word of the mbuf and return 8 bytes
  25.  * passed the start of data (for double word alignment).
  26.  * We cannot just use offsets because clusters are not at a fixed
  27.  * offset from the associated mbuf.  Sorry for this kludge.
  28.  */
  29. #define malloc(size, type, canwait) bpf_alloc(size, canwait)
  30. #define free(cp, type) m_free(*(struct mbuf **)(cp - 8))
  31. #define M_WAITOK M_WAIT
  32. /* This mapping works for our purposes. */
  33. #define ERESTART EINTR
  34.