118
118
#define DEFAULT_REMOTE_MANAGEMENT_FLAG 0
120
int version_flag = DEFAULT_VERSION_FLAG;
121
int stack_trace_flag = DEFAULT_STACK_TRACE_FLAG;
123
int number_of_processors = ink_number_of_processors();
124
int num_of_net_threads = DEFAULT_NUMBER_OF_THREADS;
120
static void * mgmt_restart_shutdown_callback(void *, char *, int data_len);
121
static bool xmlBandwidthSchemaRead(XMLNode * node);
123
static int version_flag = DEFAULT_VERSION_FLAG;
125
static int const number_of_processors = ink_number_of_processors();
126
static int num_of_net_threads = DEFAULT_NUMBER_OF_THREADS;
125
127
extern int num_of_cluster_threads;
126
int num_of_udp_threads = DEFAULT_NUMBER_OF_UDP_THREADS;
127
int num_accept_threads = DEFAULT_NUM_ACCEPT_THREADS;
128
int num_task_threads = DEFAULT_NUM_TASK_THREADS;
129
int run_test_hook = 0;
130
char http_accept_port_descriptor[TS_ARG_MAX + 1];
131
#define TS_ARG_MAX_STR_FMT "S" TS_ARG_MAX_STR
128
static int num_of_udp_threads = DEFAULT_NUMBER_OF_UDP_THREADS;
129
static int num_accept_threads = DEFAULT_NUM_ACCEPT_THREADS;
130
static int num_task_threads = DEFAULT_NUM_TASK_THREADS;
131
static int run_test_hook = 0;
132
static char * http_accept_port_descriptor;
132
133
int http_accept_file_descriptor = NO_FD;
133
int ssl_accept_file_descriptor = NO_FD;
134
char core_file[255] = "";
135
bool enable_core_file_p = false; // Enable core file dump?
134
static char core_file[255] = "";
135
static bool enable_core_file_p = false; // Enable core file dump?
136
136
int command_flag = DEFAULT_COMMAND_FLAG;
138
char regression_test[1024] = "";
138
static char regression_test[1024] = "";
140
140
int auto_clear_hostdb_flag = 0;
141
141
int lock_process = DEFAULT_LOCK_PROCESS;
147
147
// = DEFAULT_CLUSTER_PORT_NUMBER;
148
148
char proxy_name[MAXDNAME + 1] = "unknown";
149
char command_string[512] = "";
149
static char command_string[512] = "";
150
150
int remote_management_flag = DEFAULT_REMOTE_MANAGEMENT_FLAG;
152
152
char management_directory[PATH_NAME_MAX+1]; // Layout->sysconfdir
155
155
char system_config_directory[PATH_NAME_MAX + 1]; // Layout->sysconfdir
156
156
char system_log_dir[PATH_NAME_MAX + 1]; // Layout->logdir
158
int logging_port_override = 0;
159
char logging_server_override[256] = " do not override";
160
char error_tags[1024] = "";
161
char action_tags[1024] = "";
162
int show_statistics = 0;
163
int history_info_enabled = 1;
158
static char error_tags[1024] = "";
159
static char action_tags[1024] = "";
160
static int show_statistics = 0;
161
static int history_info_enabled = 1;
164
162
//inkcoreapi Diags *diags = NULL;
165
inkcoreapi DiagsConfig *diagsConfig = NULL;
163
static inkcoreapi DiagsConfig *diagsConfig = NULL;
166
164
HttpBodyFactory *body_factory = NULL;
167
int diags_init = 0; // used by process manager
165
static int diags_init = 0; // used by process manager
169
char vingid_flag[255] = "";
167
static char vingid_flag[255] = "";
171
169
static int accept_mss = 0;
172
170
static int cmd_line_dprintf_level = 0; // default debug output level fro ink_dprintf function
177
175
extern int run_TestHook();
179
void deinitSubAgent();
178
const Version version = {
182
179
{CACHE_DB_MAJOR_VERSION, CACHE_DB_MINOR_VERSION}, // cacheDB
183
180
{CACHE_DIR_MAJOR_VERSION, CACHE_DIR_MINOR_VERSION}, // cacheDir
184
181
{CLUSTER_MAJOR_VERSION, CLUSTER_MINOR_VERSION}, // current clustering
185
182
{MIN_CLUSTER_MAJOR_VERSION, MIN_CLUSTER_MINOR_VERSION}, // min clustering
188
ArgumentDescription argument_descriptions[] = {
185
static const ArgumentDescription argument_descriptions[] = {
189
186
{"lock_memory", 'l', "Lock process in memory (must be root)",
190
187
"I", &lock_process, "PROXY_LOCK_PROCESS", NULL},
191
188
{"net_threads", 'n', "Number of Net Threads", "I", &num_of_net_threads,
198
195
"PROXY_ACCEPT_THREAD", NULL},
199
196
{"accept_till_done", 'b', "Accept Till Done", "T", &accept_till_done,
200
197
"PROXY_ACCEPT_TILL_DONE", NULL},
201
{"httpport", 'p', "Port descriptor for HTTP Accept", TS_ARG_MAX_STR_FMT,
202
http_accept_port_descriptor, "PROXY_HTTP_ACCEPT_PORT", NULL},
198
{"httpport", 'p', "Port descriptor for HTTP Accept", "S*",
199
&http_accept_port_descriptor, "PROXY_HTTP_ACCEPT_PORT", NULL},
203
200
{"cluster_port", 'P', "Cluster Port Number", "I", &cluster_port_number,
204
201
"PROXY_CLUSTER_PORT", NULL},
205
202
{"dprintf_level", 'o', "Debug output level", "I", &cmd_line_dprintf_level,
263
260
{"help", 'h', "HELP!", NULL, NULL, NULL, usage},
265
int n_argument_descriptions = SIZE(argument_descriptions);
262
static const unsigned n_argument_descriptions = SIZE(argument_descriptions);
268
265
// Initialize operating system related information/services
736
733
"EXAMPLES: help help\n"
737
734
" help commit\n" "\n" "Provide a short description of a command (like this).\n", cmd_help},};
739
#define N_CMDS ((int)(sizeof(commands)/sizeof(commands[0])))
742
737
cmd_index(char *p)
744
739
p += strspn(p, " \t");
745
for (int c = 0; c < N_CMDS; c++) {
740
for (unsigned c = 0; c < SIZE(commands); c++) {
746
741
const char *l = commands[c].n;
748
743
const char *s = strchr(l, '/');
761
756
cmd_help(char *cmd)
766
759
printf("HELP\n\n");
767
760
cmd = skip(cmd, true);
769
for (i = 0; i < N_CMDS; i++) {
762
for (unsigned i = 0; i < SIZE(commands); i++) {
770
763
printf("%15s %s\n", commands[i].n, commands[i].d);
773
767
if ((i = cmd_index(cmd)) < 0) {
774
768
printf("\nno help found for: %s\n", cmd);
775
769
return CMD_FAILED;
1563
bool xmlBandwidthSchemaRead(XMLNode * node);
1564
1557
//char *configPath = TS_ConfigReadString("proxy.config.config_dir");
1565
1558
char *filename = TS_ConfigReadString("proxy.config.bandwidth_mgmt.filename");
1566
1559
char bwFilename[PATH_NAME_MAX];
1798
1791
///////////////////////////////////////////
1799
1792
updateManager.start();
1801
void *mgmt_restart_shutdown_callback(void *, char *, int data_len);
1803
1794
pmgmt->registerMgmtCallback(MGMT_EVENT_SHUTDOWN, mgmt_restart_shutdown_callback, NULL);
1804
1795
pmgmt->registerMgmtCallback(MGMT_EVENT_RESTART, mgmt_restart_shutdown_callback, NULL);