home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / usr / include / mach / mig.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-30  |  2.6 KB  |  78 lines

  1. /*
  2.  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  3.  *
  4.  * @APPLE_LICENSE_HEADER_START@
  5.  * 
  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.
  11.  * 
  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
  18.  * under the License.
  19.  * 
  20.  * @APPLE_LICENSE_HEADER_END@
  21.  */
  22. /*
  23.  * @OSF_COPYRIGHT@
  24.  */
  25.  
  26. /*
  27.  * Mach MIG Subsystem Interfaces
  28.  */
  29.  
  30. #ifndef    _MACH_MIG_H_
  31. #define _MACH_MIG_H_
  32.  
  33. #include <mach/port.h>
  34. #include <mach/message.h>
  35. #include <mach/kern_return.h>
  36.  
  37. /*
  38.  * Definition for MIG-generated server stub routines.  These routines
  39.  * unpack the request message, call the server procedure, and pack the
  40.  * reply message.
  41.  */
  42. typedef void    (*mig_stub_routine_t) (mach_msg_header_t *InHeadP,
  43.                        mach_msg_header_t *OutHeadP);
  44.  
  45. typedef mig_stub_routine_t mig_routine_t;
  46.  
  47. /*
  48.  * Definition for MIG-generated server routine.  This routine takes a
  49.  * message, and returns the appropriate stub function for handling that
  50.  * message.
  51.  */
  52. typedef mig_routine_t (*mig_server_routine_t) (mach_msg_header_t *InHeadP);
  53.  
  54. /*
  55.  * Generic definition for implementation routines.  These routines do
  56.  * the real work associated with this request.  This generic type is
  57.  * used for keeping the pointers in the subsystem array.
  58.  */
  59. typedef kern_return_t   (*mig_impl_routine_t)(void);
  60.  
  61. typedef struct mig_routine_descriptor {
  62.     mig_stub_routine_t     stub_routine;    /* Unmarshalling function   */
  63.     mach_msg_size_t         max_reply_msg; /* Max size for this reply  */
  64. } mig_routine_descriptor;
  65. typedef mig_routine_descriptor  *mig_routine_descriptor_t;
  66.  
  67. typedef struct mig_subsystem {
  68.     mig_server_routine_t     server;    /* server routine        */
  69.     mach_msg_id_t         start;        /* Min routine number        */
  70.     mach_msg_id_t         end;        /* Max routine number + 1   */
  71.     mach_msg_size_t         max_reply;    /* Max reply message size   */
  72.     mach_msg_size_t         max_request;    /* Max request msg size     */
  73.     mig_routine_descriptor   routine[1];    /* Routine descriptor array */
  74. } *mig_subsystem_t;
  75.  
  76.  
  77. #endif /* _MACH_MIG_H_ */
  78.