|
@@ -70,13 +70,11 @@ int isflagset( struct sip_msg* msg, flag_t flag ) {
|
|
|
|
|
|
int flag_in_range( flag_t flag ) {
|
|
int flag_in_range( flag_t flag ) {
|
|
if (flag > MAX_FLAG ) {
|
|
if (flag > MAX_FLAG ) {
|
|
- LOG(L_ERR, "ERROR: message flag %d too high; MAX=%d\n",
|
|
|
|
- flag, MAX_FLAG );
|
|
|
|
|
|
+ LM_ERR("message flag %d too high; MAX=%d\n", flag, MAX_FLAG );
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
if ((int)flag<0) {
|
|
if ((int)flag<0) {
|
|
- LOG(L_ERR, "ERROR: message flag (%d) must be in range %d..%d\n",
|
|
|
|
- flag, 0, MAX_FLAG );
|
|
|
|
|
|
+ LM_ERR("message flag (%d) must be in range 0..%d\n", flag, MAX_FLAG );
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
return 1;
|
|
return 1;
|
|
@@ -152,8 +150,7 @@ int check_flag(int n)
|
|
if (!flag_in_range(n))
|
|
if (!flag_in_range(n))
|
|
return -1;
|
|
return -1;
|
|
if (registered_flags[n]){
|
|
if (registered_flags[n]){
|
|
- LOG(L_WARN, "WARNING: check_flag: flag %d is already used by "
|
|
|
|
- " a named flag\n", n);
|
|
|
|
|
|
+ LM_WARN("flag %d is already used by a named flag\n", n);
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -219,20 +216,18 @@ int register_flag(char* name, int pos)
|
|
/* check if the name already exists */
|
|
/* check if the name already exists */
|
|
e=flag_search(&name2flags[h], name, len);
|
|
e=flag_search(&name2flags[h], name, len);
|
|
if (e){
|
|
if (e){
|
|
- LOG(L_ERR, "ERROR: register_flag: flag %.*s already registered\n",
|
|
|
|
- len, name);
|
|
|
|
|
|
+ LM_ERR("flag %.*s already registered\n", len, name);
|
|
return -2;
|
|
return -2;
|
|
}
|
|
}
|
|
/* check if there is already another flag registered at pos */
|
|
/* check if there is already another flag registered at pos */
|
|
if (pos!=-1){
|
|
if (pos!=-1){
|
|
if ((pos<0) || (pos>MAX_FLAG)){
|
|
if ((pos<0) || (pos>MAX_FLAG)){
|
|
- LOG(L_ERR, "ERROR: register_flag: invalid flag %.*s "
|
|
|
|
- "position(%d)\n", len, name, pos);
|
|
|
|
|
|
+ LM_ERR("invalid flag %.*s position(%d)\n", len, name, pos);
|
|
return -4;
|
|
return -4;
|
|
}
|
|
}
|
|
if (registered_flags[pos]!=0){
|
|
if (registered_flags[pos]!=0){
|
|
- LOG(L_WARN, "WARNING: register_flag: %.*s: flag %d already in "
|
|
|
|
- "use under another name\n", len, name, pos);
|
|
|
|
|
|
+ LM_WARN("%.*s: flag %d already in use under another name\n",
|
|
|
|
+ len, name, pos);
|
|
/* continue */
|
|
/* continue */
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
@@ -246,8 +241,7 @@ int register_flag(char* name, int pos)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (pos==-1){
|
|
if (pos==-1){
|
|
- LOG(L_ERR, "ERROR: register_flag: could not register %.*s"
|
|
|
|
- " - too many flags\n", len, name);
|
|
|
|
|
|
+ LM_ERR("could not register %.*s - too many flags\n", len, name);
|
|
return -5;
|
|
return -5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -255,7 +249,7 @@ int register_flag(char* name, int pos)
|
|
|
|
|
|
e=pkg_malloc(sizeof(struct flag_entry));
|
|
e=pkg_malloc(sizeof(struct flag_entry));
|
|
if (e==0){
|
|
if (e==0){
|
|
- LOG(L_ERR, "ERROR: register_flag: memory allocation failure\n");
|
|
|
|
|
|
+ LM_ERR("memory allocation failure\n");
|
|
return -3;
|
|
return -3;
|
|
}
|
|
}
|
|
e->name.s=name;
|
|
e->name.s=name;
|
|
@@ -279,8 +273,7 @@ static int fixup_t_flag(void** param, int param_no)
|
|
DBG("DEBUG: fixing flag: %s\n", (char *) (*param));
|
|
DBG("DEBUG: fixing flag: %s\n", (char *) (*param));
|
|
|
|
|
|
if (param_no!=1) {
|
|
if (param_no!=1) {
|
|
- LOG(L_ERR, "ERROR: TM module: only parameter #1 for flags can be"
|
|
|
|
- " fixed\n");
|
|
|
|
|
|
+ LM_ERR("TM module: only parameter #1 for flags can be fixed\n");
|
|
return E_BUG;
|
|
return E_BUG;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -305,7 +298,7 @@ static int fixup_t_flag(void** param, int param_no)
|
|
while ( *c && *c>='0' && *c<='9' ) {
|
|
while ( *c && *c>='0' && *c<='9' ) {
|
|
*code = *code*10+ *c-'0';
|
|
*code = *code*10+ *c-'0';
|
|
if (*code > (sizeof( flag_t ) * CHAR_BIT - 1 )) {
|
|
if (*code > (sizeof( flag_t ) * CHAR_BIT - 1 )) {
|
|
- LOG(L_ERR, "ERROR: TM module: too big flag number: %s; MAX=%d\n",
|
|
|
|
|
|
+ LM_ERR("TM module: too big flag number: %s; MAX=%d\n",
|
|
(char *) (*param), sizeof( flag_t ) * CHAR_BIT - 1 );
|
|
(char *) (*param), sizeof( flag_t ) * CHAR_BIT - 1 );
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
@@ -315,12 +308,12 @@ static int fixup_t_flag(void** param, int param_no)
|
|
while ( *c && (*c==' ' || *c=='\t')) c++; /* terminating whitespaces */
|
|
while ( *c && (*c==' ' || *c=='\t')) c++; /* terminating whitespaces */
|
|
|
|
|
|
if ( *code == 0 ) {
|
|
if ( *code == 0 ) {
|
|
- LOG(L_ERR, "ERROR: TM module: bad flag number: %s\n", (char *) (*param));
|
|
|
|
|
|
+ LM_ERR("TM module: bad flag number: %s\n", (char *) (*param));
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
|
|
|
|
if (*code < FL_MAX && token==0) {
|
|
if (*code < FL_MAX && token==0) {
|
|
- LOG(L_ERR, "ERROR: TM module: too high flag number: %s (%d)\n; lower number"
|
|
|
|
|
|
+ LM_ERR("TM module: too high flag number: %s (%d)\n; lower number"
|
|
" bellow %d reserved\n", (char *) (*param), *code, FL_MAX );
|
|
" bellow %d reserved\n", (char *) (*param), *code, FL_MAX );
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|