Search
j0ke.net Open Build Service
>
Projects
>
ha
:
firewall
>
snort296
> snortsam-2.9.4_2.9.5.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File snortsam-2.9.4_2.9.5.diff of Package snort296
--- src/output-plugins/spo_alert_fwsam.c.orig 2013-07-08 22:37:00.143048750 +0200 +++ src/output-plugins/spo_alert_fwsam.c 2013-07-14 16:16:53.394360098 +0200 @@ -177,7 +177,7 @@ * Returns: void function * */ -void AlertFWsamInit(char *args) +void AlertFWsamInit(struct _SnortConfig *sc, char *args) { char *ap; unsigned long statip,cnt,again,i; char *stathost,*statport,*statpass; @@ -219,7 +219,7 @@ if(fp) /* Check for presence of map file and read those in, sorted. */ { LogMessage("INFO => [Alert_FWsam](AlertFWsamSetup) Using sid-map file: %s\n",buf); - while(FWsamReadLine(buf,sizeof(buf),fp)) + while(FWsamReadLine(sc,buf,sizeof(buf),fp)) if(*buf) FWsamMaxOptions++; if(FWsamMaxOptions) @@ -227,9 +227,9 @@ FatalError("ERROR => [Alert_FWsam](AlertFWsamSetup) malloc failed for OptionField!\n"); fseek(fp,0,SEEK_SET); for(cnt=0;cnt<FWsamMaxOptions;) - { FWsamReadLine(buf,sizeof(buf),fp); + { FWsamReadLine(sc,buf,sizeof(buf),fp); if(*buf) - FWsamParseLine(&(FWsamOptionField[cnt++]),buf); + FWsamParseLine(sc,&(FWsamOptionField[cnt++]),buf); } if(FWsamMaxOptions>1) { for(again=TRUE,cnt=FWsamMaxOptions-1;cnt>=1 && again;cnt--) @@ -395,7 +395,7 @@ #endif /* Set the preprocessor function into the function list */ - AddFuncToOutputList(AlertFWsam, OUTPUT_TYPE_FLAG__ALERT, fwsamlist); + AddFuncToOutputList(sc, AlertFWsam, OUTPUT_TYPE_FLAG__ALERT, fwsamlist); AddFuncToCleanExitList(AlertFWsamCleanExitFunc, fwsamlist); AddFuncToReloadList(AlertFWsamRestartFunc, fwsamlist); } @@ -405,7 +405,7 @@ * off the front and back, removes comments, and pretties the * string. Returns true or false if a line was read or not. */ -int FWsamReadLine(char *buf,unsigned long bufsize,FILE *fp) +int FWsamReadLine(struct _SnortConfig *sc, char *buf,unsigned long bufsize,FILE *fp) { char *p; if(fgets(buf,bufsize-1,fp)) @@ -498,7 +498,7 @@ * which is called by Snort when processing fwsam: options in rules. * It returns TRUE it there is a possible option problem, otherwise FALSE. */ -int FWsamParseOption(FWsamOptions *optp,char *ap) +int FWsamParseOption(struct _SnortConfig *sc, FWsamOptions *optp,char *ap) { int possprob=FALSE; /* set defaults */ @@ -573,7 +573,7 @@ /* This goes through the lines of sid-block.map and sets the * options for fwsam if the file is being used. */ -void FWsamParseLine(FWsamOptions *optp,char *buf) +void FWsamParseLine(struct _SnortConfig *sc,FWsamOptions *optp,char *buf) { char *ap; ap=buf; /* start at the beginning of the argument */ @@ -598,7 +598,7 @@ optp->sid=(unsigned long)atol(buf); - if(FWsamParseOption(optp,ap)) + if(FWsamParseOption(sc,optp,ap)) LogMessage("WARNING %s (%d) => [Alert_FWsam](AlertFWamOptionInit) Possible option problem. Using %s[%s],%lu.\n",file_name,file_line,(optp->who==FWSAM_WHO_SRC)?"src":"dst",(optp->how==FWSAM_HOW_IN)?"in":((optp->how==FWSAM_HOW_OUT)?"out":"either"),optp->duration); } else @@ -617,7 +617,7 @@ * Returns: void function * */ -void AlertFWsamOptionInit(char *args,OptTreeNode *otn,int protocol) +void AlertFWsamOptionInit(struct _SnortConfig *sc,char *args,OptTreeNode *otn,int protocol) { FWsamOptions *optp; char *ap; @@ -644,7 +644,7 @@ strcpy(ap,ap+1); - if(FWsamParseOption(optp,args)) + if(FWsamParseOption(sc,optp,args)) LogMessage("WARNING %s (%d) => [Alert_FWsam](AlertFWamOptionInit) Possible option problem. Using %s[%s],%lu.\n",file_name,file_line,(optp->who==FWSAM_WHO_SRC)?"src":"dst",(optp->how==FWSAM_HOW_IN)?"in":((optp->how==FWSAM_HOW_OUT)?"out":"either"),optp->duration); otn->ds_list[PLUGIN_FWSAM]=(FWsamOptions *)optp; --- src/output-plugins/spo_alert_fwsam.h.orig 2013-07-08 22:46:18.705188991 +0200 +++ src/output-plugins/spo_alert_fwsam.h 2013-07-14 16:18:56.765912173 +0200 @@ -196,8 +196,8 @@ /* functions */ void AlertFWsamSetup(void); -void AlertFWsamInit(char *args); -void AlertFWsamOptionInit(char *args,OptTreeNode *otn,int protocol); +void AlertFWsamInit(struct _SnortConfig *sc,char *args); +void AlertFWsamOptionInit(struct _SnortConfig *sc,char *args,OptTreeNode *otn,int protocol); void AlertFWsamCleanExitFunc(int signal, void *arg); void AlertFWsamRestartFunc(int signal, void *arg); void AlertFWsam(Packet *p, char *msg, void *arg, Event *event); @@ -208,9 +208,9 @@ unsigned long FWsamParseDuration(char *p); void FWsamFree(FWsamList *fwsamlist); int FWsamStationExists(FWsamStation *who,FWsamList *list); -int FWsamReadLine(char *,unsigned long,FILE *); -void FWsamParseLine(FWsamOptions *,char *); +int FWsamReadLine(struct _SnortConfig *sc,char *,unsigned long,FILE *); +void FWsamParseLine(struct _SnortConfig *sc,FWsamOptions *,char *); FWsamOptions *FWsamGetOption(unsigned long); -int FWsamParseOption(FWsamOptions *,char *); +int FWsamParseOption(struct _SnortConfig *sc,FWsamOptions *,char *); #endif /* __SPO_FWSAM_H__ */