- Correctly log source IP address and Port number (sip and sport) to syslog

This commit is contained in:
Babak Farrokhi 2015-10-11 14:56:33 +03:30
parent da1d29469b
commit d0cf5bcbbf

View File

@ -32,6 +32,7 @@
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <err.h>
#include <errno.h>
@ -88,12 +89,9 @@ void
process_request(char *str)
{
/* check input str for SIP requests */
/*
* TODO: log connection info including SRC/DST IP, SRC/DST PORT,
* Timestamp and Message Type in CSV Format
*/
syslog(LOG_ALERT, "incoming packet: %s\n", str);
syslog(LOG_ALERT, "sip: %s, sport: %d, payload: \"%s\"\n",
inet_ntoa(sa.sin_addr), ntohs(sa.sin_port), str);
}
/*