OpenAFS
OpenAFS distributed network file system
|
00001 /* 00002 * Copyright 2000, International Business Machines Corporation and others. 00003 * All Rights Reserved. 00004 * 00005 * This software has been released under the terms of the IBM Public 00006 * License. For details, see the LICENSE file in the top-level source 00007 * directory or online at http://www.openafs.org/dl/license10.html 00008 */ 00009 00010 /* Definitions specific to the in-kernel implementation of Rx, for in-kernel clients */ 00011 00012 #ifndef __RX_KERNEL_INCL_ 00013 #define __RX_KERNEL_INCL_ 1 00014 00015 #define osi_Alloc afs_osi_Alloc 00016 #define osi_Free afs_osi_Free 00017 00018 #ifndef RXK_TIMEDSLEEP_ENV 00019 #define rxi_ReScheduleEvents 0 /* Not needed by kernel */ 00020 #endif 00021 00022 /* This is a no-op, because the kernel server procs are pre-allocated */ 00023 #define rxi_StartServerProcs(x) (void)0 00024 00025 /* Socket stuff */ 00026 typedef struct socket *osi_socket; 00027 #define OSI_NULLSOCKET ((osi_socket) 0) 00028 00029 #if (!defined(AFS_GLOBAL_SUNLOCK) && !defined(RX_ENABLE_LOCKS)) 00030 #include "afs/icl.h" 00031 #include "afs/afs_trace.h" 00032 #endif 00033 #define osi_rxSleep(a) afs_Trace2(afs_iclSetp, CM_TRACE_RXSLEEP, \ 00034 ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, __LINE__); afs_osi_Sleep(a) 00035 #define osi_rxWakeup(a) if (afs_osi_Wakeup(a) == 0) afs_Trace2(afs_iclSetp, \ 00036 CM_TRACE_RXWAKE, ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, __LINE__) 00037 00038 extern int osi_utoa(char *buf, size_t len, unsigned long val); 00039 #define osi_Assert(exp) (void)((exp) || (osi_AssertFailK( #exp , __FILE__, __LINE__), 0)) 00040 00041 #define osi_Msg printf)( 00042 #define osi_VMsg vprintf)( 00043 00044 #define osi_YieldIfPossible() 00045 #define osi_WakeupAndYieldIfPossible(x) rx_Wakeup(x) 00046 00047 #if !defined(AFS_DARWIN80_ENV) || defined(UKERNEL) 00048 # ifdef UKERNEL 00049 # define rx_ifnet_t struct usr_ifnet * 00050 # define rx_ifaddr_t struct usr_ifaddr * 00051 # else 00052 # define rx_ifnet_t struct ifnet * 00053 # define rx_ifaddr_t struct ifaddr * 00054 #endif 00055 #define rx_ifnet_mtu(x) (x)->if_mtu 00056 #define rx_ifnet_flags(x) (x?(x)->if_flags:0) 00057 #if defined(AFS_OBSD46_ENV) || defined(AFS_FBSD81_ENV) 00058 #define rx_ifaddr_withnet(x) ifa_ifwithnet(x, 0) 00059 #else 00060 #define rx_ifaddr_withnet(x) ifa_ifwithnet(x) 00061 #endif 00062 #define rx_ifnet_metric(x) (x?(x)->if_data.ifi_metric:0) 00063 #define rx_ifaddr_ifnet(x) (x?(x)->ifa_ifp:0) 00064 #define rx_ifaddr_address_family(x) (x)->ifa_addr->sa_family 00065 #define rx_ifaddr_address(x, y, z) memcpy(y, (x)->ifa_addr, z) 00066 #define rx_ifaddr_netmask(x, y, z) memcpy(y, (x)->ifa_netmask, z) 00067 #define rx_ifaddr_dstaddress(x, y, z) memcpy(y, (x)->ifa_dstaddr, z) 00068 #else 00069 #define rx_ifnet_t ifnet_t 00070 #define rx_ifaddr_t ifaddr_t 00071 #define rx_ifaddr_withnet(x) ifaddr_withnet(x) 00072 #define rx_ifnet_mtu(x) ifnet_mtu(x) 00073 #define rx_ifnet_flags(x) ifnet_flags(x) 00074 #define rx_ifnet_metric(x) ifnet_metric(x) 00075 #define rx_ifaddr_ifnet(x) ifaddr_ifnet(x) 00076 #define rx_ifaddr_address_family(x) ifaddr_address_family(x) 00077 #define rx_ifaddr_address(x, y, z) ifaddr_address(x, y, z) 00078 #define rx_ifaddr_netmask(x, y, z) ifaddr_netmask(x, y, z) 00079 #define rx_ifaddr_dstaddress(x, y, z) ifaddr_dstaddress(x, y, z) 00080 #endif 00081 00082 #endif /* __RX_KERNEL_INCL_ */