CashDeskSystem.secarc 977 Bytes
Newer Older
Bernhard Rumpe's avatar
BR-sy  
Bernhard Rumpe committed
1
/* (c) https://github.com/MontiCore/monticore */
Paff's avatar
Paff committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
package secarc.seccdsE;

// import message types
import secarc.seccdsE.msg.*;

component CashDeskSystem {

	accesscontrol off;

	trustlevel +0;

	autoconnect port;
		
	port 
		in CardData,
		out boolean validation;

	component CashDesk cashDesk {
		trustlevel +1;
		
		autoconnect port;
	
		port 
			in CardData,
			out BankData bdOut,
			in PaymentAck paIn,
			out boolean validation;
			
			component CashDeskCard cashDeskCard {
				port 
					in CardData,
					out BankData bdOut;
			}
			
			component CashDeskValidation cashDeskValidation {
				port 
					in PaymentAck paIn,
					out boolean validation;
			}
			
			connect encrypted cashDeskCard.bdOut -> bdOut;
			connect paIn -> cashDeskValidation.paIn;
	}
	
	component Bank bank {
		trustlevel +3;
		
		port 
			critical in BankData,
			out PaymentAck;
	}
	
	connect encrypted cashDesk.bdOut -> bank.bankData;
	
	connect encrypted bank.paymentAck -> cashDesk.paIn;

Bernhard Rumpe's avatar
BR-sy  
Bernhard Rumpe committed
58
}