-- CHACLOpsP127V1ServerImpl.Mesa
-- Copyright Ó 1991 by Xerox Corporation. All rights reserved.
 -- Copyright (C) 1986 by Xerox Corporation. All rights reserved.
 -- Generated by Demers.pa at February 11, 1987 8:00:11 pm PST
 -- using Sirocco [2.0] of January 31, 1987 1:52:42 am PST

DIRECTORY
 CrRPC,
 CHNameP2V0,
 AuthenticationP14V2,
 CHOpsP2V3,
 BulkDataP0V1,
 CHACLOpsP127V1;

CHACLOpsP127V1ServerImpl: CEDAR PROGRAM
 IMPORTS CrRPC, CHACLOpsP127V1 ~ {
 OPEN CHACLOpsP127V1;

IsInDomainACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 domain: CHNameP2V0.TwoPartName;
 acl: AccessList;
 secondaryProperty: CARD32;
 member: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;
 inACL: BOOLEAN;

 {
  domain.organization ¬ CrRPC.GetRope[s];
  domain.domain ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  secondaryProperty ¬ CrRPC.GetCard32[s];
  };
 {
  member.organization ¬ CrRPC.GetRope[s];
  member.domain ¬ CrRPC.GetRope[s];
  member.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [inACL] ¬ IsInDomainACL[h, domain, acl, secondaryProperty, member, agent];

 beginReturn[h];

 {
  CrRPC.PutBool[s, inACL];
  };
 };

AddMemberToPropertyACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 name: CHNameP2V0.ThreePartName;
 property: CARD32;
 acl: AccessList;
 newMember: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;
 distinguishedObject: CHNameP2V0.ThreePartName;

 {
  name.organization ¬ CrRPC.GetRope[s];
  name.domain ¬ CrRPC.GetRope[s];
  name.object ¬ CrRPC.GetRope[s];
  };
 {
  property ¬ CrRPC.GetCard32[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  newMember.organization ¬ CrRPC.GetRope[s];
  newMember.domain ¬ CrRPC.GetRope[s];
  newMember.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [distinguishedObject] ¬ AddMemberToPropertyACL[h, name, property, acl, newMember, agent];

 beginReturn[h];

 {
  CrRPC.PutRope[s, distinguishedObject.organization];
  CrRPC.PutRope[s, distinguishedObject.domain];
  CrRPC.PutRope[s, distinguishedObject.object];
  };
 };

RetrievePropertyACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 name: CHNameP2V0.ThreePartName;
 property: CARD32;
 acl: AccessList;
 membership: CrRPC.BulkDataSink;
 agent: CHOpsP2V3.Authenticator;
 distinguishedObject: CHNameP2V0.ThreePartName;

 {
  name.organization ¬ CrRPC.GetRope[s];
  name.domain ¬ CrRPC.GetRope[s];
  name.object ¬ CrRPC.GetRope[s];
  };
 {
  property ¬ CrRPC.GetCard32[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 TRUSTED {
  membership ¬ CrRPC.GetBulkDataSink[h, s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [distinguishedObject] ¬ RetrievePropertyACL[h, name, property, acl, membership, agent];

 beginReturn[h];

 {
  CrRPC.PutRope[s, distinguishedObject.organization];
  CrRPC.PutRope[s, distinguishedObject.domain];
  CrRPC.PutRope[s, distinguishedObject.object];
  };
 };

IsInPropertyACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 name: CHNameP2V0.ThreePartName;
 property: CARD32;
 acl: AccessList;
 secondaryProperty: CARD32;
 member: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;
 inACL: BOOLEAN;
 distinguishedObject: CHNameP2V0.ThreePartName;

 {
  name.organization ¬ CrRPC.GetRope[s];
  name.domain ¬ CrRPC.GetRope[s];
  name.object ¬ CrRPC.GetRope[s];
  };
 {
  property ¬ CrRPC.GetCard32[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  secondaryProperty ¬ CrRPC.GetCard32[s];
  };
 {
  member.organization ¬ CrRPC.GetRope[s];
  member.domain ¬ CrRPC.GetRope[s];
  member.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [inACL, distinguishedObject] ¬ IsInPropertyACL[h, name, property, acl, secondaryProperty, member, agent];

 beginReturn[h];

 {
  CrRPC.PutBool[s, inACL];
  };
 {
  CrRPC.PutRope[s, distinguishedObject.organization];
  CrRPC.PutRope[s, distinguishedObject.domain];
  CrRPC.PutRope[s, distinguishedObject.object];
  };
 };

RetrieveOrganizationACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 organization: ROPE;
 acl: AccessList;
 membership: CrRPC.BulkDataSink;
 agent: CHOpsP2V3.Authenticator;

 {
  organization ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 TRUSTED {
  membership ¬ CrRPC.GetBulkDataSink[h, s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [] ¬ RetrieveOrganizationACL[h, organization, acl, membership, agent];

 beginReturn[h];

 };

DeleteMemberFromOrganizationACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 organization: ROPE;
 acl: AccessList;
 member: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;

 {
  organization ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  member.organization ¬ CrRPC.GetRope[s];
  member.domain ¬ CrRPC.GetRope[s];
  member.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [] ¬ DeleteMemberFromOrganizationACL[h, organization, acl, member, agent];

 beginReturn[h];

 };

AddMemberToDomainACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 domain: CHNameP2V0.TwoPartName;
 acl: AccessList;
 newMember: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;

 {
  domain.organization ¬ CrRPC.GetRope[s];
  domain.domain ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  newMember.organization ¬ CrRPC.GetRope[s];
  newMember.domain ¬ CrRPC.GetRope[s];
  newMember.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [] ¬ AddMemberToDomainACL[h, domain, acl, newMember, agent];

 beginReturn[h];

 };

DeleteMemberFromDomainACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 domain: CHNameP2V0.TwoPartName;
 acl: AccessList;
 member: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;

 {
  domain.organization ¬ CrRPC.GetRope[s];
  domain.domain ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  member.organization ¬ CrRPC.GetRope[s];
  member.domain ¬ CrRPC.GetRope[s];
  member.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [] ¬ DeleteMemberFromDomainACL[h, domain, acl, member, agent];

 beginReturn[h];

 };

RetrieveDomainACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 domain: CHNameP2V0.TwoPartName;
 acl: AccessList;
 membership: CrRPC.BulkDataSink;
 agent: CHOpsP2V3.Authenticator;
 distinguishedObject: CHNameP2V0.ThreePartName;

 {
  domain.organization ¬ CrRPC.GetRope[s];
  domain.domain ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 TRUSTED {
  membership ¬ CrRPC.GetBulkDataSink[h, s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [distinguishedObject] ¬ RetrieveDomainACL[h, domain, acl, membership, agent];

 beginReturn[h];

 {
  CrRPC.PutRope[s, distinguishedObject.organization];
  CrRPC.PutRope[s, distinguishedObject.domain];
  CrRPC.PutRope[s, distinguishedObject.object];
  };
 };

IsInOrganizationACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 organization: ROPE;
 acl: AccessList;
 secondaryProperty: CARD32;
 member: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;
 inACL: BOOLEAN;

 {
  organization ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  secondaryProperty ¬ CrRPC.GetCard32[s];
  };
 {
  member.organization ¬ CrRPC.GetRope[s];
  member.domain ¬ CrRPC.GetRope[s];
  member.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [inACL] ¬ IsInOrganizationACL[h, organization, acl, secondaryProperty, member, agent];

 beginReturn[h];

 {
  CrRPC.PutBool[s, inACL];
  };
 };

DeleteMemberFromPropertyACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 name: CHNameP2V0.ThreePartName;
 property: CARD32;
 acl: AccessList;
 member: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;
 distinguishedObject: CHNameP2V0.ThreePartName;

 {
  name.organization ¬ CrRPC.GetRope[s];
  name.domain ¬ CrRPC.GetRope[s];
  name.object ¬ CrRPC.GetRope[s];
  };
 {
  property ¬ CrRPC.GetCard32[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  member.organization ¬ CrRPC.GetRope[s];
  member.domain ¬ CrRPC.GetRope[s];
  member.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [distinguishedObject] ¬ DeleteMemberFromPropertyACL[h, name, property, acl, member, agent];

 beginReturn[h];

 {
  CrRPC.PutRope[s, distinguishedObject.organization];
  CrRPC.PutRope[s, distinguishedObject.domain];
  CrRPC.PutRope[s, distinguishedObject.object];
  };
 };

AddMemberToOrganizationACLCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
 organization: ROPE;
 acl: AccessList;
 newMember: CHNameP2V0.ThreePartName;
 agent: CHOpsP2V3.Authenticator;

 {
  organization ¬ CrRPC.GetRope[s];
  };
 {
  acl ¬ VAL[CrRPC.GetCard16[s]];
  };
 {
  newMember.organization ¬ CrRPC.GetRope[s];
  newMember.domain ¬ CrRPC.GetRope[s];
  newMember.object ¬ CrRPC.GetRope[s];
  };
 {
  agent.credentials.type ¬ VAL[CrRPC.GetCard16[s]];
  agent.credentials.value ¬ UProc3[h, s];
  agent.verifier ¬ UProc3[h, s];
  };

 [] ¬ AddMemberToOrganizationACL[h, organization, acl, newMember, agent];

 beginReturn[h];

 };

Server: CrRPC.ServerProc ~ {
 -- [h: Handle, s: STREAM, pgm: CARD32, pgmVersion: CARD16, proc: CARD16, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc]

 ENABLE {
  CHACLOpsP127V1.PropertyError => { -- (3 )
   beginError[h, 3 ];
   CrRPC.PutCard16[s, ORD[problem]];
   CrRPC.PutRope[s, distinguishedObject.organization];
   CrRPC.PutRope[s, distinguishedObject.domain];
   CrRPC.PutRope[s, distinguishedObject.object];
   GOTO Finished;
   };
  CHACLOpsP127V1.ArgumentError => { -- (2 )
   beginError[h, 2 ];
   CrRPC.PutCard16[s, ORD[problem]];
   CrRPC.PutCard16[s, ORD[which]];
   GOTO Finished;
   };
  CHACLOpsP127V1.CallError => { -- (1 )
   beginError[h, 1 ];
   CrRPC.PutCard16[s, ORD[problem]];
   GOTO Finished;
   };
  CHACLOpsP127V1.UpdateError => { -- (4 )
   beginError[h, 4 ];
   CrRPC.PutCard16[s, ORD[problem]];
   CrRPC.PutBool[s, found];
   CrRPC.PutCard16[s, ORD[which]];
   CrRPC.PutRope[s, distinguishedObject.organization];
   CrRPC.PutRope[s, distinguishedObject.domain];
   CrRPC.PutRope[s, distinguishedObject.object];
   GOTO Finished;
   };
  CHACLOpsP127V1.ListNotFound => { -- (7 )
   beginError[h, 7 ];
   GOTO Finished;
   };
  CHACLOpsP127V1.AuthenticationError => { -- (6 )
   beginError[h, 6 ];
   CrRPC.PutCard16[s, ORD[problem]];
   GOTO Finished;
   };
  CHACLOpsP127V1.WrongServer => { -- (5 )
   beginError[h, 5 ];
   CrRPC.PutRope[s, hint.organization];
   CrRPC.PutRope[s, hint.domain];
   CrRPC.PutRope[s, hint.object];
   GOTO Finished;
   };
  };

 IF (pgmVersion # 1) THEN {
  beginReject[h, CrRPC.noSuchVersion];
  CrRPC.PutCard16[s, 1]; --low
  CrRPC.PutCard16[s, 1]; --high
  RETURN
  };

 SELECT proc FROM
  37 => IsInDomainACLCaller[h, s, beginReturn];
  31 => AddMemberToPropertyACLCaller[h, s, beginReturn];
  30 => RetrievePropertyACLCaller[h, s, beginReturn];
  33 => IsInPropertyACLCaller[h, s, beginReturn];
  38 => RetrieveOrganizationACLCaller[h, s, beginReturn];
  40 => DeleteMemberFromOrganizationACLCaller[h, s, beginReturn];
  35 => AddMemberToDomainACLCaller[h, s, beginReturn];
  36 => DeleteMemberFromDomainACLCaller[h, s, beginReturn];
  34 => RetrieveDomainACLCaller[h, s, beginReturn];
  41 => IsInOrganizationACLCaller[h, s, beginReturn];
  32 => DeleteMemberFromPropertyACLCaller[h, s, beginReturn];
  39 => AddMemberToOrganizationACLCaller[h, s, beginReturn];
  ENDCASE => {
   beginReject[h, CrRPC.noSuchProcedure];
   };

 EXITS
  Finished => { NULL };
 };

 -- Unmarshal / Marshal Procs --
  
  
  UProc3: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: AuthenticationP14V2.SeqWords] ~ {
   {
    length5: CARDINAL ~ CrRPC.GetCard16[s];
    res ¬ NEW[AuthenticationP14V2.SeqWordsObject[length5]];
    FOR i4: CARDINAL IN [0..length5) DO
     res.body[i4] ¬ CrRPC.GetCard16[s];
     ENDLOOP;
    };
   };
  

 CrRPC.RegisterServerProc[pgm~127, serverProc~Server, pgmVersion~1];
 CrRPC.EnsureListener[class~$SPP];
}...