Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 708512
Collapse All | Expand All

(-)smstools.orig/src/smsd_cfg.h (-136 / +136 lines)
Lines 126-142 Link Here
126
#define ALPHABET_UNKNOWN        4
126
#define ALPHABET_UNKNOWN        4
127
#define ALPHABET_DEFAULT        0
127
#define ALPHABET_DEFAULT        0
128
128
129
char process_title[32];         // smsd for main task, NOTIFIER or CHILD, name of a modem for other tasks.
129
extern char process_title[32];         // smsd for main task, NOTIFIER or CHILD, name of a modem for other tasks.
130
int process_id;                 // -1 for main task, all modems have numbers starting with 0.
130
extern int process_id;                 // -1 for main task, all modems have numbers starting with 0.
131
                                // This is the same as device, can be used like devices[process_id] if IS_MODEM_PROCESS.
131
                                // This is the same as device, can be used like devices[process_id] if IS_MODEM_PROCESS.
132
132
133
time_t process_start_time;
133
extern time_t process_start_time;
134
134
135
int modem_handle;               // Handle for modem.
135
extern int modem_handle;               // Handle for modem.
136
136
137
int put_command_timeouts;
137
extern int put_command_timeouts;
138
unsigned long long put_command_sent; // 3.1.16beta.
138
extern unsigned long long put_command_sent; // 3.1.16beta.
139
char tmpdir[PATH_MAX];          // 3.1.16beta.
139
extern char tmpdir[PATH_MAX];          // 3.1.16beta.
140
140
141
typedef struct
141
typedef struct
142
{
142
{
Lines 284-487 Link Here
284
284
285
// NOTE for regular run intervals: effective value is at least delaytime.
285
// NOTE for regular run intervals: effective value is at least delaytime.
286
286
287
char configfile[PATH_MAX];	// Path to config file
287
extern char configfile[PATH_MAX];	// Path to config file
288
char d_spool[PATH_MAX];		// Spool directory
288
extern char d_spool[PATH_MAX];		// Spool directory
289
char d_failed[PATH_MAX];	// Failed spool directory
289
extern char d_failed[PATH_MAX];	// Failed spool directory
290
char d_failed_copy[PATH_MAX];	// 3.1.17.
290
extern char d_failed_copy[PATH_MAX];	// 3.1.17.
291
char d_incoming[PATH_MAX];	// Incoming spool directory
291
extern char d_incoming[PATH_MAX];	// Incoming spool directory
292
char d_incoming_copy[PATH_MAX]; // 3.1.16beta2.
292
extern char d_incoming_copy[PATH_MAX]; // 3.1.16beta2.
293
char d_report[PATH_MAX];	// Incoming report spool directory
293
extern char d_report[PATH_MAX];	// Incoming report spool directory
294
char d_report_copy[PATH_MAX];	// 3.1.17.
294
extern char d_report_copy[PATH_MAX];	// 3.1.17.
295
char d_phonecalls[PATH_MAX];    // Incoming phonecalls data directory
295
extern char d_phonecalls[PATH_MAX];    // Incoming phonecalls data directory
296
char d_saved[PATH_MAX];         // Directory for smsd's internal use, concatenation storage files etc.
296
extern char d_saved[PATH_MAX];         // Directory for smsd's internal use, concatenation storage files etc.
297
char d_sent[PATH_MAX];		// Sent spool directory
297
extern char d_sent[PATH_MAX];		// Sent spool directory
298
char d_sent_copy[PATH_MAX];	// 3.1.17.
298
extern char d_sent_copy[PATH_MAX];	// 3.1.17.
299
char d_checked[PATH_MAX];	// Spool directory for checked messages (only used when no provider queues used)
299
extern char d_checked[PATH_MAX];	// Spool directory for checked messages (only used when no provider queues used)
300
char eventhandler[PATH_MAX];	// Global event handler program or script
300
extern char eventhandler[PATH_MAX];	// Global event handler program or script
301
char alarmhandler[PATH_MAX];	// Global alarm handler program or script
301
extern char alarmhandler[PATH_MAX];	// Global alarm handler program or script
302
char checkhandler[PATH_MAX];    // Handler that checks if the sms file is valid.
302
extern char checkhandler[PATH_MAX];    // Handler that checks if the sms file is valid.
303
int alarmlevel;			// Alarm Level (9=highest). Verbosity of alarm handler.
303
extern int alarmlevel;			// Alarm Level (9=highest). Verbosity of alarm handler.
304
char logfile[PATH_MAX];		// Name or Handle of Log File
304
extern char logfile[PATH_MAX];		// Name or Handle of Log File
305
int  loglevel;			// Log Level (9=highest). Verbosity of log file.
305
extern int  loglevel;			// Log Level (9=highest). Verbosity of log file.
306
_queue queues[NUMBER_OF_MODEMS]; // Queues
306
extern _queue queues[NUMBER_OF_MODEMS]; // Queues
307
_device devices[NUMBER_OF_MODEMS]; // Modem devices
307
extern _device devices[NUMBER_OF_MODEMS]; // Modem devices
308
int delaytime;			// sleep-time after workless
308
extern int delaytime;			// sleep-time after workless
309
int delaytime_mainprocess;      // sleep-time after workless, main process. If -1, delaytime is used.
309
extern int delaytime_mainprocess;      // sleep-time after workless, main process. If -1, delaytime is used.
310
int blocktime;			// sleep-time after multiple errors
310
extern int blocktime;			// sleep-time after multiple errors
311
int blockafter;                 // Block modem after n errors
311
extern int blockafter;                 // Block modem after n errors
312
int errorsleeptime;		// sleep-time after each error
312
extern int errorsleeptime;		// sleep-time after each error
313
int autosplit;			// Splitting of large text messages 0=no, 1=yes 2=number with text, 3=number with UDH
313
extern int autosplit;			// Splitting of large text messages 0=no, 1=yes 2=number with text, 3=number with UDH
314
int receive_before_send;	// if 1 smsd tries to receive one message before sending
314
extern int receive_before_send;	// if 1 smsd tries to receive one message before sending
315
int store_received_pdu;         // 0=no, 1=unsupported pdu's only, 2=unsupported and 8bit/unicode, 3=all
315
extern int store_received_pdu;         // 0=no, 1=unsupported pdu's only, 2=unsupported and 8bit/unicode, 3=all
316
int store_sent_pdu;             // 0=no, 1=failed pdu's only, 2=failed and 8bit/unicode, 3=all
316
extern int store_sent_pdu;             // 0=no, 1=failed pdu's only, 2=failed and 8bit/unicode, 3=all
317
int validity_period;            // Validity period for messages.
317
extern int validity_period;            // Validity period for messages.
318
int decode_unicode_text;        // 1 if unicode text is decoded internally.
318
extern int decode_unicode_text;        // 1 if unicode text is decoded internally.
319
int internal_combine;           // 1 if multipart message is combined internally.
319
extern int internal_combine;           // 1 if multipart message is combined internally.
320
int internal_combine_binary;    // 1 if multipart binary message is combined internally. Defaults to internal_combine.
320
extern int internal_combine_binary;    // 1 if multipart binary message is combined internally. Defaults to internal_combine.
321
int keep_filename;              // 0 if unique filename is created to each directory when a message file is moved.
321
extern int keep_filename;              // 0 if unique filename is created to each directory when a message file is moved.
322
int store_original_filename;    // 1 if an original filename is saved to message file when it's moved from
322
extern int store_original_filename;    // 1 if an original filename is saved to message file when it's moved from
323
                                // outgoing directory to spooler. Works together with keep_filename.
323
// outgoing directory to spooler. Works together with keep_filename.
324
int date_filename;              // 1 or 2 if YYYYMMDD is included to the filename of incoming message.
324
extern int date_filename;              // 1 or 2 if YYYYMMDD is included to the filename of incoming message.
325
char regular_run[PATH_MAX];     // Script/program which is run regularly.
325
extern char regular_run[PATH_MAX];     // Script/program which is run regularly.
326
int regular_run_interval;       // Number of seconds between running a regular_run script/progdam.
326
extern int regular_run_interval;       // Number of seconds between running a regular_run script/progdam.
327
char admin_to[SIZE_TO];         // Destination number for administrative messages.
327
extern char admin_to[SIZE_TO];         // Destination number for administrative messages.
328
int filename_preview;           // Number of chars of message text to concatenate to filename.
328
extern int filename_preview;           // Number of chars of message text to concatenate to filename.
329
int incoming_utf8;              // 1 if incoming files are saved using UTF-8 character set.
329
extern int incoming_utf8;              // 1 if incoming files are saved using UTF-8 character set.
330
int outgoing_utf8;              // 1 if outgoing files are automatically converted from UTF-8 to ISO and GSM.
330
extern int outgoing_utf8;              // 1 if outgoing files are automatically converted from UTF-8 to ISO and GSM.
331
int log_charconv;               // 1 if character set conversion is logged.
331
extern int log_charconv;               // 1 if character set conversion is logged.
332
int log_single_lines;           // 1 if linefeeds are removed from the modem response to be logged.
332
extern int log_single_lines;           // 1 if linefeeds are removed from the modem response to be logged.
333
int executable_check;           // 0 if eventhandler and other executables are NOT checked during the startup checking.
333
extern int executable_check;           // 0 if eventhandler and other executables are NOT checked during the startup checking.
334
int keep_messages;              // For testing purposes: messages are not deleted and smsd stops after first run.
334
extern int keep_messages;              // For testing purposes: messages are not deleted and smsd stops after first run.
335
char priviledged_numbers[SIZE_PRIVILEDGED_NUMBERS]; // Priviledged numbers in incoming messages.
335
extern char priviledged_numbers[SIZE_PRIVILEDGED_NUMBERS]; // Priviledged numbers in incoming messages.
336
int ic_purge_hours;             // If internal_combine is used, concatenation storage is checked every ic_purge_interval minutes
336
extern int ic_purge_hours;             // If internal_combine is used, concatenation storage is checked every ic_purge_interval minutes
337
int ic_purge_minutes;           // and if there is message parts older than defined, they are handled or deleted.
337
extern int ic_purge_minutes;           // and if there is message parts older than defined, they are handled or deleted.
338
int ic_purge_read;              // 1 = message parts are stored as single messages. 0 = parts are just deleted.
338
extern int ic_purge_read;              // 1 = message parts are stored as single messages. 0 = parts are just deleted.
339
int ic_purge_interval;          // 
339
extern int ic_purge_interval;          //
340
char shell[PATH_MAX];           // Shell used to run eventhandler, defaults to /bin/sh
340
extern char shell[PATH_MAX];           // Shell used to run eventhandler, defaults to /bin/sh
341
char adminmessage_device[32];   // Name of device used to send administrative messages of mainspooler.
341
extern char adminmessage_device[32];   // Name of device used to send administrative messages of mainspooler.
342
int smart_logging;              // 1 = if loglevel is less than 7, degug log is written is there has been any errors.
342
extern int smart_logging;              // 1 = if loglevel is less than 7, degug log is written is there has been any errors.
343
int status_signal_quality;      // 1 = signal quality is written to status file.
343
extern int status_signal_quality;      // 1 = signal quality is written to status file.
344
int status_include_counters;    // 1 = succeeded, failed and received counters are included in the status line.
344
extern int status_include_counters;    // 1 = succeeded, failed and received counters are included in the status line.
345
int status_include_uptime;      // 3.1.16beta: 1 = include started & uptime line in the status file.
345
extern int status_include_uptime;      // 3.1.16beta: 1 = include started & uptime line in the status file.
346
int hangup_incoming_call;       // 1 = if detected unexpected input contains RING and we want to end call.
346
extern int hangup_incoming_call;       // 1 = if detected unexpected input contains RING and we want to end call.
347
int max_continuous_sending;     // Defines when sending is breaked to do check/do other tasks. Time in minutes.
347
extern int max_continuous_sending;     // Defines when sending is breaked to do check/do other tasks. Time in minutes.
348
int voicecall_hangup_ath;       // If ATH is used instead of AT+CHUP.
348
extern int voicecall_hangup_ath;       // If ATH is used instead of AT+CHUP.
349
349
350
// 3.1.5:
350
// 3.1.5:
351
int trust_outgoing;             // 1 = it's _sure_ that files are created by rename AND permissions are correct. Speeds up spooling.
351
extern int trust_outgoing;             // 1 = it's _sure_ that files are created by rename AND permissions are correct. Speeds up spooling.
352
352
353
// 3.1.5:
353
// 3.1.5:
354
int ignore_outgoing_priority;   // 1 = Priority: high header is not checked. Speeds up spooling.
354
extern int ignore_outgoing_priority;   // 1 = Priority: high header is not checked. Speeds up spooling.
355
355
356
// 3.1.7:
356
// 3.1.7:
357
int ignore_exec_output;         // 1 = stdout and stderr of eventhandlers is _not_ checked.
357
extern int ignore_exec_output;         // 1 = stdout and stderr of eventhandlers is _not_ checked.
358
358
359
// 3.1.7:
359
// 3.1.7:
360
mode_t conf_umask;              // File mode creation mask for smsd and modem processes.
360
extern mode_t conf_umask;              // File mode creation mask for smsd and modem processes.
361
361
362
// 3.1.7:
362
// 3.1.7:
363
int trim_text;                  // 1 = trailing whitespaces are removed from text:
363
extern int trim_text;                  // 1 = trailing whitespaces are removed from text:
364
364
365
// 3.1.7:
365
// 3.1.7:
366
int use_linux_ps_trick;         // 1 = change argv[0] to "smsd: MAINPROCESS", "smsd: GSM1" etc.
366
extern int use_linux_ps_trick;         // 1 = change argv[0] to "smsd: MAINPROCESS", "smsd: GSM1" etc.
367
367
368
// 3.1.7:
368
// 3.1.7:
369
int log_unmodified;
369
extern int log_unmodified;
370
370
371
// 3.1.7:
371
// 3.1.7:
372
char suspend_filename[PATH_MAX];
372
extern char suspend_filename[PATH_MAX];
373
373
374
// 3.1.9:
374
// 3.1.9:
375
int spool_directory_order;
375
extern int spool_directory_order;
376
376
377
// 3.1.9: 1 if read_from_modem is logged.
377
// 3.1.9: 1 if read_from_modem is logged.
378
int log_read_from_modem;
378
extern int log_read_from_modem;
379
379
380
// 3.1.16beta2: log_read_timing for performance tuning.
380
// 3.1.16beta2: log_read_timing for performance tuning.
381
int log_read_timing;
381
extern int log_read_timing;
382
382
383
// 3.1.16beta:
383
// 3.1.16beta:
384
int log_response_time;
384
extern int log_response_time;
385
385
386
// 3.1.16beta2:
386
// 3.1.16beta2:
387
int default_alphabet;
387
extern int default_alphabet;
388
388
389
// 3.1.17: Child process for the mainprocess:
389
// 3.1.17: Child process for the mainprocess:
390
char mainprocess_child[PATH_MAX];
390
extern char mainprocess_child[PATH_MAX];
391
char mainprocess_child_args[PATH_MAX];
391
extern char mainprocess_child_args[PATH_MAX];
392
392
393
// 3.1.17: Notifier for the mainprocess:
393
// 3.1.17: Notifier for the mainprocess:
394
int mainprocess_notifier;
394
extern int mainprocess_notifier;
395
395
396
// 3.1.17: If *_copy was made, evenhandler can use it instead of original file:
396
// 3.1.17: If *_copy was made, evenhandler can use it instead of original file:
397
int eventhandler_use_copy;
397
extern int eventhandler_use_copy;
398
398
399
// 3.1.17: This defines how long to sleep while looping:
399
// 3.1.17: This defines how long to sleep while looping:
400
int sleeptime_mainprocess;
400
extern int sleeptime_mainprocess;
401
401
402
// 3.1.17: Defines how often PID is checked to detect if another smsd is running:
402
// 3.1.17: Defines how often PID is checked to detect if another smsd is running:
403
int check_pid_interval;
403
extern int check_pid_interval;
404
404
405
// 3.1.18: start script/program for mainprocess:
405
// 3.1.18: start script/program for mainprocess:
406
char mainprocess_start[PATH_MAX];
406
extern char mainprocess_start[PATH_MAX];
407
char mainprocess_start_args[PATH_MAX];
407
extern char mainprocess_start_args[PATH_MAX];
408
408
409
int message_count;              // Counter for sent messages. Multipart message is one message.
409
extern int message_count;              // Counter for sent messages. Multipart message is one message.
410
410
411
volatile sig_atomic_t break_workless_delay; // To break the delay when SIGCONT is received.
411
extern volatile sig_atomic_t break_workless_delay; // To break the delay when SIGCONT is received.
412
volatile sig_atomic_t terminate; // To terminate when SIGTERM is received.
412
extern volatile sig_atomic_t terminate; // To terminate when SIGTERM is received.
413
413
414
char username[65];              // user and group name which are used to run.
414
extern char username[65];              // user and group name which are used to run.
415
char groupname[65];             // (max length is just a guess)
415
extern char groupname[65];             // (max length is just a guess)
416
416
417
char infofile[PATH_MAX];        // Hepler file for stopping the smsd smoothly.
417
extern char infofile[PATH_MAX];        // Hepler file for stopping the smsd smoothly.
418
char pidfile[PATH_MAX];         // File where a process id is stored.
418
extern char pidfile[PATH_MAX];         // File where a process id is stored.
419
419
420
// Command line arguments:
420
// Command line arguments:
421
char arg_username[65];
421
extern char arg_username[65];
422
char arg_groupname[65];
422
extern char arg_groupname[65];
423
char arg_infofile[PATH_MAX];
423
extern char arg_infofile[PATH_MAX];
424
char arg_pidfile[PATH_MAX];
424
extern char arg_pidfile[PATH_MAX];
425
char arg_logfile[PATH_MAX];
425
extern char arg_logfile[PATH_MAX];
426
int arg_terminal;
426
extern int arg_terminal;
427
// 3.1.7:
427
// 3.1.7:
428
char arg_7bit_packed[512];
428
extern char arg_7bit_packed[512];
429
int do_encode_decode_arg_7bit_packed;
429
extern int do_encode_decode_arg_7bit_packed;
430
430
431
int terminal;                   // 1 if smsd is communicating with terminal.
431
extern int terminal;                   // 1 if smsd is communicating with terminal.
432
pid_t device_pids[NUMBER_OF_MODEMS]; // Pid's of modem processes.
432
extern pid_t device_pids[NUMBER_OF_MODEMS]; // Pid's of modem processes.
433
char run_info[PATH_MAX];        // Information about external script/program execution.
433
extern char run_info[PATH_MAX];        // Information about external script/program execution.
434
434
435
char communicate[32];           // Device name for terminal communication mode.
435
extern char communicate[32];           // Device name for terminal communication mode.
436
436
437
char international_prefixes[PATH_MAX +1];
437
extern char international_prefixes[PATH_MAX +1];
438
char national_prefixes[PATH_MAX +1];
438
extern char national_prefixes[PATH_MAX +1];
439
439
440
// Storage for startup errors:
440
// Storage for startup errors:
441
char *startup_err_str;
441
extern char *startup_err_str;
442
int startup_err_count;
442
extern int startup_err_count;
443
443
444
// Storage for PDU's:
444
// Storage for PDU's:
445
char *incoming_pdu_store;
445
extern char *incoming_pdu_store;
446
char *outgoing_pdu_store;
446
extern char *outgoing_pdu_store;
447
char *routed_pdu_store;
447
extern char *routed_pdu_store;
448
448
449
// Storage for getfile errors:
449
// Storage for getfile errors:
450
char *getfile_err_store;
450
extern char *getfile_err_store;
451
451
452
// Text buffer for error messages:
452
// Text buffer for error messages:
453
char tb[SIZE_TB];
453
extern char tb[SIZE_TB];
454
454
455
// Buffer for SIM memory checking:
455
// Buffer for SIM memory checking:
456
char *check_memory_buffer;
456
extern char *check_memory_buffer;
457
size_t check_memory_buffer_size;
457
extern size_t check_memory_buffer_size;
458
458
459
int os_cygwin;                  // 1 if we are on Cygwin.
459
extern int os_cygwin;                  // 1 if we are on Cygwin.
460
460
461
char language_file[PATH_MAX];   // File name of translated headers.
461
extern char language_file[PATH_MAX];   // File name of translated headers.
462
char yes_chars[SIZE_HEADER];    // Characters which mean "yes" in the yesno() question.
462
extern char yes_chars[SIZE_HEADER];    // Characters which mean "yes" in the yesno() question.
463
char no_chars[SIZE_HEADER];     // See details inside read_translation() function.
463
extern char no_chars[SIZE_HEADER];     // See details inside read_translation() function.
464
char yes_word[SIZE_HEADER];     // "yes" printed as an output.
464
extern char yes_word[SIZE_HEADER];     // "yes" printed as an output.
465
char no_word[SIZE_HEADER];      // "no"
465
extern char no_word[SIZE_HEADER];      // "no"
466
char datetime_format[SIZE_HEADER]; // strftime format string for time stamps (not inside status reports).
466
extern char datetime_format[SIZE_HEADER]; // strftime format string for time stamps (not inside status reports).
467
char logtime_format[SIZE_HEADER]; // 3.1.7: strftime format string for logging time stamps
467
extern char logtime_format[SIZE_HEADER]; // 3.1.7: strftime format string for logging time stamps
468
char date_filename_format[SIZE_HEADER]; // 3.1.7: strftime format string for date_filename
468
extern char date_filename_format[SIZE_HEADER]; // 3.1.7: strftime format string for date_filename
469
int translate_incoming;         // 0 if incoming message headers are NOT transtaled.
469
extern int translate_incoming;         // 0 if incoming message headers are NOT transtaled.
470
470
471
// 3.1.14:
471
// 3.1.14:
472
int logtime_us;
472
extern int logtime_us;
473
int logtime_ms;
473
extern int logtime_ms;
474
474
475
// 3.1.14:
475
// 3.1.14:
476
int shell_test;
476
extern int shell_test;
477
477
478
// Next two are for debugging purposes:
478
// Next two are for debugging purposes:
479
int enable_smsd_debug;
479
extern int enable_smsd_debug;
480
char smsd_debug[SIZE_SMSD_DEBUG]; // Header of an outgoing message file.
480
extern char smsd_debug[SIZE_SMSD_DEBUG]; // Header of an outgoing message file.
481
481
482
// 3.1.20: Alt keys in communication mode:
482
// 3.1.20: Alt keys in communication mode:
483
#define COMMUNICATE_A_KEY_COUNT 10
483
#define COMMUNICATE_A_KEY_COUNT 10
484
char communicate_a_keys[COMMUNICATE_A_KEY_COUNT][256];
484
extern char communicate_a_keys[COMMUNICATE_A_KEY_COUNT][256];
485
485
486
/* initialize all variable with default values */
486
/* initialize all variable with default values */
487
487
(-)smstools.orig/src/smsd_cfg.c (+215 lines)
Lines 38-43 Link Here
38
#include "modeminit.h"
38
#include "modeminit.h"
39
#include "charshift.h"
39
#include "charshift.h"
40
40
41
42
/* global variables */
43
char process_title[32];         // smsd for main task, NOTIFIER or CHILD, name of a modem for other tasks.
44
int process_id;                 // -1 for main task, all modems have numbers starting with 0.
45
                                // This is the same as device, can be used like devices[process_id] if IS_MODEM_PROCESS.
46
47
time_t process_start_time;
48
49
int modem_handle;               // Handle for modem.
50
51
int put_command_timeouts;
52
unsigned long long put_command_sent; // 3.1.16beta.
53
char tmpdir[PATH_MAX];          // 3.1.16beta.
54
55
// NOTE for regular run intervals: effective value is at least delaytime.
56
57
char configfile[PATH_MAX];	// Path to config file
58
char d_spool[PATH_MAX];		// Spool directory
59
char d_failed[PATH_MAX];	// Failed spool directory
60
char d_failed_copy[PATH_MAX];	// 3.1.17.
61
char d_incoming[PATH_MAX];	// Incoming spool directory
62
char d_incoming_copy[PATH_MAX]; // 3.1.16beta2.
63
char d_report[PATH_MAX];	// Incoming report spool directory
64
char d_report_copy[PATH_MAX];	// 3.1.17.
65
char d_phonecalls[PATH_MAX];    // Incoming phonecalls data directory
66
char d_saved[PATH_MAX];         // Directory for smsd's internal use, concatenation storage files etc.
67
char d_sent[PATH_MAX];		// Sent spool directory
68
char d_sent_copy[PATH_MAX];	// 3.1.17.
69
char d_checked[PATH_MAX];	// Spool directory for checked messages (only used when no provider queues used)
70
char eventhandler[PATH_MAX];	// Global event handler program or script
71
char alarmhandler[PATH_MAX];	// Global alarm handler program or script
72
char checkhandler[PATH_MAX];    // Handler that checks if the sms file is valid.
73
int alarmlevel;			// Alarm Level (9=highest). Verbosity of alarm handler.
74
char logfile[PATH_MAX];		// Name or Handle of Log File
75
int  loglevel;			// Log Level (9=highest). Verbosity of log file.
76
_queue queues[NUMBER_OF_MODEMS]; // Queues
77
_device devices[NUMBER_OF_MODEMS]; // Modem devices
78
int delaytime;			// sleep-time after workless
79
int delaytime_mainprocess;      // sleep-time after workless, main process. If -1, delaytime is used.
80
int blocktime;			// sleep-time after multiple errors
81
int blockafter;                 // Block modem after n errors
82
int errorsleeptime;		// sleep-time after each error
83
int autosplit;			// Splitting of large text messages 0=no, 1=yes 2=number with text, 3=number with UDH
84
int receive_before_send;	// if 1 smsd tries to receive one message before sending
85
int store_received_pdu;         // 0=no, 1=unsupported pdu's only, 2=unsupported and 8bit/unicode, 3=all
86
int store_sent_pdu;             // 0=no, 1=failed pdu's only, 2=failed and 8bit/unicode, 3=all
87
int validity_period;            // Validity period for messages.
88
int decode_unicode_text;        // 1 if unicode text is decoded internally.
89
int internal_combine;           // 1 if multipart message is combined internally.
90
int internal_combine_binary;    // 1 if multipart binary message is combined internally. Defaults to internal_combine.
91
int keep_filename;              // 0 if unique filename is created to each directory when a message file is moved.
92
int store_original_filename;    // 1 if an original filename is saved to message file when it's moved from
93
                                // outgoing directory to spooler. Works together with keep_filename.
94
int date_filename;              // 1 or 2 if YYYYMMDD is included to the filename of incoming message.
95
char regular_run[PATH_MAX];     // Script/program which is run regularly.
96
int regular_run_interval;       // Number of seconds between running a regular_run script/progdam.
97
char admin_to[SIZE_TO];         // Destination number for administrative messages.
98
int filename_preview;           // Number of chars of message text to concatenate to filename.
99
int incoming_utf8;              // 1 if incoming files are saved using UTF-8 character set.
100
int outgoing_utf8;              // 1 if outgoing files are automatically converted from UTF-8 to ISO and GSM.
101
int log_charconv;               // 1 if character set conversion is logged.
102
int log_single_lines;           // 1 if linefeeds are removed from the modem response to be logged.
103
int executable_check;           // 0 if eventhandler and other executables are NOT checked during the startup checking.
104
int keep_messages;              // For testing purposes: messages are not deleted and smsd stops after first run.
105
char priviledged_numbers[SIZE_PRIVILEDGED_NUMBERS]; // Priviledged numbers in incoming messages.
106
int ic_purge_hours;             // If internal_combine is used, concatenation storage is checked every ic_purge_interval minutes
107
int ic_purge_minutes;           // and if there is message parts older than defined, they are handled or deleted.
108
int ic_purge_read;              // 1 = message parts are stored as single messages. 0 = parts are just deleted.
109
int ic_purge_interval;          //
110
char shell[PATH_MAX];           // Shell used to run eventhandler, defaults to /bin/sh
111
char adminmessage_device[32];   // Name of device used to send administrative messages of mainspooler.
112
int smart_logging;              // 1 = if loglevel is less than 7, degug log is written is there has been any errors.
113
int status_signal_quality;      // 1 = signal quality is written to status file.
114
int status_include_counters;    // 1 = succeeded, failed and received counters are included in the status line.
115
int status_include_uptime;      // 3.1.16beta: 1 = include started & uptime line in the status file.
116
int hangup_incoming_call;       // 1 = if detected unexpected input contains RING and we want to end call.
117
int max_continuous_sending;     // Defines when sending is breaked to do check/do other tasks. Time in minutes.
118
int voicecall_hangup_ath;       // If ATH is used instead of AT+CHUP.
119
120
// 3.1.5:
121
int trust_outgoing;             // 1 = it's _sure_ that files are created by rename AND permissions are correct. Speeds up spooling.
122
123
// 3.1.5:
124
int ignore_outgoing_priority;   // 1 = Priority: high header is not checked. Speeds up spooling.
125
126
// 3.1.7:
127
int ignore_exec_output;         // 1 = stdout and stderr of eventhandlers is _not_ checked.
128
129
// 3.1.7:
130
mode_t conf_umask;              // File mode creation mask for smsd and modem processes.
131
132
// 3.1.7:
133
int trim_text;                  // 1 = trailing whitespaces are removed from text:
134
135
// 3.1.7:
136
int use_linux_ps_trick;         // 1 = change argv[0] to "smsd: MAINPROCESS", "smsd: GSM1" etc.
137
138
// 3.1.7:
139
int log_unmodified;
140
141
// 3.1.7:
142
char suspend_filename[PATH_MAX];
143
144
// 3.1.9:
145
int spool_directory_order;
146
147
// 3.1.9: 1 if read_from_modem is logged.
148
int log_read_from_modem;
149
150
// 3.1.16beta2: log_read_timing for performance tuning.
151
int log_read_timing;
152
153
// 3.1.16beta:
154
int log_response_time;
155
156
// 3.1.16beta2:
157
int default_alphabet;
158
159
// 3.1.17: Child process for the mainprocess:
160
char mainprocess_child[PATH_MAX];
161
char mainprocess_child_args[PATH_MAX];
162
163
// 3.1.17: Notifier for the mainprocess:
164
int mainprocess_notifier;
165
166
// 3.1.17: If *_copy was made, evenhandler can use it instead of original file:
167
int eventhandler_use_copy;
168
169
// 3.1.17: This defines how long to sleep while looping:
170
int sleeptime_mainprocess;
171
172
// 3.1.17: Defines how often PID is checked to detect if another smsd is running:
173
int check_pid_interval;
174
175
// 3.1.18: start script/program for mainprocess:
176
char mainprocess_start[PATH_MAX];
177
char mainprocess_start_args[PATH_MAX];
178
179
int message_count;              // Counter for sent messages. Multipart message is one message.
180
181
volatile sig_atomic_t break_workless_delay; // To break the delay when SIGCONT is received.
182
volatile sig_atomic_t terminate; // To terminate when SIGTERM is received.
183
184
char username[65];              // user and group name which are used to run.
185
char groupname[65];             // (max length is just a guess)
186
187
char infofile[PATH_MAX];        // Hepler file for stopping the smsd smoothly.
188
char pidfile[PATH_MAX];         // File where a process id is stored.
189
190
// Command line arguments:
191
char arg_username[65];
192
char arg_groupname[65];
193
char arg_infofile[PATH_MAX];
194
char arg_pidfile[PATH_MAX];
195
char arg_logfile[PATH_MAX];
196
int arg_terminal;
197
// 3.1.7:
198
char arg_7bit_packed[512];
199
int do_encode_decode_arg_7bit_packed;
200
201
int terminal;                   // 1 if smsd is communicating with terminal.
202
pid_t device_pids[NUMBER_OF_MODEMS]; // Pid's of modem processes.
203
char run_info[PATH_MAX];        // Information about external script/program execution.
204
205
char communicate[32];           // Device name for terminal communication mode.
206
207
char international_prefixes[PATH_MAX +1];
208
char national_prefixes[PATH_MAX +1];
209
210
// Storage for startup errors:
211
char *startup_err_str;
212
int startup_err_count;
213
214
// Storage for PDU's:
215
char *incoming_pdu_store;
216
char *outgoing_pdu_store;
217
char *routed_pdu_store;
218
219
// Storage for getfile errors:
220
char *getfile_err_store;
221
222
// Text buffer for error messages:
223
char tb[SIZE_TB];
224
225
// Buffer for SIM memory checking:
226
char *check_memory_buffer;
227
size_t check_memory_buffer_size;
228
229
int os_cygwin;                  // 1 if we are on Cygwin.
230
231
char language_file[PATH_MAX];   // File name of translated headers.
232
char yes_chars[SIZE_HEADER];    // Characters which mean "yes" in the yesno() question.
233
char no_chars[SIZE_HEADER];     // See details inside read_translation() function.
234
char yes_word[SIZE_HEADER];     // "yes" printed as an output.
235
char no_word[SIZE_HEADER];      // "no"
236
char datetime_format[SIZE_HEADER]; // strftime format string for time stamps (not inside status reports).
237
char logtime_format[SIZE_HEADER]; // 3.1.7: strftime format string for logging time stamps
238
char date_filename_format[SIZE_HEADER]; // 3.1.7: strftime format string for date_filename
239
int translate_incoming;         // 0 if incoming message headers are NOT transtaled.
240
241
// 3.1.14:
242
int logtime_us;
243
int logtime_ms;
244
245
// 3.1.14:
246
int shell_test;
247
248
// Next two are for debugging purposes:
249
int enable_smsd_debug;
250
char smsd_debug[SIZE_SMSD_DEBUG]; // Header of an outgoing message file.
251
252
// 3.1.20: Alt keys in communication mode:
253
#define COMMUNICATE_A_KEY_COUNT 10
254
char communicate_a_keys[COMMUNICATE_A_KEY_COUNT][256];
255
41
char *msg_dir = "%s directory %s cannot be opened.";
256
char *msg_dir = "%s directory %s cannot be opened.";
42
char *msg_file = "%s directory %s is not writable.";
257
char *msg_file = "%s directory %s is not writable.";
43
char *msg_not_executable = "is not executable for smsd.";
258
char *msg_not_executable = "is not executable for smsd.";
(-)smstools.orig/src/logging.c (+10 lines)
Lines 25-30 Link Here
25
#include "smsd_cfg.h"
25
#include "smsd_cfg.h"
26
#include "stats.h"
26
#include "stats.h"
27
27
28
29
// 3.1.16beta2: Moved logch() and prch() from charset.c to logging.c:
30
char logch_buffer[8192];
31
32
char prch(char ch);
33
34
// 3.1.16beta: changed type:
35
//int trouble_logging_started;
36
time_t trouble_logging_started;
37
28
int Filehandle = -1;
38
int Filehandle = -1;
29
int Level;
39
int Level;
30
int SavedLevel;
40
int SavedLevel;
(-)smstools.orig/src/logging.h (-3 / +3 lines)
Lines 18-24 Link Here
18
#include <time.h>
18
#include <time.h>
19
19
20
// 3.1.16beta2: Moved logch() and prch() from charset.c to logging.c:
20
// 3.1.16beta2: Moved logch() and prch() from charset.c to logging.c:
21
char logch_buffer[8192];
21
extern char logch_buffer[8192];
22
22
23
#ifdef __GNUC__
23
#ifdef __GNUC__
24
void logch(char* format, ...) __attribute__ ((format(printf, 1, 2)));
24
void logch(char* format, ...) __attribute__ ((format(printf, 1, 2)));
Lines 26-36 Link Here
26
void logch(char* format, ...);
26
void logch(char* format, ...);
27
#endif
27
#endif
28
28
29
char prch(char ch);
29
extern char prch(char ch);
30
30
31
// 3.1.16beta: changed type:
31
// 3.1.16beta: changed type:
32
//int trouble_logging_started;
32
//int trouble_logging_started;
33
time_t trouble_logging_started;
33
extern time_t trouble_logging_started;
34
34
35
int change_loglevel(int new_level);
35
int change_loglevel(int new_level);
36
void restore_loglevel();
36
void restore_loglevel();
(-)smstools.orig/src/stats.c (+14 lines)
Lines 29-34 Link Here
29
#include <mm.h>
29
#include <mm.h>
30
#endif
30
#endif
31
31
32
33
_stats* statistics[NUMBER_OF_MODEMS]; // Statistic data (shared memory!)
34
int rejected_counter;		// Statistic counter, rejected SM, number does not fit into any queue
35
time_t start_time;		// Start time of smsd, allows statistic functions
36
int printstatus;		// if 1 smsd outputs status on stdout
37
time_t last_stats;		// time when the last stats file was created
38
char d_stats[PATH_MAX];		// path to statistic files
39
int stats_interval;		// time between statistic files in seconds.
40
int stats_no_zeroes;		// Suppress files that contain only zeroes
41
int status_interval;            // time between updating status file in seconds
42
43
char *shared_buffer;
44
45
32
char newstatus[NUMBER_OF_MODEMS +1] = {0};
46
char newstatus[NUMBER_OF_MODEMS +1] = {0};
33
char oldstatus[NUMBER_OF_MODEMS +1] = {0};
47
char oldstatus[NUMBER_OF_MODEMS +1] = {0};
34
48
(-)smstools.orig/src/stats.h (-10 / +10 lines)
Lines 33-49 Link Here
33
  int ber;
33
  int ber;
34
} _stats;
34
} _stats;
35
35
36
_stats* statistics[NUMBER_OF_MODEMS]; // Statistic data (shared memory!)
36
extern _stats* statistics[NUMBER_OF_MODEMS]; // Statistic data (shared memory!)
37
int rejected_counter;		// Statistic counter, rejected SM, number does not fit into any queue
37
extern int rejected_counter;		// Statistic counter, rejected SM, number does not fit into any queue
38
time_t start_time;		// Start time of smsd, allows statistic functions
38
extern time_t start_time;		// Start time of smsd, allows statistic functions
39
int printstatus;		// if 1 smsd outputs status on stdout
39
extern int printstatus;		// if 1 smsd outputs status on stdout
40
time_t last_stats;		// time when the last stats file was created
40
extern time_t last_stats;		// time when the last stats file was created
41
char d_stats[PATH_MAX];		// path to statistic files
41
extern char d_stats[PATH_MAX];		// path to statistic files
42
int stats_interval;		// time between statistic files in seconds.
42
extern int stats_interval;		// time between statistic files in seconds.
43
int stats_no_zeroes;		// Suppress files that contain only zeroes
43
extern int stats_no_zeroes;		// Suppress files that contain only zeroes
44
int status_interval;            // time between updating status file in seconds
44
extern int status_interval;            // time between updating status file in seconds
45
45
46
char *shared_buffer;
46
extern char *shared_buffer;
47
47
48
/* Creates shared memory variables for statistic data */
48
/* Creates shared memory variables for statistic data */
49
49
(-)smstools.orig/src/blacklist.c (+2 lines)
Lines 23-28 Link Here
23
#include "alarm.h"
23
#include "alarm.h"
24
#include "smsd_cfg.h"
24
#include "smsd_cfg.h"
25
25
26
char blacklist[256];     // Filename of the black-list
27
26
int inblacklist(char* msisdn)
28
int inblacklist(char* msisdn)
27
{
29
{
28
  FILE* file;
30
  FILE* file;
(-)smstools.orig/src/blacklist.h (-1 / +1 lines)
Lines 15-21 Link Here
15
#ifndef BLACK_H
15
#ifndef BLACK_H
16
#define BLACK_H
16
#define BLACK_H
17
17
18
char blacklist[256];	// Filename of the black-list
18
extern char blacklist[256];	// Filename of the black-list
19
19
20
int inblacklist(char* msisdn);
20
int inblacklist(char* msisdn);
21
21
(-)smstools.orig/src/whitelist.c (+2 lines)
Lines 23-28 Link Here
23
#include "alarm.h"
23
#include "alarm.h"
24
#include "smsd_cfg.h"
24
#include "smsd_cfg.h"
25
25
26
char whitelist[256];     // Filename of the white-list
27
26
/* Used with >= 3.1x */
28
/* Used with >= 3.1x */
27
int inwhitelist_q(char* msisdn, char *queuename)
29
int inwhitelist_q(char* msisdn, char *queuename)
28
{
30
{
(-)smstools.orig/src/whitelist.h (-1 / +1 lines)
Lines 15-21 Link Here
15
#ifndef WHITE_H
15
#ifndef WHITE_H
16
#define WHITE_H
16
#define WHITE_H
17
17
18
char whitelist[256];	// Filename of the white-list
18
extern char whitelist[256];	// Filename of the white-list
19
19
20
/* Used with >= 3.1x */
20
/* Used with >= 3.1x */
21
int inwhitelist_q(char* msisdn, char *queuename);
21
int inwhitelist_q(char* msisdn, char *queuename);

Return to bug 708512