axnglobaldefines.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /*****************************************************************************/
  2. /******************* Siemens Medizinische Technik Erlangen *******************/
  3. /*****************************************************************************/
  4. /* */
  5. /* File name: axnglobaldefines.h Version: 1.0 */
  6. /* */
  7. /*****************************************************************************/
  8. /* */
  9. /* Type: Headerfile Programming language: C++ */
  10. /* */
  11. /*****************************************************************************/
  12. /* */
  13. /* Author: Ulrich Koestner Date: 01.09.1997 */
  14. /* */
  15. /* Changes: */
  16. /* */
  17. /* Date | Name | Method | CC-Gen */
  18. /* ---------+---------------------+------------------------------+---------- */
  19. /* 19.09.01 | Daum | AXN_ERRLOG_1015 added | */
  20. /* 09.10.01 | Daum | changed defines for AXN_ERROR| */
  21. /* | | and AXN_OK under Nto | */
  22. /* 12.06.03 | Hoffmann | debug levels and group | */
  23. /* | | for err_info. | */
  24. /* 30.06.03 | Hoffmann | back to 200 from 500 in mbx | */
  25. /* | | size. | */
  26. /* 29.07.03 | Hoffmann | specpial ACS_VB10_GROUP bit | */
  27. /* | | added. | */
  28. /* 29.10.03 | Hoffmann | New defines for the clean up | */
  29. /* | | thread of an entry of the | */
  30. /* | | socket connection tab added. | */
  31. /* 06.11.03 | Hoffmann | set AXN_MBX_CL_HELP_NAME_LENGTH| */
  32. /* | | to 20 to be sure we have | */
  33. /* | | enough space. | */
  34. /* 12.11.03 | Hoffmann | many defines moved to | */
  35. /* | | axnerrinfo.h | */
  36. /* 10.08.05 | Fischer | reduced broadcast interval | */
  37. /* 08.09.05 | Fischer | moved AXN_MAX_NUM_VIRTUAL_ | */
  38. /* | | CONNECTIONS to axnalivetab.h | */
  39. /* | | and updated other defines for| */
  40. /* | | internal/external connections| */
  41. /* | | and maximal number of flags | */
  42. /* 27.09.05 | Fischer | removed defines for ack objs | */
  43. /* | | (not used with XCS2) | */
  44. /* 28.09.05 | Fischer | added a define for an unde- | */
  45. /* | | fined group_index | */
  46. /* 14.12.05 | Fischer | added an important warning | */
  47. /* 13.06.08 | Koestner | global definitions received | */
  48. /* | | from axnclientrecv.h | */
  49. /* | | | */
  50. /* */
  51. /*****************************************************************************/
  52. /* */
  53. /* Description: */
  54. /* ============ */
  55. /* This file includes the global defines */
  56. /* This file have to be included after axn_portab.h */
  57. /*****************************************************************************/
  58. /* */
  59. /* Includes: */
  60. /* ========= */
  61. /* */
  62. /* */
  63. /*****************************************************************************/
  64. /* */
  65. /* Copyright (c) Siemens AG 1997. All rights reserved */
  66. /* */
  67. /*****************************************************************************/
  68. /* */
  69. /* */
  70. /* */
  71. #ifndef AXNGLOBALDEFINES_H
  72. #define AXNGLOBALDEFINES_H
  73. //include "mas.h"
  74. #include "..//gbl/axcscom.h"
  75. //#ifdef AXN_NEUTRINO
  76. //#include "..//gbl/rfcglobal.h" //donn't have this header file
  77. #include "..//gbl/axnportab.h"
  78. //#endif // defined AXN_NEUTRINO
  79. // Defines and Systemwide Types for The AXCS Net Software
  80. /*****************************************************************************/
  81. /*****************************************************************************/
  82. /*****************************************************************************/
  83. /*** Common System Defines ***/
  84. /*****************************************************************************/
  85. typedef axn_int axn_status ;
  86. #ifdef AXN_NEUTRINO
  87. #define AXN_OK (axn_status)RFC_OK
  88. #define AXN_ERROR (axn_status)RFC_ERROR
  89. #else
  90. #define AXN_OK (axn_status)0
  91. #define AXN_ERROR (axn_status)-1
  92. #endif // defined AXN_NEUTRINO
  93. #define AXN_ERR_TIMEOUT (axn_status)-2
  94. typedef axn_byte axn_bool ;
  95. #define AXN_TRUE (axn_bool)-1
  96. #define AXN_FALSE (axn_bool)0
  97. #ifndef NULL
  98. #define NULL 0
  99. #endif
  100. #define AXN_NULL_PTR ((axn_char *) 0)
  101. // a value for initialization of the group_index
  102. #define AXN_UNDEFINED_GROUP_INDEX 0
  103. //
  104. // Typedefs for nto socket specific data
  105. //
  106. typedef axn_int axn_socket ;
  107. typedef short axn_port ;
  108. typedef axn_int axn_ip_address ;
  109. #define AXN_TCP_SOCKET (axn_int)1
  110. #define AXN_UDP_SOCKET (axn_int)2
  111. #define AXN_TCP_PORT (axn_port)5002
  112. #define AXN_UDP_PORT (axn_port)5003
  113. /*****************************************************************************/
  114. /*****************************************************************************/
  115. /*****************************************************************************/
  116. /*** System Wide Limitations ***/
  117. /*****************************************************************************/
  118. /*****************************************************************************/
  119. /*** maximum number of client application processes ***/
  120. /*****************************************************************************/
  121. // DON'T USE VALUES BIGGER THAN 255 ! (this would have fatal consequences)
  122. #define AXN_MIN_CLIENT_ID ((axn_byte)1)
  123. #define AXN_MAX_CLIENT_ID ((axn_byte)255)
  124. #define AXN_MAX_NR_CLIENTS ((axn_byte)AXN_MAX_CLIENT_ID - AXN_MIN_CLIENT_ID + 1)
  125. #define AXN_MAX_NR_INTERNAL_CONNECTIONS AXN_MAX_NR_CLIENTS
  126. /*****************************************************************************/
  127. /*** maximum number of axcs server hosts ***/
  128. /*****************************************************************************/
  129. // DON'T USE VALUES BIGGER THAN 255 ! (this would have fatal consequences)
  130. #define AXN_MIN_SERVER_ID ((axn_byte)1)
  131. #define AXN_MAX_SERVER_ID ((axn_byte)254)
  132. #define AXN_MAX_NR_SERVER ((axn_byte)32)
  133. #define AXN_MAX_NR_EXTERNAL_CONNECTIONS ((axn_byte)AXN_MAX_NR_SERVER - 1)
  134. /*****************************************************************************/
  135. /*** maximum number of maiblox entries ***/
  136. /*****************************************************************************/
  137. #define AXN_MAX_NUM_SERVER_MBX 500
  138. #define AXN_MAX_NUM_CLIENT_MBX 200
  139. #define AXN_MAX_NUM_SOCKET_SEND_MBX 200
  140. #define AXN_MAX_NUM_CLEANUP_MBX 500*20 // from 100, 19.12.02 Hoffmann/Koestner
  141. // message queue defines
  142. #define MSG_LENGTH 1024
  143. // flag defines
  144. #define AXN_FLAGSIZE 4
  145. #define AXN_MAX_NR_LOCALFLAGS AXN_MAX_NR_CLIENTS
  146. #define AXN_FLAG_SET 1
  147. #define AXN_FLAG_RESET 0
  148. #define AXN_FLAG_INVALID -1
  149. /*****************************************************************************/
  150. /*****************************************************************************/
  151. /*****************************************************************************/
  152. /*** System Resource Names ***/
  153. /*****************************************************************************/
  154. #define AXN_SERVER_MBX_NAME "/axn_server_mbx"
  155. #define AXN_CLEAN_UP_MBX_NAME "/axn_clean_up_mbx"
  156. //#define BROADCAST_INI_FILE "broadcast.ini"
  157. // common defines
  158. #define MAX_RESOURCE_NAME_LENGTH 32
  159. //location of a client or server
  160. #define AXN_LOCATION_UNKNOWN (axn_location) 10
  161. #define AXN_LOCATION_EXTERNAL (axn_location) 11
  162. #define AXN_LOCATION_INTERNAL (axn_location) 12
  163. #define AXN_LOCATION_INTERNAL_OR_EXTERNAL (axn_location) 13
  164. // first part of name for ClientRecv-mailbox
  165. #define RECV_MBX_NAME "/axn_client%02x"
  166. // first part of name for SocketSend-mailbox
  167. #define AXN_SOCKET_SEND_MBX_NAME "/axn_socket%02x"
  168. // first part of name for ClientRecv-aliveflag
  169. #define CLIENT_ALIVE_FLAG_NAME "/axn_aliveflag%02x"
  170. // first part of name for the socket send aliveflag
  171. #define SOCKET_SEND_ALIVE_FLAG_NAME "/axn_sosendflag%02x"
  172. // first part of name for the socket recv aliveflag
  173. #define SOCKET_RECV_ALIVE_FLAG_NAME "/axn_sorecvflag%02x"
  174. // first part of name for the object-already-sent-flag
  175. #define SOCKET_OBJ_SINCE_VT_FLAG_NAME "/axn_soobjssvtflag%02x"
  176. // first part of name for the object-already-sent-flag
  177. #define CLIENT_OBJ_SINCE_VT_FLAG_NAME "/axn_clobjssvtflag%02x"
  178. // restarting threads
  179. #define AXN_INTERNAL_MODE_RESTART 0x0F
  180. #define AXN_RESTART_BROADCASTRECV 1
  181. #define AXN_RESTART_BROADCASTSEND 2
  182. #define AXN_RESTART_SOCKETSERVER 3
  183. // mode for testing
  184. #define ACS_MODE_TEST 0x20
  185. // NIL
  186. #define AXN_BNIL (axn_byte) 0xFF
  187. #define AXN_INIL (axn_int) 0x80000000
  188. #define AXN_WNIL (axn_word) 0xFFFF
  189. /****************************************************************************
  190. times for alivecheck, sending dummys, timeout msgqueue-recv
  191. ****************************************************************************/
  192. #define AXN_ALIVE_BASE_RATE_IN_NS 100000000 // PZ - 100 ms - DZ - 100 ms - PZ
  193. #define AXN_BROADCAST_INTERVAL_IN_MS 2000
  194. #define AXN_CLIENT_DUMMY_SEND_COUNTER 5
  195. #define AXN_SOCKET_DUMMY_SEND_COUNTER 20
  196. #define AXN_DUMMYTIME_BASE_RATE_IN_NS 2*AXN_ALIVE_BASE_RATE_IN_NS
  197. #define AXN_TIMEOUT_RECOGNITION 2
  198. #define AXN_NO_TIMEOUT 0
  199. #define AXN_SERVER_SEND_POSSIBLE_DELAY 500
  200. /****************************************************************************
  201. global defines moved from axnclienrecv.h
  202. ****************************************************************************/
  203. #define AXN_ERR_TIMEOUT (axn_status)-2
  204. #define AXN_FLAG_TIMEOUT 2
  205. #define AXN_DUMMYTIME_BASE_RATE_IN_MS 200
  206. // TURN_OFF
  207. typedef struct turn_off_t_tag
  208. {
  209. turn_off_t1 t1;
  210. turn_off_t2 t2[NO_OBJECTS_MAX];
  211. } turn_off_type;
  212. #endif