aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorLars Roland <Lars.Roland@gmx.net>2005-01-07 18:07:18 +0000
committerLars Roland <Lars.Roland@gmx.net>2005-01-07 18:07:18 +0000
commit603c9edd8343c5234105cd8eafaedf8059c67f82 (patch)
treec9cddbda7dae4b962c3cf0ab0c94bf957b3b0c3a /plugins
parent02520bcf9c156a31db609600b395b4af799405a4 (diff)
From Luis Ontanon:
A new patch for mate - changed the default config file name to "" - avoid trying to confgure mate when the config filename is "" - add filename and line to config errors, that way one can actually find errors in config files - teady up the config error strings ( made them uniform ) - fixed a crash when missing index AVPs (Name,For,On etc) in config AVPLS - make sure we do not delete the config AVPs and AVPLs to avoid references to unsubscribed strings been left arround - fixed the len on LoALs - changed the way loal_from_file reports an error. - matelib/sip.mate was missing the Name in a PduDef (from Julien Leproust) - matelib/h225_ras had a wrong field name (from Julien Leproust) At this point mate is silent when it's not expressely configured by the user. From me: reduce compiler noise on MSVC svn path=/trunk/; revision=12985
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mate/Makefile.nmake6
-rw-r--r--plugins/mate/mate_setup.c212
-rw-r--r--plugins/mate/mate_util.c51
-rw-r--r--plugins/mate/matelib/h225_ras.mate2
-rw-r--r--plugins/mate/matelib/sip.mate2
-rw-r--r--plugins/mate/packet-mate.c21
6 files changed, 144 insertions, 150 deletions
diff --git a/plugins/mate/Makefile.nmake b/plugins/mate/Makefile.nmake
index e627b24a5b..9dbb83ddf1 100644
--- a/plugins/mate/Makefile.nmake
+++ b/plugins/mate/Makefile.nmake
@@ -3,12 +3,16 @@
#
include ..\..\config.nmake
+include <win32.mak>
############### no need to modify below this line #########
CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
-
+
+.c.obj::
+ $(CC) $(CFLAGS) -Fdmate.pdb -c $<
+
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
!IFDEF LINK_PLUGINS_WITH_LIBETHEREAL
diff --git a/plugins/mate/mate_setup.c b/plugins/mate/mate_setup.c
index a9ff8ff4d2..5b218d166a 100644
--- a/plugins/mate/mate_setup.c
+++ b/plugins/mate/mate_setup.c
@@ -28,7 +28,7 @@
static int* dbg;
-static int dbg_cfg_lvl = 1;
+static int dbg_cfg_lvl = 0;
static int* dbg_cfg = &dbg_cfg_lvl;
FILE* dbg_facility;
@@ -258,55 +258,34 @@ extern void destroy_mate_config(mate_config* mc , gboolean avplib_too) {
}
-
-/* a configuration error */
-static void mate_config_error(LoAL* loal _U_ ,guint8* line _U_ , guint8* fmt, ...) {
- va_list list;
- guint8* desc;
-
- va_start( list, fmt );
- desc = g_strdup_vprintf(fmt, list);
- va_end( list );
-
- dbg_print (dbg,0,dbg_facility,"mate_config_error: %s",desc);
-
- g_warning(desc);
- g_free(desc);
-
-}
-
-
static gboolean mate_load_config(guint8* filename) {
LoAL* loal = loal_from_file(filename);
AVPL* avpl;
- guint8* line = NULL;
config_action* action;
guint8* name;
-
- if (loal) {
- while(( avpl = extract_first_avpl(loal) )) {
- line = avpl_to_str(avpl);
-
- dbg_print (dbg_cfg,3,dbg_facility,"mate_make_config: current line: %s",line);
-
- action = lookup_using_index_avp(avpl, KEYWORD_ACTION, actions,&name);
-
- if (action) {
- if ( ! action(avpl) ) {
- mate_config_error(loal,line,"mate: Error on AVPL: '%s'",name);
+
+ /* FIXME: we are leaking the config avpls to avoid unsubscribed strings left arround */
+
+ if (loal->len) {
+ while(( avpl = extract_first_avpl(loal) )) {
+ dbg_print (dbg_cfg,3,dbg_facility,"mate_make_config: current line: %s",avpl->name);
+
+ action = lookup_using_index_avp(avpl, KEYWORD_ACTION, actions,&name);
+
+ if (action) {
+ if ( ! action(avpl) ) {
+ g_warning("MATE: Error on: %s",avpl->name);
+ return FALSE;
+ }
+ } else {
+ g_warning("MATE: action '%s' unknown in: %s",name,avpl->name);
return FALSE;
}
- } else {
- mate_config_error(loal,line,"mate: Error: action '%s' unknown",name);
- return FALSE;
}
-
- g_free(line);
- }
-
- return TRUE;
+
+ return TRUE;
} else {
- g_warning("mate: could not load '%s'",filename);
+ g_warning("MATE: error reading config file: %s",loal->name);
return FALSE;
}
}
@@ -337,8 +316,8 @@ static gboolean add_hfid(guint8* what, guint8* how, GHashTable* where) {
if (( as = g_hash_table_lookup(where,ip) )) {
g_free(ip);
if (! g_str_equal(as,how)) {
- g_warning("Error: add_hfid: attempt to add %s(%i) as %s"
- " failed: hfid already added as '%s'",what,hfi->id,how,as);
+ g_warning("MATE Error: add field to Pdu: attempt to add %s(%i) as %s"
+ " failed: field already added as '%s'",what,hfi->id,how,as);
return FALSE;
}
} else {
@@ -354,7 +333,7 @@ static gboolean add_hfid(guint8* what, guint8* how, GHashTable* where) {
}
if (! exists) {
- g_warning("Error: add_hfid(%s): cannot find",what);
+ g_warning("MATE Error: cannot find field %s",what);
}
return exists;
@@ -371,11 +350,15 @@ static gboolean config_pdu(AVPL* avpl) {
guint i;
AVP* attr_avp;
+ if (! name ) {
+ g_warning("MATE: PduDef: No Name in: %s",avpl->name);
+ return FALSE;
+ }
+
if (! cfg) {
cfg = new_pducfg(name);
} else {
- g_warning("MATE: PDU Config error: No such PDU: %s",cfg->name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduDef: No such PDU: '%s' in: %s",cfg->name,avpl->name);
return FALSE;
}
@@ -388,8 +371,7 @@ static gboolean config_pdu(AVPL* avpl) {
if (hfi) {
cfg->hfid_proto = hfi->id;
} else {
- g_warning("mate: PDU Config error: no such proto: %s",proto);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduDef: no such proto: '%s' in: %s",proto,avpl->name);
return FALSE;
}
@@ -408,9 +390,8 @@ static gboolean config_pdu(AVPL* avpl) {
g_ptr_array_add(cfg->hfid_ranges,(gpointer)hfidp);
g_string_sprintfa(matecfg->mate_attrs_filter, "||%s",transports[i]);
} else {
- g_warning("mate: PDU Config error: no such proto: %s for Transport",proto);
+ g_warning("MATE: PduDef: no such proto: '%s' for Transport in: %s",proto,avpl->name);
g_strfreev(transports);
- delete_avpl(avpl,TRUE);
return FALSE;
}
}
@@ -418,20 +399,18 @@ static gboolean config_pdu(AVPL* avpl) {
g_strfreev(transports);
}
} else {
- g_warning("mate: PDU Config error: no Transport for %s",cfg->name);
+ g_warning("MATE: PduDef: no Transport for '%s' in: %s",cfg->name,avpl->name);
return FALSE;
}
while (( attr_avp = extract_first_avp(avpl) )) {
if ( ! add_hfid(attr_avp->v,attr_avp->n,cfg->hfids_attr) ) {
- g_warning("mate: PDU Config error: failed to set PDU attribute '%s'",attr_avp->n);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduDef: failed to set PDU attribute '%s' in: %s",attr_avp->n,avpl->name);
return FALSE;
}
g_string_sprintfa(matecfg->mate_attrs_filter, "||%s",attr_avp->v);
}
- delete_avpl(avpl,TRUE);
return TRUE;
}
@@ -440,9 +419,13 @@ static gboolean config_pduextra(AVPL* avpl) {
AVP* attr_avp;
mate_cfg_pdu* cfg = lookup_using_index_avp(avpl,KEYWORD_FOR,matecfg->pducfgs,&name);
+ if (! name ) {
+ g_warning("MATE: PduExtra: No For in: %s",avpl->name);
+ return FALSE;
+ }
+
if (! cfg) {
- g_warning("mate: PduExtra Config error: no such Pdu %s",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduExtra: no such Pdu '%s' in: %s",name,avpl->name);
return FALSE;
}
@@ -452,9 +435,8 @@ static gboolean config_pduextra(AVPL* avpl) {
while (( attr_avp = extract_first_avp(avpl) )) {
if ( ! add_hfid(attr_avp->v,attr_avp->n,cfg->hfids_attr) ) {
- g_warning("mate: PDU Config error: failed to set attr %s",attr_avp->n);
+ g_warning("MATE: PduExtra: failed to set attr '%s' in: %s",attr_avp->n,avpl->name);
delete_avp(attr_avp);
- delete_avpl(avpl,TRUE);
return FALSE;
}
g_string_sprintfa(matecfg->mate_attrs_filter, "||%s",attr_avp->v);
@@ -473,9 +455,13 @@ static gboolean config_pducriteria(AVPL* avpl) {
avpl_match_mode match_mode = AVPL_STRICT;
guint8* mode = extract_named_str(avpl, KEYWORD_MODE, NULL);
+ if (! name ) {
+ g_warning("MATE: PduCriteria: No For in: %s",avpl->name);
+ return FALSE;
+ }
+
if (!cfg) {
- g_warning("mate: PduCriteria Config error: Pdu %s does not exist",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduCriteria: Pdu '%s' does not exist in: %s",name,avpl->name);
return FALSE;
}
@@ -485,8 +471,7 @@ static gboolean config_pducriteria(AVPL* avpl) {
} else if ( g_strcasecmp(mode,KEYWORD_REJECT) == 0 ) {
mode = matecfg->reject;
} else {
- g_warning("mate: PduCriteria Config error: no such criteria mode: %s",mode);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduCriteria: no such criteria mode: '%s' in %s",mode,avpl->name);
return FALSE;
}
} else {
@@ -503,8 +488,7 @@ static gboolean config_pducriteria(AVPL* avpl) {
} else if ( g_strcasecmp(match,KEYWORD_STRICT) == 0 ) {
match_mode = AVPL_STRICT;
} else {
- g_warning("mate: PduCriteria Config error: no such match mode: %s",match);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduCriteria: Config error: no such match mode '%s' in: %s",match,avpl->name);
return FALSE;
}
}
@@ -513,8 +497,7 @@ static gboolean config_pducriteria(AVPL* avpl) {
if (cfg->criterium) {
/* FEATURE: more criteria */
- g_warning("mate: PduCriteria Config error: PduCriteria alredy exists for %s",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: PduCriteria: PduCriteria alredy exists for '%s' in: %s",name,avpl->name);
return FALSE;
}
@@ -530,12 +513,12 @@ static gboolean config_include(AVPL* avpl) {
guint8* lib = extract_named_str(avpl,KEYWORD_LIB,NULL);
if ( ! filename && ! lib ) {
- mate_config_error(NULL,NULL,"mate: Include file error: no Filename or Lib given");
+ g_warning("MATE: Include: no Filename or Lib given in: %s",avpl->name);
return FALSE;
}
if ( filename && lib ) {
- mate_config_error(NULL,NULL,"mate: Include file error: use either Filename or Lib, not both.");
+ g_warning("MATE: Include: use either Filename or Lib, not both. in: %s",avpl->name);
return FALSE;
}
@@ -545,7 +528,7 @@ static gboolean config_include(AVPL* avpl) {
/* FIXME: stop recursion */
if ( ! mate_load_config(filename) ) {
- mate_config_error(NULL,NULL,"mate: Error Loading '%s'",filename);
+ g_warning("MATE: Include: Error Loading '%s' in: %s",filename,avpl->name);
if (lib) g_free(filename);
return FALSE;
}
@@ -618,7 +601,7 @@ static gboolean config_transform(AVPL* avpl) {
} else if ( g_strcasecmp(match,KEYWORD_STRICT) == 0 ) {
match_mode = AVPL_STRICT;
} else {
- g_warning("mate: Transform Config error: no such match mode: %s",match);
+ g_warning("MATE: Transform: no such match mode: '%s' in: %s",match,avpl->name);
return FALSE;
}
} else {
@@ -631,7 +614,7 @@ static gboolean config_transform(AVPL* avpl) {
} else if ( g_strcasecmp(mode,KEYWORD_REPLACE) == 0 ) {
replace_mode = AVPL_REPLACE;
} else {
- g_warning("mate: Transform Config error: no such replace mode: %s",mode);
+ g_warning("MATE: Transform: no such replace mode: '%s' in: %s",mode,avpl->name);
return FALSE;
}
@@ -640,7 +623,7 @@ static gboolean config_transform(AVPL* avpl) {
}
if (! name) {
- g_warning("mate: Transform Config error: no Name");
+ g_warning("MATE: Transform: no Name in: %s",avpl->name);
return FALSE;
}
@@ -657,28 +640,28 @@ static gboolean config_transform(AVPL* avpl) {
}
static gboolean config_xxx_transform(AVPL* avpl, GHashTable* hash, guint8* keyword) {
- guint8* pdu_name;
+ guint8* cfg_name;
guint8* name;
AVPL_Transf* transf = lookup_using_index_avp(avpl,KEYWORD_NAME,matecfg->transfs,&name);
- mate_cfg_pdu* cfg = lookup_using_index_avp(avpl,KEYWORD_FOR,hash,&pdu_name);;
-
+ mate_cfg_pdu* cfg = lookup_using_index_avp(avpl,KEYWORD_FOR,hash,&cfg_name);;
+
if (! name ) {
- g_warning("mate: %s Config error: No Name",keyword);
+ g_warning("MATE: %s: no Name in: %s",keyword,avpl->name);
return FALSE;
}
- if (! pdu_name ) {
- g_warning("mate: %s Config error: No For",keyword);
+ if (! cfg_name ) {
+ g_warning("MATE: %s: no For in: %s",keyword,avpl->name);
return FALSE;
}
if (! cfg ) {
- g_warning("mate: %s Config error: %s doesn't exist",keyword,pdu_name);
+ g_warning("MATE: %s: '%s' doesn't exist in: %s",keyword,cfg_name,avpl->name);
return FALSE;
}
if (!transf) {
- g_warning("mate: %s Config error: Transform %s doesn't exist",keyword,name);
+ g_warning("MATE: %s: Transform '%s' doesn't exist in: %s",keyword,name,avpl->name);
return FALSE;
}
@@ -704,23 +687,25 @@ static gboolean config_gop(AVPL* avpl) {
mate_cfg_gop* cfg = lookup_using_index_avp(avpl, KEYWORD_NAME,matecfg->gopcfgs,&name);
guint8* on = extract_named_str(avpl,KEYWORD_ON,NULL);
+ if (! name ) {
+ g_warning("MATE: GopDef: no Name in: %s",avpl->name);
+ return FALSE;
+ }
+
if (!cfg) {
cfg = new_gopcfg(name);
} else {
- g_warning("mate: GopDef Config error: Gop '%s' exists already",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopDef: Gop '%s' exists already in: %s",name,avpl->name);
return FALSE;
}
if (! on ) {
- g_warning("mate: GopDef Config error: No 'On' AVP");
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopDef: no On in: %s",avpl->name);
return FALSE;
}
if (g_hash_table_lookup(matecfg->gops_by_pduname,on) ) {
- g_warning("mate: GopDef Config error: Gop for Pdu '%s' exists already",on);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopDef: Gop for Pdu '%s' exists already in: %s",on,avpl->name);
return FALSE;
} else {
g_hash_table_insert(matecfg->gops_by_pduname,on,cfg);
@@ -739,16 +724,19 @@ static gboolean config_start(AVPL* avpl) {
guint8* name;
mate_cfg_gop* cfg = lookup_using_index_avp(avpl, KEYWORD_FOR,matecfg->gopcfgs,&name);;
+ if (! name ) {
+ g_warning("MATE: GopStart: no For in: %s",avpl->name);
+ return FALSE;
+ }
+
if (!cfg) {
- g_warning("mate: GopStart Config error: Gop %s does not exist",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopStart: Gop '%s' doesn't exist in: %s",name,avpl->name);
return FALSE;
}
if (cfg->start) {
/* FEATURE: more start conditions */
- g_warning("mate: GopStart Config error: GopStart alredy exists for %s",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopStart: GopStart for '%s' exists already in: %s",name,avpl->name);
return FALSE;
}
@@ -760,17 +748,19 @@ static gboolean config_start(AVPL* avpl) {
static gboolean config_stop(AVPL* avpl) {
guint8* name;
mate_cfg_gop* cfg = lookup_using_index_avp(avpl, KEYWORD_FOR,matecfg->gopcfgs,&name);;
-
+
+ if (! name ) {
+ g_warning("MATE: GopStop: no For in: %s",avpl->name);
+ return FALSE;
+ }
+
if (!cfg) {
- g_warning("mate: GopStop Config error: Gop %s does not exist",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopStop: Gop '%s' doesn't exist in: %s",name,avpl->name);
return FALSE;
}
if (cfg->stop) {
- /* FEATURE: more GopStop conditions */
- g_warning("mate: GopStart Config error: GopStop alredy exists for %s",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopStop: GopStop alredy exists for '%s' in: %s",name,avpl->name);
return FALSE;
}
@@ -783,9 +773,13 @@ static gboolean config_gopextra(AVPL* avpl) {
guint8* name;
mate_cfg_gop* cfg = lookup_using_index_avp(avpl, KEYWORD_FOR,matecfg->gopcfgs,&name);;
+ if (! name ) {
+ g_warning("MATE: GopExtra: no For in: %s",avpl->name);
+ return FALSE;
+ }
+
if (!cfg) {
- g_warning("mate: GopExtra Config error: Gop %s does not exist",name);
- delete_avpl(avpl,TRUE);
+ g_warning("MATE: GopExtra: Gop '%s' does not exist in: %s",name,avpl->name);
return FALSE;
}
@@ -795,7 +789,6 @@ static gboolean config_gopextra(AVPL* avpl) {
merge_avpl(cfg->extra,avpl,TRUE);
- delete_avpl(avpl,TRUE);
return TRUE;
}
@@ -803,13 +796,13 @@ static gboolean config_gog(AVPL* avpl) {
guint8* name = extract_named_str(avpl, KEYWORD_NAME,NULL);
mate_cfg_gog* cfg = NULL;
- if (!name) {
- g_warning("mate: GogDef Config error: no Name");
+ if (! name ) {
+ g_warning("MATE: GogDef: no Name in: %s",avpl->name);
return FALSE;
}
-
+
if ( g_hash_table_lookup(matecfg->gogcfgs,name) ) {
- g_warning("mate: GogDef Config error: Gog %s exists already", name);
+ g_warning("MATE: GogDef: Gog '%s' exists already in: %s",name,avpl->name);
return FALSE;
}
@@ -830,15 +823,15 @@ static gboolean config_gogkey(AVPL* avpl) {
if ( ! name || ! cfg ) {
if ( ! name )
- g_warning("mate: GogKey Config error: no Name");
+ g_warning("MATE: GogKey: no Name in %s",avpl->name);
else
- g_warning("mate: GogKey Config error: no such Gop %s",name);
+ g_warning("MATE: GogKey: no such Gop '%s' in %s",name,avpl->name);
return FALSE;
}
if (! on ) {
- g_warning("mate: GogKey Config error: no " KEYWORD_ON);
+ g_warning("MATE: GogKey: no On in %s",avpl->name);
return FALSE;
}
@@ -866,9 +859,9 @@ static gboolean config_gogextra(AVPL* avpl) {
if ( ! name || ! cfg ) {
if ( ! name )
- g_warning("mate: GogExtra Config error: no Name");
+ g_warning("MATE: GogExtra: no Name in %s",avpl->name);
else
- g_warning("mate: GogExtra Config error: no such Gop %s",name);
+ g_warning("MATE: GogExtra: no such Gop '%s' in %s",name,avpl->name);
return FALSE;
}
@@ -878,7 +871,6 @@ static gboolean config_gogextra(AVPL* avpl) {
merge_avpl(cfg->extra,avpl,TRUE);
- delete_avpl(avpl,TRUE);
return TRUE;
}
@@ -1410,7 +1402,6 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p _U_) {
}
merge_avpl(cfg->extra,key_avps,TRUE);
- delete_avpl(key_avps,FALSE);
analyze_transform_hfrs(cfg);
@@ -1618,7 +1609,6 @@ extern mate_config* mate_make_config(guint8* filename) {
g_string_erase(matecfg->mate_attrs_filter,0,2);
g_string_erase(matecfg->mate_protos_filter,0,2);
} else {
- mate_config_error(NULL,NULL,"mate: Failed: nothing left to tap on");
destroy_mate_config(matecfg,FALSE);
matecfg = NULL;
return NULL;
diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c
index 3ffc0c76ff..7a61a20552 100644
--- a/plugins/mate/mate_util.c
+++ b/plugins/mate/mate_util.c
@@ -1559,7 +1559,7 @@ extern LoAL* new_loal(guint8* name) {
new_loal->null.avpl = NULL;
new_loal->null.next = &new_loal->null;
new_loal->null.prev = &new_loal->null;
-
+ new_loal->len = 0;
return new_loal;
}
@@ -1584,6 +1584,7 @@ extern void loal_append(LoAL* loal, AVPL* avpl) {
loal->null.prev->next = node;
loal->null.prev = node;
+ loal->len++;
}
@@ -1722,23 +1723,28 @@ extern void delete_loal(LoAL* loal, gboolean avpls_too, gboolean avps_too) {
* load_loal_error:
* Used by loal_from_file to handle errors while loading.
**/
-void load_loal_error(FILE* fp, LoAL* loal, AVPL* curr, int linenum, guint8* fmt, ...) {
+LoAL* load_loal_error(FILE* fp, LoAL* loal, AVPL* curr, int linenum, guint8* fmt, ...) {
va_list list;
guint8* desc;
-
-
+ LoAL* ret = NULL;
+ guint8* err;
+
va_start( list, fmt );
desc = g_strdup_vprintf(fmt, list);
va_end( list );
+
+ err = g_strdup_printf("Error Loading LoAL from file: in %s at line: %i, %s",loal->name,linenum,desc);
+ ret = new_loal(err);
+
+ g_free(desc);
+ g_free(err);
+
if (fp) fclose(fp);
if (loal) delete_loal(loal,TRUE,TRUE);
if (curr) delete_avpl(curr,TRUE);
- g_warning("Error Loading LoAL from file: at line: %i, %s",linenum,desc);
- g_free(desc);
-
- return;
+ return ret;
}
@@ -1772,6 +1778,7 @@ extern LoAL* loal_from_file(guint8* filename) {
guint8 c;
int i = 0;
guint32 linenum = 1;
+ guint8 linenum_buf[MAX_ITEM_LEN];
guint8 name[MAX_ITEM_LEN];
guint8 value[MAX_ITEM_LEN];
guint8 op = '?';
@@ -1801,8 +1808,7 @@ extern LoAL* loal_from_file(guint8* filename) {
if ( feof(fp) ) {
if ( ferror(fp) ) {
- load_loal_error(fp,loal,curr,linenum,"Error while reading '%f'",filename);
- return NULL;
+ return load_loal_error(fp,loal,curr,linenum,"Error while reading '%f'",filename);
}
break;
}
@@ -1812,8 +1818,7 @@ extern LoAL* loal_from_file(guint8* filename) {
}
if ( i >= MAX_ITEM_LEN - 1 ) {
- load_loal_error(fp,loal,curr,linenum,"Maximum item lenght exceeded");
- return NULL;
+ return load_loal_error(fp,loal,curr,linenum,"Maximum item lenght exceeded");
}
switch(state) {
@@ -1841,15 +1846,14 @@ extern LoAL* loal_from_file(guint8* filename) {
i = 0;
name[i++] = c;
name[i] = '\0';
-
- curr = new_avpl("");
+ g_snprintf(linenum_buf,sizeof(linenum_buf),"%s:%u",filename,linenum);
+ curr = new_avpl(linenum_buf);
continue;
case '#':
state = MY_IGNORE;
continue;
default:
- load_loal_error(fp,loal,curr,linenum,"expecting name got: '%c'",c);
- return NULL;
+ return load_loal_error(fp,loal,curr,linenum,"expecting name got: '%c'",c);
}
case BEFORE_NAME:
i = 0;
@@ -1873,8 +1877,7 @@ extern LoAL* loal_from_file(guint8* filename) {
state = START;
continue;
default:
- load_loal_error(fp,loal,curr,linenum,"expecting name got: '%c'",c);
- return NULL;
+ return load_loal_error(fp,loal,curr,linenum,"expecting name got: '%c'",c);
}
case IN_NAME:
switch (c) {
@@ -1903,11 +1906,9 @@ extern LoAL* loal_from_file(guint8* filename) {
name[i++] = c;
continue;
case '\n':
- load_loal_error(fp,loal,curr,linenum,"operator expected found new line");
- return NULL;
+ return load_loal_error(fp,loal,curr,linenum,"operator expected found new line");
default:
- load_loal_error(fp,loal,curr,linenum,"name or match operator expected found '%c'",c);
- return NULL;
+ return load_loal_error(fp,loal,curr,linenum,"name or match operator expected found '%c'",c);
}
case IN_VALUE:
switch (c) {
@@ -1927,8 +1928,7 @@ extern LoAL* loal_from_file(guint8* filename) {
}
continue;
case '\n':
- load_loal_error(fp,loal,curr,linenum,"';' expected found new line");
- return NULL;
+ return load_loal_error(fp,loal,curr,linenum,"';' expected found new line");
default:
value[i++] = c;
continue;
@@ -1940,7 +1940,6 @@ extern LoAL* loal_from_file(guint8* filename) {
return loal;
} else {
- load_loal_error(NULL,loal,NULL,0,"Cannot Open file '%s'",filename);
- return NULL;
+ return load_loal_error(NULL,loal,NULL,0,"Cannot Open file '%s'",filename);
}
}
diff --git a/plugins/mate/matelib/h225_ras.mate b/plugins/mate/matelib/h225_ras.mate
index 398325db58..299142ccaf 100644
--- a/plugins/mate/matelib/h225_ras.mate
+++ b/plugins/mate/matelib/h225_ras.mate
@@ -1,7 +1,7 @@
# h225_ras.mate
# $Id$
-Action=PduDef; Name=ras_pdu; Proto=h225.RasMessage; Transport=udp/ip; ras_sn=h225.RequestSeqNum; ras_msg=h225.RasMessage; addr=ip.addr;
+Action=PduDef; Name=ras_pdu; Proto=h225.RasMessage; Transport=udp/ip; ras_sn=h225.requestSeqNum; ras_msg=h225.RasMessage; addr=ip.addr;
Action=GopDef; Name=ras_leg; On=ras_pdu; addr; addr; ras_sn;
Action=GopStart; For=ras_leg; ras_msg|0|3|6|9|12|15|18|21|26|30;
Action=GopStop; For=ras_leg; ras_msg|1|2|4|5|7|8|10|11|13|14|16|17|19|20|22|24|27|28|29|31;
diff --git a/plugins/mate/matelib/sip.mate b/plugins/mate/matelib/sip.mate
index 26a8475318..d286094ba4 100644
--- a/plugins/mate/matelib/sip.mate
+++ b/plugins/mate/matelib/sip.mate
@@ -1,7 +1,7 @@
# sip.mate
# $Id$
-Action=PduDef; Proto=sip_pdu; Transport=tcp/ip; addr=ip.addr; port=tcp.port; sip_method=sip.Method; sip_callid=sip.Call-ID; calling=sdp.owner.username;
+Action=PduDef; Name=sip_pdu; Proto=sip_pdu; Transport=tcp/ip; addr=ip.addr; port=tcp.port; sip_method=sip.Method; sip_callid=sip.Call-ID; calling=sdp.owner.username;
Action=GopDef; Name=sip_leg; On=sip_pdu; addr; addr; port; port;
Action=GopStart; For=sip; sip_method=INVITE;
Action=GopStop; For=sip; sip_method=BYE;
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c
index 92c653c81b..8c7a86e7d3 100644
--- a/plugins/mate/packet-mate.c
+++ b/plugins/mate/packet-mate.c
@@ -37,7 +37,7 @@ static mate_config* mc = NULL;
static int proto_mate = -1;
-static char* pref_mate_config_filename = "config.mate";
+static char* pref_mate_config_filename = "";
static proto_item *mate_i = NULL;
@@ -259,16 +259,17 @@ extern
void
proto_reg_handoff_mate(void)
{
- mc = mate_make_config(pref_mate_config_filename);
-
- if (mc) {
- proto_register_field_array(proto_mate, (hf_register_info*) mc->hfrs->data, mc->hfrs->len );
- proto_register_subtree_array((gint**) mc->ett->data, mc->ett->len);
- register_init_routine(init_mate);
+ if ( *pref_mate_config_filename != '\0' ) {
+
+ mc = mate_make_config(pref_mate_config_filename);
+
+ if (mc) {
+ proto_register_field_array(proto_mate, (hf_register_info*) mc->hfrs->data, mc->hfrs->len );
+ proto_register_subtree_array((gint**) mc->ett->data, mc->ett->len);
+ register_init_routine(init_mate);
+ }
}
-
-}
-
+}
extern
void