home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Apple Remote Access API / ARA Security API 1.0 / Sample Protocol Module / SamplePackets.h < prev    next >
Encoding:
Text File  |  1993-11-04  |  1.8 KB  |  73 lines  |  [TEXT/MPS ]

  1. //234567890123456789012345678901234567890123456789012345678901234567890123456789
  2. //===========================================================================
  3. //    File:    SamplePackets.h
  4. //
  5. //    This header file has the definitions for the packets that are exchanged
  6. //    by the sample server/client add-on security code resources for Apple
  7. //    Remote Access.  These packets are exchanged during the authentication
  8. //    process.
  9. //
  10. //    Copyright © 1992, 1993 Apple Computer Inc.
  11. //    All rights reserved
  12. //
  13. //    Author:  Farzad Sarabi
  14. //
  15. //    Modification history:
  16. //
  17. //===========================================================================
  18.  
  19. #ifndef SAMPLE_PACKETS
  20. #define SAMPLE_PACKETS 1
  21.  
  22.  
  23. //===========================================================================
  24. //    Macros
  25. //===========================================================================
  26.  
  27.  
  28.  
  29. //===========================================================================
  30. //    Types
  31. //===========================================================================
  32.  
  33. // these are the packet types that are exchanged by the client and server
  34. typedef enum
  35. {
  36.     kPktRequestPassword,    // sent from the server to display password dialog
  37.                             // on the client side
  38.     kPktPasswordResponse,    // sent by the client to return the user password
  39.     kPktCancel,                // sent by either side to make other side cancel
  40.                             // also sent to not allow the user in
  41.     kPktAllow                // sent by the server to indicate the user was
  42.                             // authenticated
  43. } TSamplePacketTypes;
  44.  
  45.  
  46. typedef struct
  47. {
  48.     char            fpassword[ kSecurityMaxConfigData ];
  49. } TPasswordResponse;
  50.  
  51.  
  52. typedef struct
  53. {
  54.     char            fmsg[ 128 ];
  55. } TCancelReason;
  56.  
  57.  
  58. typedef struct
  59. {
  60.     TSamplePacketTypes        fpkt_type;        // this packet's type
  61.  
  62.     union
  63.     {
  64.         TPasswordResponse    fresponse;        // used for a password response
  65.         TCancelReason        freason;        // used for a cancel packet
  66.     } u;
  67.  
  68. } TSamplePacket;
  69.  
  70.  
  71.  
  72.  
  73. #endif // SAMPLE_PACKETS