My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
Ports.h
Go to the documentation of this file.
1 // $Id: Ports.h,v 1.2 2009/08/17 21:18:31 eml Exp $
2 
3 #ifndef GCP_UTIL_PORTS_H
4 #define GCP_UTIL_PORTS_H
5 
15 #include <string>
16 
17 #include "gcp/util/common/Directives.h"
18 
19 #if DIR_IS_STABLE
20 #define PORT_OFFSET 5000+gcp::util::Ports::expOffset()
21 #else
22 #define PORT_OFFSET 6000+gcp::util::Ports::expOffset()
23 #endif
24 
25 /*
26  * The TCP/IP port on which the control program listens for connection
27  * requests from the translator control process.
28  */
29 #define CP_RTC_PORT_BASE 440
30 #define CP_RTC_PORT CP_RTC_PORT_BASE+PORT_OFFSET
31 
32 /*
33  * The TCP/IP port on which the control-program listens for external
34  * control clients.
35  */
36 #define CP_CONTROL_PORT_BASE 441
37 #define CP_CONTROL_PORT CP_CONTROL_PORT_BASE+PORT_OFFSET
38 
39 /*
40  * The TCP/IP port on which the control program listens for external
41  * monitor clients.
42  */
43 #define CP_MONITOR_PORT_BASE 442
44 #define CP_MONITOR_PORT CP_MONITOR_PORT_BASE+PORT_OFFSET
45 
46 /*
47  * The TCP/IP port on which the control program listens for external
48  * image monitor clients.
49  */
50 #define CP_IM_MONITOR_PORT_BASE 443
51 #define CP_IM_MONITOR_PORT CP_IM_MONITOR_PORT_BASE+PORT_OFFSET
52 
53 /*
54  * The TCP/IP port on which that the control program listens for
55  * connection requests from the translator scanner process.
56  */
57 #define CP_RTS_PORT_BASE 444
58 #define CP_RTS_PORT CP_RTS_PORT_BASE+PORT_OFFSET
59 
60 /*
61  * The TCP/IP port on which the control program listens for
62  * connection requests from the translator optcam process.
63  */
64 #define CP_RTO_PORT_BASE 445
65 #define CP_RTO_PORT CP_RTO_PORT_BASE+PORT_OFFSET
66 
67 /*
68  * The TCP/IP port on which the translator listens for control
69  * connections from antenna computers.
70  */
71 #define TRANS_ANT_CONTROL_PORT_BASE 446
72 #define TRANS_ANT_CONTROL_PORT TRANS_ANT_CONTROL_PORT_BASE+PORT_OFFSET
73 
74 /*
75  * The TCP/IP port on which the translator listens for scanner
76  * connections from antenna computers.
77  */
78 #define TRANS_ANT_SCANNER_PORT_BASE 447
79 #define TRANS_ANT_SCANNER_PORT TRANS_ANT_SCANNER_PORT_BASE+PORT_OFFSET
80 
81 /*
82  * The TCP/IP port on which the translator listens for control
83  * connections from the frame grabber
84  */
85 #define TRANS_GRABBER_CONTROL_PORT_BASE 448
86 #define TRANS_GRABBER_CONTROL_PORT TRANS_GRABBER_CONTROL_PORT_BASE+PORT_OFFSET
87 
88 /*
89  * The TCP/IP port on which the weather server listens for connection
90  * requests
91  */
92 #define TRANS_WEATHER_PORT_BASE 449
93 #define TRANS_WEATHER_PORT TRANS_WEATHER_PORT_BASE+PORT_OFFSET
94 
95 /*
96  * The TCP/IP port on which the submm tipper server listens for
97  * connection requests
98  */
99 #define TIPPER_SERVER_PORT_BASE 450
100 #define TIPPER_SERVER_PORT TIPPER_SERVER_PORT_BASE+PORT_OFFSET
101 
102 /*
103  * The TCP/IP port on which the weather station server listens for
104  * connection requests
105  */
106 #define WX_SERVER_PORT_BASE 451
107 #define WX_SERVER_PORT WX_SERVER_PORT_BASE+PORT_OFFSET
108 
109 namespace gcp {
110  namespace util {
111  class Ports {
112  public:
113 
114  static unsigned base(bool stable=DIR_IS_STABLE);
115  static unsigned expOffset();
116  static unsigned expOffset(std::string exp);
117 
118  // Port on which the Tipper server listens for client
119  // connections
120 
121  static unsigned tipperPort(std::string exp);
122 
123  // Port on which the weather station server listens for client
124  // connections
125 
126  static unsigned wxPort(std::string exp);
127 
128  // Ports on which the Control program listens for client
129  // connections
130 
131  static unsigned controlControlPort(std::string exp);
132  static unsigned controlMonitorPort(std::string exp);
133  static unsigned controlImMonitorPort(std::string exp);
134 
135  static unsigned controlControlPort(bool stable=DIR_IS_STABLE);
136  static unsigned controlMonitorPort(bool stable=DIR_IS_STABLE);
137  static unsigned controlImMonitorPort(bool stable=DIR_IS_STABLE);
138 
139 #if 0
140  static unsigned controlOptcamPort(std::string exp);
141  static unsigned controlMediatorPort(std::string exp);
142 
143  // Ports on which the mediator program listens for client
144  // connections
145 
146  static unsigned mediatorAntennaControlPort(std::string exp);
147  static unsigned mediatorAntennaMonitorPort(std::string exp);
148  static unsigned mediatorGrabberControlPort(std::string exp);
149 #endif
150  }; // End class Ports
151 
152  } // End namespace util
153 } // End namespace gcp
154 
155 #endif // End #ifndef GCP_UTIL_PORTS_H
156 
157 
158 
Definition: Ports.h:111