/* MiG type declarations for Hurd interfaces -*- C -*- Copyright (C) 1993,94,95,96,98,2001,02 Free Software Foundation, Inc. This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. The GNU Hurd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU Hurd; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HURD_SERVER /* The Hurd uses protected payloads to quickly look up the object receiving a message. Looking up objects is optimized at the cost of having to translate payloads back to port names if the server function expect a port name rather than an object. Support for this is implemented in libports. Almost all of Hurd's servers use libports. For servers using libports, the optimized lookup is completely transparent. Servers not using libports are not using protected payloads automatically. Define HURD_DEFAULT_PAYLOAD_TO_PORT to 1 (1 like the identity function) for programs not using libports to avoid injecting the default payload-to-port translation function which is in libports. If you want to use protected payloads without libports, you can use HURD_DEFAULT_PAYLOAD_TO_PORT to inject a custom translation function. */ #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT #if HURD_DEFAULT_PAYLOAD_TO_PORT /* Any non-numeric value will fail this test. If 1 (or any number) is given, do not inject the default translator function. */ #undef HURD_DEFAULT_PAYLOAD_TO_PORT #endif #else import ; #define HURD_DEFAULT_PAYLOAD_TO_PORT ports_payload_get_name #endif /* Override the mach_port_t. Use the default payload to port translation function to convert payloads back to port names for this type. */ #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT #define MACH_PAYLOAD_TO_PORT HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif /* HURD_SERVER */ #include #include #include /* The Hurd types. You can inject translation functions for type X using the X_INTRAN, X_INTRAN_PAYLOAD, X_OUTTRAN, and X_DESTRUCTOR. If you define X_INTRAN and your server is using libports, you also have to define X_INTRAN_PAYLOAD. If you do not use libports, and do not want to use the protected payload mechanism, but you do want to use X_INTRAN, you must provide a X_INTRAN_PAYLOAD that either ignores the message by returning NULL, or indicates an error condition in some appropriate way. If you do want to use the protected payload mechanism, make sure you also define an appropriate HURD_DEFAULT_PAYLOAD_TO_PORT translation function. */ type file_t = mach_port_copy_send_t #ifdef FILE_INTRAN intran: FILE_INTRAN intranpayload: FILE_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: file_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef FILE_OUTTRAN outtran: FILE_OUTTRAN #endif #ifdef FILE_DESTRUCTOR destructor: FILE_DESTRUCTOR #endif ; type fsys_t = mach_port_copy_send_t #ifdef FSYS_INTRAN intran: FSYS_INTRAN intranpayload: FSYS_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: fsys_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef FSYS_OUTTRAN outtran: FSYS_OUTTRAN #endif #ifdef FSYS_DESTRUCTOR destructor: FSYS_DESTRUCTOR #endif ; type io_t = mach_port_copy_send_t #ifdef IO_INTRAN intran: IO_INTRAN intranpayload: IO_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: io_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef IO_OUTTRAN outtran: IO_OUTTRAN #endif #ifdef IO_DESTRUCTOR destructor: IO_DESTRUCTOR #endif ; type process_t = mach_port_copy_send_t #ifdef PROCESS_INTRAN intran: PROCESS_INTRAN intranpayload: PROCESS_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: process_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef PROCESS_OUTTRAN outtran: PROCESS_OUTTRAN #endif #ifdef PROCESS_DESTRUCTOR destructor: PROCESS_DESTRUCTOR #endif ; type auth_t = mach_port_copy_send_t #ifdef AUTH_INTRAN intran: AUTH_INTRAN intranpayload: AUTH_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: auth_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef AUTH_OUTTRAN outtran: AUTH_OUTTRAN #endif #ifdef AUTH_DESTRUCTOR destructor: AUTH_DESTRUCTOR #endif ; type socket_t = mach_port_copy_send_t #ifdef SOCKET_INTRAN intran: SOCKET_INTRAN intranpayload: SOCKET_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: socket_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef SOCKET_OUTTRAN outtran: SOCKET_OUTTRAN #endif #ifdef SOCKET_DESTRUCTOR destructor: SOCKET_DESTRUCTOR #endif ; /* Protocol family */ type pf_t = mach_port_copy_send_t #ifdef PF_INTRAN intran: PF_INTRAN intranpayload: PF_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: pf_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef PF_OUTTRAN outtran: PF_OUTTRAN #endif #ifdef PF_DESTRUCTOR destructor: PF_DESTRUCTOR #endif ; type addr_port_t = mach_port_copy_send_t #ifdef ADDRPORT_INTRAN intran: ADDRPORT_INTRAN intranpayload: ADDRPORT_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: addr_port_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef ADDRPORT_OUTTRAN outtran: ADDRPORT_OUTTRAN #endif #ifdef ADDRPORT_DESTRUCTOR destructor: ADDRPORT_DESTRUCTOR #endif ; type term_t = mach_port_copy_send_t #ifdef TERM_INTRAN intran: TERM_INTRAN intranpayload: TERM_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: term_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef TERM_OUTTRAN outtran: TERM_OUTTRAN #endif #ifdef TERM_DESTRUCTOR destructor: TERM_DESTRUCTOR #endif ; type startup_t = mach_port_copy_send_t #ifdef STARTUP_INTRAN intran: STARTUP_INTRAN intranpayload: STARTUP_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: startup_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef STARTUP_OUTTRAN outtran: STARTUP_OUTTRAN #endif #ifdef STARTUP_DESTRUCTOR destructor: STARTUP_DESTRUCTOR #endif ; type fs_notify_t = mach_port_copy_send_t #ifdef FS_NOTIFY_INTRAN intran: FS_NOTIFY_INTRAN intranpayload: FS_NOTIFY_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: fs_notify_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef FS_NOTIFY_OUTTRAN outtran: FS_NOTIFY_OUTTRAN #endif #ifdef FS_NOTIFY_DESTRUCTOR destructor: FS_NOTIFY_DESTRUCTOR #endif ; type exec_startup_t = mach_port_copy_send_t #ifdef EXEC_STARTUP_INTRAN intran: EXEC_STARTUP_INTRAN intranpayload: EXEC_STARTUP_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: exec_startup_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef EXEC_STARTUP_OUTTRAN outtran: EXEC_STARTUP_OUTTRAN #endif #ifdef EXEC_STARTUP_DESTRUCTOR destructor: EXEC_STARTUP_DESTRUCTOR #endif ; type interrupt_t = mach_port_copy_send_t #ifdef INTERRUPT_INTRAN intran: INTERRUPT_INTRAN intranpayload: INTERRUPT_INTRAN_PAYLOAD #else #ifdef HURD_DEFAULT_PAYLOAD_TO_PORT intranpayload: interrupt_t HURD_DEFAULT_PAYLOAD_TO_PORT #endif #endif #ifdef INTERRUPT_OUTTRAN outtran: INTERRUPT_OUTTRAN #endif #ifdef INTERRUPT_DESTRUCTOR destructor: INTERRUPT_DESTRUCTOR #endif ; type proccoll_t = mach_port_copy_send_t; type sreply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic ctype: mach_port_t #ifdef MACH_PAYLOAD_TO_PORT intranpayload: mach_port_t MACH_PAYLOAD_TO_PORT #endif /* MACH_PAYLOAD_TO_PORT */ ; /* These macros are used in some .defs files so that every routine has a server reply port argument #ifdef REPLY_PORTS. */ #ifdef REPLY_PORTS #define RPTDECL sreplyport reply: sreply_port_t #define RPT RPTDECL; #define RPTLAST ; RPTDECL #else #define RPTLAST #define RPT #endif /* This macros are used in some .defs files so that every out data_t (or equivalent) has a servercopy keyword #ifdef SERVERCOPY. */ #ifdef SERVERCOPY #define SCP , servercopy #else #define SCP #endif #ifdef HAVE_MIG_RETCODE #define RETURN_CODE_ARG in return_code: kern_return_t, retcode #else #define RETURN_CODE_ARG in return_code: kern_return_t #endif #ifdef USERPREFIX userprefix USERPREFIX; #endif #ifdef SERVERPREFIX serverprefix SERVERPREFIX; #endif /* RPC interfaces which are interrupt compliant (see interrupt.defs) should put ``INTR_INTERFACE'' at the beginning of their .defs file. */ #ifndef INTR_INTERFACE #define INTR_INTERFACE /* Nothing special. */ #endif type data_t = array[] of char; type string_t = c_string[1024]; /* XXX */ type io_statbuf_t = struct[32] of int; type uid_t = uint32_t; type gid_t = uint32_t; type mode_t = uint32_t; type retry_type = uint32_t; type pid_t = int32_t; type wait_status_t = int32_t; type loff_t = int64_t; type ino64_t = int64_t; type file_changed_type_t = uint32_t; type dir_changed_type_t = uint32_t; type portarray_t = array[] of mach_port_send_t; type intarray_t = array[] of int; type off_array_t = array[] of loff_t; type pidarray_t = array[] of pid_t; type procinfo_t = array[] of int; type fsys_statfsbuf_t=struct[22] of int; type idarray_t = array[] of uid_t; type rusage_t = struct[18] of int; /* XXX */ type flock_t = struct[5] of int; type timespec_t = struct[2] of int; #define _SYS_UTSNAME_H /* Inhibit warning from . */ #include type utsname_t = struct[5 * _UTSNAME_LENGTH] of char; import ; import ; import ; import ; import ; import ;