17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*45916cd2Sjpk * Common Development and Distribution License (the "License"). 6*45916cd2Sjpk * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*45916cd2Sjpk * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 277c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4.1.2 */ 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate # include <time.h> 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate # include "lpsched.h" 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate void s_accept_dest ( char * , MESG * ); 377c478bd9Sstevel@tonic-gate void s_alloc_files ( char * , MESG * ); 387c478bd9Sstevel@tonic-gate void s_cancel ( char * , MESG * ); 397c478bd9Sstevel@tonic-gate void s_cancel_request ( char * , MESG * ); 407c478bd9Sstevel@tonic-gate void s_complete_job ( char * , MESG * ); 417c478bd9Sstevel@tonic-gate void s_disable_dest ( char * , MESG * ); 427c478bd9Sstevel@tonic-gate void s_enable_dest ( char * , MESG * ); 437c478bd9Sstevel@tonic-gate void s_end_change_request ( char * , MESG * ); 447c478bd9Sstevel@tonic-gate void s_inquire_class ( char * , MESG * ); 457c478bd9Sstevel@tonic-gate void s_inquire_printer_status ( char * , MESG * ); 467c478bd9Sstevel@tonic-gate void s_inquire_request_rank ( char * , MESG * ); 477c478bd9Sstevel@tonic-gate void s_load_class ( char * , MESG * ); 487c478bd9Sstevel@tonic-gate void s_load_filter_table ( char * , MESG * ); 497c478bd9Sstevel@tonic-gate void s_load_form ( char * , MESG * ); 507c478bd9Sstevel@tonic-gate void s_load_printer ( char * , MESG * ); 517c478bd9Sstevel@tonic-gate void s_load_printwheel ( char * , MESG * ); 527c478bd9Sstevel@tonic-gate void s_load_system ( char * , MESG * ); 537c478bd9Sstevel@tonic-gate void s_load_user_file ( char * , MESG * ); 547c478bd9Sstevel@tonic-gate void s_mount ( char * , MESG * ); 557c478bd9Sstevel@tonic-gate void s_move_dest ( char * , MESG * ); 567c478bd9Sstevel@tonic-gate void s_move_request ( char * , MESG * ); 577c478bd9Sstevel@tonic-gate void s_print_request ( char * , MESG * ); 587c478bd9Sstevel@tonic-gate void s_quiet_alert ( char * , MESG * ); 597c478bd9Sstevel@tonic-gate void s_reject_dest ( char * , MESG * ); 607c478bd9Sstevel@tonic-gate void s_send_fault ( char * , MESG * ); 617c478bd9Sstevel@tonic-gate void s_clear_fault ( char * , MESG * ); 627c478bd9Sstevel@tonic-gate void s_shutdown ( char * , MESG * ); 637c478bd9Sstevel@tonic-gate void s_start_change_request ( char * , MESG * ); 647c478bd9Sstevel@tonic-gate void s_unload_class ( char * , MESG * ); 657c478bd9Sstevel@tonic-gate void s_unload_filter_table ( char * , MESG * ); 667c478bd9Sstevel@tonic-gate void s_unload_form ( char * , MESG * ); 677c478bd9Sstevel@tonic-gate void s_unload_printer ( char * , MESG * ); 687c478bd9Sstevel@tonic-gate void s_unload_printwheel ( char * , MESG * ); 697c478bd9Sstevel@tonic-gate void s_unload_system ( char * , MESG * ); 707c478bd9Sstevel@tonic-gate void s_unload_user_file ( char * , MESG * ); 717c478bd9Sstevel@tonic-gate void s_unmount ( char * , MESG * ); 727c478bd9Sstevel@tonic-gate void r_new_child ( char * , MESG * ); 737c478bd9Sstevel@tonic-gate void r_send_job ( char * , MESG * ); 747c478bd9Sstevel@tonic-gate void s_job_completed ( char * , MESG * ); 757c478bd9Sstevel@tonic-gate void s_child_done ( char * , MESG * ); 767c478bd9Sstevel@tonic-gate void s_get_fault_message ( char * , MESG * ); 777c478bd9Sstevel@tonic-gate void s_max_trays ( char * , MESG *); 787c478bd9Sstevel@tonic-gate void s_mount_tray ( char *, MESG * ); 797c478bd9Sstevel@tonic-gate void s_unmount_tray ( char *, MESG *); 807c478bd9Sstevel@tonic-gate void s_paper_changed ( char *, MESG *); 817c478bd9Sstevel@tonic-gate void s_paper_allowed ( char *, MESG *); 82*45916cd2Sjpk void s_pass_peer_connection ( char * , MESG * ); 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate /** 857c478bd9Sstevel@tonic-gate ** dispatch_table[] 867c478bd9Sstevel@tonic-gate **/ 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate /* 897c478bd9Sstevel@tonic-gate * The dispatch table is used to decide if we should handle 907c478bd9Sstevel@tonic-gate * a message and which function should be used to handle it. 917c478bd9Sstevel@tonic-gate * 927c478bd9Sstevel@tonic-gate * D_ADMIN is set for messages that should be handled 937c478bd9Sstevel@tonic-gate * only if it came from an administrator. These entries should 947c478bd9Sstevel@tonic-gate * have a corresponding entry for the R_... message case, that 957c478bd9Sstevel@tonic-gate * provides a routine for sending back a MNOPERM message to those 967c478bd9Sstevel@tonic-gate * that aren't administrators. This is needed because the response 977c478bd9Sstevel@tonic-gate * message varies in size with the message type. 987c478bd9Sstevel@tonic-gate */ 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate typedef struct DISPATCH { 1017c478bd9Sstevel@tonic-gate void (*fncp)(); 1027c478bd9Sstevel@tonic-gate ushort flags; 1037c478bd9Sstevel@tonic-gate } DISPATCH; 1047c478bd9Sstevel@tonic-gate 1057c478bd9Sstevel@tonic-gate #define D_ADMIN 0x01 /* Only "lp" or "root" can use msg. */ 1067c478bd9Sstevel@tonic-gate #define D_BADMSG 0x02 /* We should never get this message */ 1077c478bd9Sstevel@tonic-gate #define D_SYSTEM 0x04 /* Only siblings may use this message */ 108