2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 * Modification History
26 * March 24, 2000 Allan Nathanson <ajn@apple.com>
35 notify_server(mach_msg_header_t
*request
, mach_msg_header_t
*reply
)
37 mach_no_senders_notification_t
*notify
= (mach_no_senders_notification_t
*)request
;
39 if ((notify
->not_header
.msgh_id
> MACH_NOTIFY_LAST
) ||
40 (notify
->not_header
.msgh_id
< MACH_NOTIFY_FIRST
)) {
41 return FALSE
; /* if this is not a notification message */
44 switch (notify
->not_header
.msgh_id
) {
45 case MACH_NOTIFY_NO_SENDERS
:
46 SCLog(_configd_verbose
, LOG_DEBUG
, CFSTR("No more senders for port %d, closing."),
47 notify
->not_header
.msgh_local_port
);
48 cleanupSession(notify
->not_header
.msgh_local_port
);
50 (void) mach_port_destroy(mach_task_self(), notify
->not_header
.msgh_local_port
);
52 notify
->not_header
.msgh_remote_port
= MACH_PORT_NULL
;
54 case MACH_NOTIFY_DEAD_NAME
:
55 SCLog(_configd_verbose
, LOG_DEBUG
, CFSTR("Dead name for port %d, closing."),
56 notify
->not_header
.msgh_local_port
);
57 cleanupSession(notify
->not_header
.msgh_local_port
);
59 (void) mach_port_destroy(mach_task_self(), notify
->not_header
.msgh_local_port
);
61 notify
->not_header
.msgh_remote_port
= MACH_PORT_NULL
;
67 SCLog(_configd_verbose
, LOG_DEBUG
, CFSTR("HELP!, Received notification: port=%d, msgh_id=%d"),
68 notify
->not_header
.msgh_local_port
,
69 notify
->not_header
.msgh_id
);