/*
- * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
*
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 1996 Apple Computer, Inc.
* Kernel process to implement the AURP daemon:
* manage tunnels to remote AURP servers across IP networks
*/
+#ifdef AURP_SUPPORT
#include <sys/errno.h>
#include <sys/types.h>
#include <netat/sysglue.h>
#include <netat/appletalk.h>
+#include <netat/at_pcb.h>
#include <netat/at_var.h>
#include <netat/routing_tables.h>
#include <netat/at_pcb.h>
*/
bzero((char *)&aurp_global.tunnel, sizeof(aurp_global.tunnel));
/*lock_alloc(&aurp_global.glock, LOCK_ALLOC_PIN, AURP_EVNT_LOCK, -1);*/
- ATLOCKINIT(aurp_global.glock);
ATEVENTINIT(aurp_global.event_anchor);
/* open udp socket */
sopt.sopt_level = SOL_SOCKET;
sopt.sopt_name = SO_RCVBUF;
sopt.sopt_dir = SOPT_SET;
- sopt.sopt_p = NULL;
+ sopt.sopt_p = kernproc;
if ((error = sosetopt(so, &sopt)) != 0)
goto out;
}
sopt.sopt_level = SOL_SOCKET;
sopt.sopt_name = SO_SNDBUF;
sopt.sopt_dir = SOPT_SET;
- sopt.sopt_p = NULL;
+ sopt.sopt_p = kernproc;
if ((error = sosetopt(so, &sopt)) != 0)
goto out;
}
* when a packet arrives
*/
- ATDISABLE(s, aurp_global.glock);
events = aurp_global.event;
if (((*err == 0) || (*err == EWOULDBLOCK)) && events == 0)
{
events = aurp_global.event;
aurp_global.event = 0;
}
- ATENABLE(s, aurp_global.glock);
/*
* Shut down if we have the AE_SHUTDOWN event or if we got
* which will wake us from the sleep at
* the top of the outer loop.
*/
- ATDISABLE(s, aurp_global.glock);
aurp_global.event &= ~AE_UDPIP;
- ATENABLE(s, aurp_global.glock);
dPrintf(D_M_AURP, D_L_WARNING, ("AURPgetmsg: spurious soreceive, err==%d, p_mbuf==0x%x\n", *err, (unsigned int) p_mbuf));
break;
}
register int bit;
bit = (int) p;
- ATDISABLE(s, aurp_global.glock);
aurp_global.event |= bit;
- ATENABLE(s, aurp_global.glock);
dPrintf(D_M_AURP, D_L_STATE_CHG,
("aurp_wakeup: bit 0x%x, aurp_global.event now 0x%x\n",
int flags = MSG_DONTWAIT;
struct sockaddr_in rem_addr;
- m->m_type = MT_HEADER;
+ m_mchtype(m, MT_HEADER);
m->m_pkthdr.len = gbuf_msgsize(m);
m->m_pkthdr.rcvif = 0;
domain = (aurp_domain_t *)gbuf_rptr(m);
*(long *) &rem_addr.sin_addr = domain->dst_address;
- ATDISABLE(s, aurp_global.glock);
aurp_global.running++;
- ATENABLE(s, aurp_global.glock);
if (aurp_global.shutdown) {
gbuf_freem(m);
- ATDISABLE(s, aurp_global.glock);
aurp_global.running--;
- ATENABLE(s, aurp_global.glock);
dPrintf(D_M_AURP, D_L_SHUTDN_INFO,
("atalk_to_ip: detected aurp_global.shutdown state\n"));
return;
error));
}
- ATDISABLE(s, aurp_global.glock);
aurp_global.running--;
- ATENABLE(s, aurp_global.glock);
return;
}
+#endif /* AURP_SUPPORT */