home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-03 | 15.5 KB | 454 lines | [TEXT/MPS ] |
- //234567890123456789012345678901234567890123456789012345678901234567890123456789
- //===========================================================================
- // File: SecurityInterface.h
- //
- // This file is the header file which a third party security vendor can
- // use to create an add-on security module. The add-on security modules
- // can be used to integrate a security device with Apple Remote Access.
- //
- // Copyright © 1992, 1993 Apple Computer Inc.
- // All rights reserved
- //
- // Author: Farzad Sarabi
- //
- // Modification history:
- //
- // 9/29/1993 Farzad Removed declarations for some routines that were
- // obsolete.
- // 2/15/1993 Farzad The A5 world and a working environment is now
- // setup for the security modules. As a result of
- // this some of the routines in this module are
- // obsolete. Among these are ARAGet/SetMyPrivateData,
- // ARAGetMyResFile.
- // 10/6/1992 Farzad Created
- //===========================================================================
-
-
- #ifndef SECURITY_INTERFACE
- #define SECURITY_INTERFACE 1
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
-
- #ifndef SECURITY_PUBLIC
- #include "SecurityPublic.h"
- #endif
-
-
- //===========================================================================
- // Macros
- //===========================================================================
-
- #define kSecurityInterfaceVersion 0x0100 // 0x0100 will be release 1
-
-
- #ifdef __cplusplus
- extern "C" { // in case we are linking into C++ code
- #endif
-
-
-
- //===========================================================================
- // Types
- //===========================================================================
-
- // actions are defined in the SecurityPublic.h file
- // ARAErr is defined in SecurityPublic.h
- // SecurityEntryProc is defined in SecurityPublic.h
- // SecurityCompletionProc is defined in SecurityPublic.h
-
- //===========================================================================
- // Data
- //===========================================================================
-
-
- //===========================================================================
- // Functions
- //===========================================================================
-
- // the following are functions you can call to have AppleTalk Remote Access
- // perform these services
-
-
-
- extern pascal ARAErr ARARead( SecurityReference MyReference,
- void * DataPtr,
- int DataSize,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: this routine is used to post an asynchronous read
- // operation for data coming from the remote machine.
- // This routine can be used by line-level and protocol-level
- // authentication modules. It is not available for
- // configuration modules.
- //
- // Parameters: MyReference this module's unique reference
- // DataPtr where to put the read data
- // DataSize the maximum number of bytes to read
- // CompletionProc this routine will be called when the
- // read request has finished
- // CompletionParam this is information you can provide to
- // be passed to the completion proc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARAWrite( SecurityReference MyReference,
- void * DataPtr,
- int DataSize,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: this routine is used to asynchronously write data to
- // the remote machine. It can be used by line-level and
- // protocol-level authentication modules.
- //
- // Parameters: MyReference your unique reference
- // DataPtr the data to be written out
- // DataSize the amount of data to write
- // CompletionProc this routine is called when the data
- // has been written out
- // CompletionParam this is extra information you can provide
- // to be passed to the CompletionProc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARALogMessage( SecurityReference MyReference,
- char * Message,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: you can use this routine to put a message in AppleTalk
- // remote accesses log file.
- //
- // Parameters: MyReference your unique reference
- // Message a Pascal string which will be logged to
- // in the log file
- // CompletionProc this routine will be called when the
- // log message has been completed.
- // CompletionParam additional information you can supply to
- // be passed on to the completion proc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARACallBackAt( SecurityReference MyReference,
- char * DialString,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: this routine can be used during authentication to
- // cause the server to call the client back at the
- // specified number.
- //
- // Parameters: MyReference your unique reference
- // DialString this is a pascal string which must
- // contain a dial string for the number
- // to call the client back at
- // CompletionProc this proc will be called when the callback
- // has been completed.
- // CompletionParam additional information you can provide
- // that will be passed to the CompletionProc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARAAllowUser( SecurityReference MyReference,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: the authentication code on the server can call this
- // routine to indicate the user has passed this module's
- // security requirements.
- //
- // Parameters: MyReference your unique reference
- // CompletionProc this routine is called when AppleTalk
- // Remote Access has finished handling
- // your authentication information.
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARADontAllowUser( SecurityReference MyReference,
- char * Message,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: the server security module can call this routine to
- // prevent a user from being allowed in.
- //
- // Parameters: MyReference your unique reference
- // Message a pascal string stating why the user
- // was not allowed access
- // CompletionProc this routine will be called when the
- // request for not allowing user has bee
- // processed
- // CompletionParam additional information you can provide
- // which will be passed to the completion
- // proc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
-
- extern pascal ARAErr ARAReadSecurityData( SecurityReference MyReference,
- void * DataPtr,
- int DataSize,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: this routine can be used to read data for this security
- // module which is associated with either a user (on the
- // server side), or a connection (on the client side).
- // This routine doesn't lock the data, so use it only when
- // you just plan to read the data.
- //
- // Parameters: MyReference your unique reference
- // DataPtr where the data will be read to
- // DataSize maximum number of bytes to read
- // CompletionProc this routine will be called when the
- // read request has completed
- // CompletionParam additional information you can provide
- // to be passed to the completion proc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARAReadLockSecurityData( SecurityReference MyReference,
- void * DataPtr,
- int DataSize,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: this routine can be used to read security data and lock
- // it to be modified. If you are planning on modifying your
- // data and then writing it, you must call this routine.
- // It locks the data until the a ARAUnlockSecurityData call.
- //
- // Parameters: MyReference your unique reference
- // DataPtr where the data will be read
- // DataSize the maximum number of bytes to read
- // CompletionProc this routine will be called when the
- // data is read into your buffer.
- // CompletionParam additional information you can provide to
- // be passed on to the CompletionProc.
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/29/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
-
- extern pascal ARAErr ARAUnlockSecurityData( SecurityReference MyReference,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: if you have read the security data with ARAReadLockSecurityData
- // you must call this routine to unlock the data. After this
- // call others can then lock the security data.
- //
- // Parameters: MyReference your unique reference
- // CompletionProc this routine is called when the data is unlocked
- // CompletionParam additiona information you can provide to be
- // passed to the CompletionProc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/29/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARAWriteSecurityData( SecurityReference MyReference,
- void * DataPtr,
- int DataSize,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: this routine can be used by the module to write private
- // data which is either associated with a user (on the server
- // side), or a connection (on the client side).
- //
- // Parameters: MyReference your unique reference
- // DataPtr the data to be written out
- // DataSize the amount of data to write out
- // CompletionProc this routine is called when AppleTalk
- // Remote Access has completed the write
- // operation
- // CompletionParam additional information you can provide
- // which is passed to the completion proc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARAGetUserInfo( SecurityReference MyReference,
- void * DataPtr,
- int DataSize,
- SecurityCompletionProc CompletionProc,
- long CompletionParam );
- //===========================================================================
- // Description: this routine can be called to get information about the
- // the user, such as user name etc. It is an asynchronous
- // call.
- //
- // Parameters: MyReference your unique code reference
- // DataPtr pointer to where the user's name (Pascal
- // string) will be stored
- // DataSize maximum number of bytes to read
- // CompletionProc this routine will be called when the call
- // has completed
- // CompletionParam additional information to be passed to
- // the CompletionProc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
-
- extern pascal long ARAGetMySessionRef( SecurityReference MyReference );
- //===========================================================================
- // Description: You can call this routine to obtain the session reference
- // for the connection for which your code is loaded. This
- // value is unique and stays the same during the connection.
- // If you have a security module which has both a line-level
- // and a protocol-level authentication, you can use this
- // unique reference as a key to communicate between the
- // code resources.
- //
- // Parameters: MyReference this is your code's unique reference
- //
- // Return Value: long the session reference, NULL if there is an
- // error
- //
- // Creation Date: 10/29/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
-
- extern pascal ARAErr ARATickleMe( SecurityReference MyReference,
- long TickleParam );
- //===========================================================================
- // Description: this routine can be used to have AppleTalk Remote Access
- // call your entry routine with a kSecurityTickleAction.
- // You can also provide some additional information which
- // is passed to the entry routine.
- //
- // Parameters: MyReference your unique reference
- // TickleParam additional information you can provide
- // which is passed to the entry proc
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- extern pascal ARAErr ARACompleteOperation( SecurityReference MyReference );
- //===========================================================================
- // Description: this routine can be called to terminate an operation.
- // It causes ARA to send a kSecurityEnd action. During
- // configuration for example the code resource can call
- // this routine to indicate that configuration has
- // completed.
- //
- // Parameters: MyReference your unique reference
- //
- // Return Value: ARAErr result code, nonzero indicates an error
- //
- // Creation Date: 10/6/1992
- //
- // Modifications:
- //
- //===========================================================================
-
-
-
- #ifdef __cplusplus
- }
- #endif
-
-
- #endif // SECURITY_INTERFACE
-