diff options
Diffstat (limited to 'sys/net/net_osdep.h')
-rw-r--r-- | sys/net/net_osdep.h | 75 |
1 files changed, 66 insertions, 9 deletions
diff --git a/sys/net/net_osdep.h b/sys/net/net_osdep.h index a5ff633..5669275 100644 --- a/sys/net/net_osdep.h +++ b/sys/net/net_osdep.h @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $KAME: net_osdep.h,v 1.44 2001/05/16 03:13:40 jinmei Exp $ */ +/* $KAME: net_osdep.h,v 1.68 2001/12/21 08:14:58 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -35,16 +35,28 @@ /* * OS dependencies: + * - ioctl + * FreeBSD 3 and later warn when sys/ioctl.h is included in a kernel source + * file. For socket ioctl, we are suggested to use sys/sockio.h. + * + * - RTFREE() + * bsdi does not escape this macro using do-clause, so it is recommended + * to escape the macro explicitly. + * e.g. + * if (rt) { + * RTFREE(rt); + * } * * - whether the IPv4 input routine convert the byte order of some fileds * of the IP header (x: convert to the host byte order, s: strip the header * length for possible reassembly) - * ip_len ip_id ip_off - * bsdi3: xs x x - * bsdi4: xs x - * FreeBSD: xs x - * NetBSD: x x - * OpenBSD: xs x x + * ip_len ip_id ip_off + * bsdi3: xs x x + * bsdi4: xs x + * freebsd[23]: xs x x + * freebsd4: xs x + * NetBSD: x x + * OpenBSD: xs x x * * - ifa_ifwithaf() * bsdi[34], netbsd, and openbsd define it in sys/net/if.c @@ -131,6 +143,14 @@ * OpenBSD 2.8 * timeout_{add,set,del} is encouraged (sys/timeout.h) * + * - kernel internal time structure + * FreeBSD 2, NetBSD, OpenBSD, BSD/OS + * mono_time.tv_u?sec, time.tv_u?sec + * FreeBSD [34] + * time_second + * if you need portability, #ifdef out FreeBSD[34], or use microtime(&tv) + * then touch tv.tv_sec (note: microtime is an expensive operation). + * * - sysctl * NetBSD, OpenBSD * foo_sysctl() @@ -167,12 +187,16 @@ * * - ovbcopy() * in NetBSD 1.4 or later, ovbcopy() is not supplied in the kernel. - * bcopy() is safe against overwrites. + * we have updated sys/systm.h to include declaration. * * - splnet() * NetBSD 1.4 or later requires splsoftnet(). * other operating systems use splnet(). * + * - splimp() + * NetBSD-current (2001/4/13): use splnet() in network, splvm() in vm. + * other operating systems: use splimp(). + * * - dtom() * NEVER USE IT! * @@ -231,7 +255,40 @@ * others: do not increase refcnt for ifp->if_addrlist and in_ifaddr. * use IFAFREE once when ifaddr is disconnected from * ifp->if_addrlist and in_ifaddr. IFAFREE frees ifaddr when - * ifa_refcnt goes negative. + * ifa_refcnt goes negative. in KAME environment, IFAREF is + * provided as a compatibility wrapper (use it instead of + * ifa_refcnt++ to reduce #ifdef). + * + * - ifnet.if_lastchange + * freebsd, bsdi, netbsd-current (jun 14 2001-), + * openbsd-current (jun 15 2001-): updated only when IFF_UP changes. + * (RFC1573 ifLastChange interpretation) + * netbsd151, openbsd29: updated whenever packets go through the interface. + * (4.4BSD interpretation) + * + * - kernel compilation options ("options HOGE" in kernel config file) + * freebsd4: sys/conf/options has to have mapping between option + * and a header file (opt_hoge.h). + * netbsd: by default, -DHOGE will go into + * sys/arch/foo/compile/BAR/Makefile. + * if you define mapping in sys/conf/files, you can create + * a header file like opt_hoge.h to help make dependencies. + * bsdi/openbsd: always use -DHOGE in Makefile. there's no need/way + * to have opt_hoge.h. + * + * therefore, opt_hoge.h is mandatory on freebsd4 only. + * + * - MALLOC() macro + * Use it only if the size of the allocation is constant. + * When we do NOT collect statistics about kernel memory usage, the result + * of macro expansion contains a large set of condition branches. If the + * size is not constant, compilation optimization cannot be applied, and + * a bunch of the large branch will be embedded in the kernel code. + * + * - M_COPY_PKTHDR + * openbsd30: M_COPY_PKTHDR is deprecated. use M_MOVE_PKTHDR or + * M_DUP_PKTHDR, depending on how you want to handle m_tag. + * others: M_COPY_PKTHDR is available as usual. */ #ifndef __NET_NET_OSDEP_H_DEFINED_ |