versadac  1
versadac - Scalable Recorder Firmware
mrp_domain.h
1 /***************************************************************************************
2  *********** Copyright 2005 Zurich University of Applied Sciences / InES **************
3  ***************************************************************************************
4  **
5  ** File : mrp_domain.h
6  **
7  ** Description : This file provides the class Domain which represents a MRP Domain
8  **
9  ***************************************************************************************
10  ** Department : Institute of Embedded Systems
11  ** Project : MRP
12  ** Modul : MRP_Domain_T
13  ** Author : Christian Schaer
14  ** Contact : scc@zhwin.ch
15  ** Date : 10.04.2006
16  ****************************** Modifications ******************************************
17  **
18  ** Date : Who : Comment :
19  ** 10.05.06 scc initial release
20  **************************************************************************************/
21 /* $Workfile:: mrp_domain.h $*/
22 /* $Revision:: 3 $*/
23 /* $Date:: 16/12/10 14:44 $*/
24 
25 #ifndef MRP_RING_H
26 #define MRP_RING_H
27 
28 
29 /***********************************************************************/
30 /*** Header Files Includes ***/
31 /***********************************************************************/
32 
33 #include "mrp_pkg.h"
34 #include "mrp_protocolmachine.h"
35 #include "mrp_protocolevent.h"
36 #include "mrp_pduframes.h"
37 #include "mrp_timer.h"
38 
39 
40 
41 typedef enum MRPTimers {
42  MRP_TEST_TIMER,
43  MRP_UP_TIMER,
44  MRP_DOWN_TIMER,
45  MRP_TOP_TIMER,
46  MRP_FDB_CLEAR_TIMER,
47  MRP_NO_TIMERS
48 } MRPTimers;
49 
50 /**********************************************************************/
51 /*** class MRP_Domain_T ***/
52 /**********************************************************************/
53 
54 struct MRP_Domain_T
55 {
56  MRP_Environment_T * mrp_environment_ptr_;
57  MRP_ProtocolMachine_T mrp_protocolmachine_;
58  MRP_PDUFrames_T mrp_pduframes_;
59  MRP_Timer_T mrp_timer_[ MRP_NO_TIMERS ]; /* This array contains all MRP specific timers */
60 
61 
64  MRPRoleState expected_role_state_;
65  Unsigned16 ring_port_1_id_;
66  Unsigned16 ring_port_2_id_;
67  Unsigned16 vlan_id_;
68  Unsigned16 manager_priority_;
69  MRPBoolean check_media_redundancy_;
70  MRPRingState ring_state_;
71  Unsigned16 sequence_id_;
72  Unsigned16 transitions_;
73  Unsigned32 time_stamp_;
74  void * lpvContextInd; /* Ng: add a contexte in this structure. this contexte will be restore on indeication*/
75 };
76 
77 
78 /********************************************/
79 /*** Constructors and destructors ***/
80 /********************************************/
81 
82 void MRP_Domain_T_Init( MRP_Domain_T* const me,
83  MRP_Environment_T* const env_ptr );
84 
85 void MRP_Domain_T_Cleanup( MRP_Domain_T* const me );
86 
87 
88 /********************************************/
89 /*** public Methods ***/
90 /********************************************/
91 
93 MRPError MRP_Domain_T_startMRM( MRP_Domain_T* const me,
94  DomainID domain_id,
95  Unsigned16 ring_port_1_id,
96  Unsigned16 ring_port_2_id,
97  Unsigned16 vlan_id,
98  Unsigned16 manager_priority,
99  Unsigned16 topology_change_interval,
100  Unsigned16 topology_change_repeat_count,
101  Unsigned16 short_test_interval,
102  Unsigned16 default_test_interval,
103  Unsigned16 test_monitoring_count,
104  MRPBoolean non_blocking_MRC_supported,
105  Unsigned16 test_monitoring_extended_count,
106  MRPBoolean react_on_link_change,
107  MRPBoolean check_media_redundancy,
108  void * lpvContextInd);
109 
110 
112 MRPError MRP_Domain_T_startMRC( MRP_Domain_T* const me,
113  DomainID domain_id,
114  Unsigned16 ring_port_1_id,
115  Unsigned16 ring_port_2_id,
116  Unsigned16 vlan_id,
117  Unsigned16 link_down_interval,
118  Unsigned16 link_up_interval,
119  Unsigned16 link_change_count,
120  MRPBoolean blocked_state_supported,
121  void * lpvContextInd);
122 
124 MRPError MRP_Domain_T_stop( MRP_Domain_T* const me );
125 
127 MRPError MRP_Domain_T_getRingPort1ID( MRP_Domain_T* const me,
128  Unsigned16* const value );
129 
131 MRPError MRP_Domain_T_getRingPort2ID( MRP_Domain_T* const me,
132  Unsigned16* const value );
133 
135 MRPError MRP_Domain_T_getVLanID( MRP_Domain_T* const me,
136  Unsigned16* const value );
137 
139 MRPError MRP_Domain_T_getRingPort1PortState( MRP_Domain_T* const me,
140  Unsigned16* const value );
141 
143 MRPError MRP_Domain_T_getRingPort2PortState( MRP_Domain_T* const me,
144  Unsigned16* const value );
145 
147 MRPError MRP_Domain_T_getMRMManagerPriority( MRP_Domain_T* const me,
148  Unsigned16* const value );
149 
151 MRPError MRP_Domain_T_getMRMRealRoleState( MRP_Domain_T* const me,
152  Unsigned16* const value );
153 
155 MRPError MRP_Domain_T_getMRMRealRingState( MRP_Domain_T* const me,
156  Unsigned16* const value );
157 
159 MRPError MRP_Domain_T_getMRMTopologyChangeInterval( MRP_Domain_T* const me,
160  Unsigned16* const value );
161 
163 MRPError MRP_Domain_T_getMRMTopologyChangeRepeatCount( MRP_Domain_T* const me,
164  Unsigned16* const value );
165 
167 MRPError MRP_Domain_T_getMRMShortTestInterval( MRP_Domain_T* const me,
168  Unsigned16* const value );
169 
171 MRPError MRP_Domain_T_getMRMDefaultTestInterval( MRP_Domain_T* const me,
172  Unsigned16* const value );
173 
175 MRPError MRP_Domain_T_getMRMTestMonitoringCount( MRP_Domain_T* const me,
176  Unsigned16* const value );
177 
179 MRPError MRP_Domain_T_getMRMNonBlockingMRCSupported( MRP_Domain_T* const me,
180  MRPBoolean* const value );
181 
183 MRPError MRP_Domain_T_getMRMTestMonitoringExtendedCount( MRP_Domain_T* const me,
184  Unsigned16* const value );
185 
187 MRPError MRP_Domain_T_getMRMReactOnLinkChange( MRP_Domain_T* const me,
188  MRPBoolean* const value );
189 
191 MRPError MRP_Domain_T_getMRMCheckMediaRedundancy( MRP_Domain_T* const me,
192  MRPBoolean* const value );
193 
195 MRPError MRP_Domain_T_getMRCLinkDownInterval( MRP_Domain_T* const me,
196  Unsigned16* const value );
197 
199 MRPError MRP_Domain_T_getMRCLinkUpInterval( MRP_Domain_T* const me,
200  Unsigned16* const value );
201 
203 MRPError MRP_Domain_T_getMRCLinkChangeCount( MRP_Domain_T* const me,
204  Unsigned16* const value );
205 
207 MRPError MRP_Domain_T_getMRCBlockedStateSupported( MRP_Domain_T* const me,
208  MRPBoolean* const value );
209 
211 MRPError MRP_Domain_T_getExpectedRoleState( MRP_Domain_T* const me,
212  Unsigned16* const value );
213 
215 void MRP_Domain_T_getSA_RPort( MRP_Domain_T* const me,
216  Unsigned16 port,
217  UChar sa[6] );
218 
220 void MRP_Domain_T_processPDU( MRP_Domain_T* const me, MRP_PDU_T* pdu );
221 
223 void MRP_Domain_T_runTimers( MRP_Domain_T* const me );
224 
226 void MRP_Domain_T_processLinkChangeInd( MRP_Domain_T* const me,
227  MAUTypeChangeIndData* data_ptr );
228 
230 void MRP_Domain_T_updateRingState( MRP_Domain_T* const me, MRPRingState state);
231 
233 Unsigned16 MRP_Domain_T_getSequenceID( MRP_Domain_T* const me );
234 
235 
236 #endif
237 
Definition: mrp_environment.h:44
Definition: mrp_timer.h:47
Definition: mrp_pduframes.h:40
Definition: mrp_pdu.h:118
DomainID domain_id_
Definition: mrp_domain.h:63
Definition: mrp_protocolmachine.h:61
Definition: mrp_protocolevent.h:54
Definition: mrp_pkg.h:81
Definition: mrp_domain.h:54