@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
- cd $(srcdir) && $(AUTOMAKE) --gnu \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu Makefile
+ $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
-#include <mISDNif.h>
+#include <mISDN/mISDNif.h>
#include <mISDN/mISDNcompat.h>
int __af_isdn = MISDN_AF_ISDN;
int load_module(void)
{
u_short i;
+ char options_error[256];
for (i = 0; i < 256; i++) {
flip_bits[i] = (i>>7) | ((i>>5)&2) | ((i>>3)&4) | ((i>>1)&8)
| (i<<7) | ((i&2)<<5) | ((i&4)<<3) | ((i&8)<<1);
}
- if (read_options() == 0) {
+ if (read_options(options_error) == 0) {
CERROR(NULL, NULL, "%s", options_error);
#ifdef LCR_FOR_ASTERISK
struct extension ext;
char pathname[256];
FILE *fp;
+ char options_error[256];
- if (!read_options()) {
+ if (!read_options(options_error)) {
PERROR("%s", options_error);
return(-1);
}
#include "gsm_audio.h"
-#undef AF_ISDN
-#undef PF_ISDN
-extern int AF_ISDN;
-#define PF_ISDN AF_ISDN
}
+#include <mISDN/mISDNcompat.h>
struct lcr_gsm *gsm = NULL;
char hlr[128], cfg[128], filename[128];
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
int pcapfd, rc;
+ char conf_error[128] = "";
+
debug_init();
tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc");
gsm->gsm_sock = -1;
/* parse options */
- if (!gsm_conf(&gsm->conf)) {
- PERROR("%s", gsm_conf_error);
+ if (!gsm_conf(&gsm->conf, conf_error)) {
+ PERROR("%s", conf_error);
return gsm_exit(-EINVAL);
}
int message_epoint(unsigned int epoint_id, int message_id, union parameter *param);
};
-extern char *gsm_conf_error;
-int gsm_conf(struct gsm_conf *gsm_conf);
+int gsm_conf(struct gsm_conf *gsm_conf, char *conf_error);
int handle_gsm(void);
int gsm_exit(int rc);
int gsm_init(void);
#include "main.h"
-char *gsm_conf_error = (char *)"";
-
/* read options
*
* read options from options.conf
*/
-int gsm_conf(struct gsm_conf *gsm_conf)
+int gsm_conf(struct gsm_conf *gsm_conf, char *conf_error)
{
FILE *fp=NULL;
char filename[128];
SPRINT(filename, "%s/gsm.conf", CONFIG_DATA);
if (!(fp=fopen(filename,"r"))) {
- SPRINT(gsm_conf_error, "Cannot open %s\n",filename);
+ UPRINT(conf_error, "Cannot open %s\n",filename);
return(0);
}
i=0; /* read option */
while(*p > 32) {
if (i+1 >= sizeof(option)) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): option too long.\n",filename,line);
+ UPRINT(conf_error, "Error in %s (line %d): option too long.\n",filename,line);
goto error;
}
option[i+1] = '\0';
i=0; /* read param */
while(*p > 32) {
if (i+1 >= sizeof(params[pnum])) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): param too long.\n",filename,line);
+ UPRINT(conf_error, "Error in %s (line %d): param too long.\n",filename,line);
goto error;
}
params[pnum][i+1] = '\0';
/* check option */
if (!strcmp(option,"debug")) {
if (params[0][0]==0) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
+ UPRINT(conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
goto error;
}
SCPY(gsm_conf->debug, params[0]);
} else
if (!strcmp(option,"interface-bsc")) {
if (params[0][0]==0) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
+ UPRINT(conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
goto error;
}
SCPY(gsm_conf->interface_bsc, params[0]);
} else
if (!strcmp(option,"interface-lcr")) {
if (params[0][0]==0) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
+ UPRINT(conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
goto error;
}
SCPY(gsm_conf->interface_lcr, params[0]);
} else
if (!strcmp(option,"config")) {
if (params[0][0]==0) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
+ UPRINT(conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
goto error;
}
SCPY(gsm_conf->openbsc_cfg, params[0]);
} else
if (!strcmp(option,"hlr")) {
if (params[0][0]==0) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
+ UPRINT(conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
goto error;
}
SCPY(gsm_conf->hlr, params[0]);
} else
if (!strcmp(option,"reject-cause")) {
- SPRINT(gsm_conf_error, "Option '%s' in gsm.conf has moved to openbsc.cfg", option);
+ UPRINT(conf_error, "Option '%s' in gsm.conf has moved to openbsc.cfg", option);
goto error;
} else
if (!strcmp(option,"allow-all")) {
} else
if (!strcmp(option,"pcapfile")) {
if (params[0][0]==0) {
- SPRINT(gsm_conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
+ UPRINT(conf_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
goto error;
}
SCPY(gsm_conf->pcapfile, params[0]);
} else {
- SPRINT(gsm_conf_error, "Error in %s (line %d): wrong option keyword %s.\n", filename,line,option);
+ UPRINT(conf_error, "Error in %s (line %d): wrong option keyword %s.\n", filename,line,option);
goto error;
}
}
int sock, conn;
struct sockaddr_un sock_address;
const char *ret = "invalid mode";
-
+ char options_error[256];
/* show options */
if (argc <= 1) {
goto usage;
}
- if (read_options() == 0) {
+ if (read_options(options_error) == 0) {
exit(EXIT_FAILURE);
}
created_lock = 0, created_signal = 0, created_debug = 0,
created_misdn = 0;
char tracetext[256], lock[128];
+ char options_error[256];
#if 0
/* init fdset */
}
/* read options */
- if (read_options() == 0) {
+ if (read_options(options_error) == 0) {
PERROR("%s", options_error);
goto free;
}
*
* read options from options.conf
*/
-int read_options(void)
+int read_options(char *options_error)
{
FILE *fp=NULL;
char filename[128];
SPRINT(filename, "%s/options.conf", CONFIG_DATA);
if (!(fp=fopen(filename,"r"))) {
- SPRINT(options_error, "Cannot open %s\n",filename);
+ UPRINT(options_error, "Cannot open %s\n",filename);
return(0);
}
i=0; /* read option */
while(*p > 32) {
if (i+1 >= sizeof(option)) {
- SPRINT(options_error, "Error in %s (line %d): option too long.\n",filename,line);
+ UPRINT(options_error, "Error in %s (line %d): option too long.\n",filename,line);
goto error;
}
option[i+1] = '\0';
i=0; /* read param */
while(*p > 31) {
if (i+1 >= sizeof(param)) {
- SPRINT(options_error, "Error in %s (line %d): param too long.\n",filename,line);
+ UPRINT(options_error, "Error in %s (line %d): param too long.\n",filename,line);
goto error;
}
param[i+1] = '\0';
/* check option */
if (!strcmp(option,"nt_if") || !strcmp(option,"te_if")) {
- SPRINT(options_error, "Error in %s (line %d): obsolete option %s. Use multiple 'port' options to define ports to use.\n",filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): obsolete option %s. Use multiple 'port' options to define ports to use.\n",filename,line,option);
goto error;
} else
if (!strcmp(option,"debug")) {
if (param[0]==0) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
goto error;
}
options.deb = strtol(param, NULL, 0);
} else
if (!strcmp(option,"log")) {
if (param[0]==0) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line, option);
goto error;
}
SCPY(options.log, param);
} else
if (!strcmp(option,"tones_dir")) {
if (param[0]==0) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
goto error;
}
if (param[strlen(param)-1] == '/')
} else
if (!strcmp(option,"fetch_tones")) {
if (param[0]==0) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
goto error;
}
if (param[strlen(param)-1] == '/')
} else
if (!strcmp(option,"dsptones")) {
- SPRINT(options_error, "Error in %s (line %d): parameter 'dsptones' is obsolete. Just define the tones (american,german,oldgerman) at 'tones_dir' option.\n",filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter 'dsptones' is obsolete. Just define the tones (american,german,oldgerman) at 'tones_dir' option.\n",filename,line);
goto error;
} else
if (!strcmp(option,"schedule")) {
options.schedule = atoi(param);
if (options.schedule < 0) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s must be at least '0'.\n", filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s must be at least '0'.\n", filename,line,option);
goto error;
}
if (options.schedule > 99) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s must be '99' or less.\n", filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s must be '99' or less.\n", filename,line,option);
goto error;
}
} else
if (!strcmp(option,"email")) {
if (param[0]==0) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n", filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n", filename,line,option);
goto error;
}
SCPY(options.email, param);
} else
if (!strcmp(option,"lock")) {
if (param[0]==0) {
- SPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): parameter for option %s missing.\n",filename,line,option);
goto error;
}
if (param[strlen(param)-1] == '/')
if (*endptr != '\0') {
struct passwd * pwd = getpwnam(param);
if (pwd == NULL) {
- SPRINT(options_error, "Error in %s (line %d): no such user: %s.\n",filename,line,param);
+ UPRINT(options_error, "Error in %s (line %d): no such user: %s.\n",filename,line,param);
goto error;
}
options.socketuser = pwd->pw_uid;
if (*endptr != '\0') {
struct group * grp = getgrnam(param);
if (grp == NULL) {
- SPRINT(options_error, "Error in %s (line %d): no such group: %s.\n",filename,line,param);
+ UPRINT(options_error, "Error in %s (line %d): no such group: %s.\n",filename,line,param);
goto error;
}
options.socketgroup = grp->gr_gid;
if (!strcmp(option,"gsm")) {
options.gsm = 1;
} else {
- SPRINT(options_error, "Error in %s (line %d): wrong option keyword %s.\n", filename,line,option);
+ UPRINT(options_error, "Error in %s (line %d): wrong option keyword %s.\n", filename,line,option);
goto error;
}
}
if (!options.tones_dir[0]) {
- SPRINT(options_error, "Error in %s (line %d): option 'tones_dir' with parameter missing.\n", filename);
+ UPRINT(options_error, "Error in %s (line %d): option 'tones_dir' with parameter missing.\n", filename,line);
goto error;
}
if (fp) fclose(fp);
extern struct options options;
-extern char options_error[256];
-
-int read_options(void);
+int read_options(char *options_error);
#ifdef __cplusplus
}