*/
-#if ! defined(AFS_AIX_ENV) && ! defined(AFS_SUN5_ENV) && ! defined(UKERNEL) && ! defined(AFS_LINUX20_ENV) && !defined (AFS_DARWIN_ENV)
+#if ! defined(AFS_AIX_ENV) && ! defined(AFS_SUN5_ENV) && ! defined(UKERNEL) && ! defined(AFS_LINUX20_ENV) && !defined (AFS_DARWIN_ENV) && !defined (AFS_FBSD_ENV)
/* Routine called during the afsd "-shutdown" process to put things back to
* the initial state.
*/
#else /* AFS_USERSPACE_IP_ADDR */
-#if !defined(AFS_AIX41_ENV) && !defined(AFS_DUX40_ENV) && !defined(AFS_DARWIN_ENV)
+#if !defined(AFS_AIX41_ENV) && !defined(AFS_DUX40_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
#define IFADDR2SA(f) (&((f)->ifa_addr))
#else /* AFS_AIX41_ENV */
#define IFADDR2SA(f) ((f)->ifa_addr)
bzero(addrs, sizeof(addrs));
bzero(mtus, sizeof(mtus));
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
TAILQ_FOREACH(ifn, &ifnet, if_link) {
if (i >= ADDRSPERSITE) break;
#else
for (ifn = ifnet; ifn != NULL && i < ADDRSPERSITE; ifn = ifn->if_next) {
#endif
rxmtu = (ifn->if_mtu - RX_IPUDP_SIZE);
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
TAILQ_FOREACH(ifad, &ifn->if_addrhead, ifa_link) {
if (i >= ADDRSPERSITE) break;
#else
/* if we're given an address, skip everything until we find it */
if (!*pifad)
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
*pifad = TAILQ_FIRST(&in_ifaddrhead);
#else
*pifad = in_ifaddr;
else {
if (((ppaddr & (*pifad)->ia_subnetmask) == (*pifad)->ia_subnet))
match_value = 2; /* don't find matching nets, just subnets */
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
*pifad = TAILQ_NEXT(*pifad, ia_link);
#else
*pifad = (*pifad)->ia_next;
#endif
}
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
for (ifa = *pifad; ifa; ifa = TAILQ_NEXT(ifa, ia_link) ) {
#else
for (ifa = *pifad; ifa; ifa = ifa->ia_next ) {
#endif
AFS_STATCNT(osi_NewSocket);
-#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+#if (defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)) && defined(KERNEL_FUNNEL)
thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
#endif
#if defined(AFS_HPUX102_ENV)
#else
#ifdef AFS_SGI65_ENV
code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP);
+#elif defined(AFS_FBSD_ENV)
+ code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP, curproc);
#else
code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0);
#endif /* AFS_SGI65_ENV */
if (code)
osi_Panic("osi_NewSocket: last attempt to reserve 32K failed!\n");
}
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
myaddr.sin_len = sizeof(myaddr);
+#if defined(AFS_FBSD_ENV)
+ code = sobind(newSocket, (struct sockaddr *)&myaddr, curproc);
+#else
code = sobind(newSocket, (struct sockaddr *)&myaddr);
+#endif
if (code) {
printf("sobind fails\n");
soclose(newSocket);
nam = m_get(M_WAIT, MT_SONAME);
#endif
if (nam == NULL) {
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV)
setuerror(ENOBUFS);
#endif
goto bad;
BHV_PDATA(&bhv) = (void*)newSocket;
code = sobind(&bhv, nam);
m_freem(nam);
+#elif defined(AFS_FBSD_ENV)
+ code = sobind(newSocket, nam, curproc);
#else
code = sobind(newSocket, nam);
#endif
#ifdef AFS_SUN5_ENV
rxk_ListenerPid = ttoproc(curthread)->p_pidp->pid_id;
#endif /* AFS_SUN5_ENV */
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
rxk_ListenerPid = current_proc()->p_pid;
#endif
#if defined(RX_ENABLE_LOCKS) && !defined(AFS_SUN5_ENV)
#endif /* AFS_SUN5_ENV */
}
-#if !defined(AFS_LINUX20_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV)
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
/* The manner of stopping the rx listener thread may vary. Most unix's should
* be able to call soclose.
*/