mirror of
https://github.com/BlackLight/Snort_AIPreproc.git
synced 2024-11-27 22:25:12 +01:00
Fixing XML description < and > tags
This commit is contained in:
parent
f191faf2ff
commit
b49e9152ec
1 changed files with 12 additions and 2 deletions
|
@ -53,7 +53,9 @@ __AI_neural_clusters_to_xml ( kmeans_t *km, AI_alerts_per_neuron *alerts_per_neu
|
||||||
|
|
||||||
char src_ip[INET_ADDRSTRLEN] = { 0 },
|
char src_ip[INET_ADDRSTRLEN] = { 0 },
|
||||||
dst_ip[INET_ADDRSTRLEN] = { 0 },
|
dst_ip[INET_ADDRSTRLEN] = { 0 },
|
||||||
*timestamp = NULL;
|
*timestamp = NULL,
|
||||||
|
*tmp = NULL,
|
||||||
|
*buf = NULL;
|
||||||
|
|
||||||
AI_alerts_per_neuron_key key;
|
AI_alerts_per_neuron_key key;
|
||||||
AI_alerts_per_neuron *alert_iterator = NULL;
|
AI_alerts_per_neuron *alert_iterator = NULL;
|
||||||
|
@ -114,9 +116,14 @@ __AI_neural_clusters_to_xml ( kmeans_t *km, AI_alerts_per_neuron *alerts_per_neu
|
||||||
timestamp = ctime ( &( alert_iterator->alerts[k].timestamp ));
|
timestamp = ctime ( &( alert_iterator->alerts[k].timestamp ));
|
||||||
timestamp[ strlen ( timestamp ) - 1 ] = 0;
|
timestamp[ strlen ( timestamp ) - 1 ] = 0;
|
||||||
|
|
||||||
|
tmp = str_replace ( alert_iterator->alerts[k].desc, "<", "<" );
|
||||||
|
buf = str_replace ( tmp, ">", ">" );
|
||||||
|
free ( tmp );
|
||||||
|
tmp = NULL;
|
||||||
|
|
||||||
fprintf ( fp, "\t\t<alert desc=\"%s\" gid=\"%d\" sid=\"%d\" rev=\"%d\" src_ip=\"%s\" src_port=\"%d\" "
|
fprintf ( fp, "\t\t<alert desc=\"%s\" gid=\"%d\" sid=\"%d\" rev=\"%d\" src_ip=\"%s\" src_port=\"%d\" "
|
||||||
"dst_ip=\"%s\" dst_port=\"%d\" timestamp=\"%s\" xcoord=\"%d\" ycoord=\"%d\"/>\n",
|
"dst_ip=\"%s\" dst_port=\"%d\" timestamp=\"%s\" xcoord=\"%d\" ycoord=\"%d\"/>\n",
|
||||||
alert_iterator->alerts[k].desc,
|
buf,
|
||||||
alert_iterator->alerts[k].gid,
|
alert_iterator->alerts[k].gid,
|
||||||
alert_iterator->alerts[k].sid,
|
alert_iterator->alerts[k].sid,
|
||||||
alert_iterator->alerts[k].rev,
|
alert_iterator->alerts[k].rev,
|
||||||
|
@ -124,6 +131,9 @@ __AI_neural_clusters_to_xml ( kmeans_t *km, AI_alerts_per_neuron *alerts_per_neu
|
||||||
dst_ip, alert_iterator->alerts[k].dst_port,
|
dst_ip, alert_iterator->alerts[k].dst_port,
|
||||||
timestamp,
|
timestamp,
|
||||||
alert_iterator->key.x, alert_iterator->key.y );
|
alert_iterator->key.x, alert_iterator->key.y );
|
||||||
|
|
||||||
|
free ( buf );
|
||||||
|
buf = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue