@@ -1,5 +1,5 @@
--- 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-08 22:43:22.529806701 +0200
++++ src/output-plugins/spo_alert_fwsam.c 2013-07-14 16:16:53.394360098 +0200
@@ -177,7 +177,7 @@
* Returns: void function
*
@@ -9,6 +9,27 @@
{ 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
@@ -18,14 +39,83 @@
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-08 22:47:43.332967700 +0200
-@@ -196,7 +196,7 @@
++++ 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(char *args,OptTreeNode *otn,int protocol);
++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__ */
|