- add TODO
This commit is contained in:
parent
b93240cc27
commit
da1d29469b
10
fsipd.c
10
fsipd.c
@ -88,6 +88,11 @@ void
|
|||||||
process_request(char *str)
|
process_request(char *str)
|
||||||
{
|
{
|
||||||
/* check input str for SIP requests */
|
/* 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, "incoming packet: %s\n", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +120,6 @@ daemon_start()
|
|||||||
}
|
}
|
||||||
warn("Cannot open or create pidfile.");
|
warn("Cannot open or create pidfile.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setup socket */
|
/* setup socket */
|
||||||
if ((proto_tcp = getprotobyname("tcp")) == NULL)
|
if ((proto_tcp = getprotobyname("tcp")) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
@ -129,12 +133,10 @@ daemon_start()
|
|||||||
perror("socket");
|
perror("socket");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bind(s, (struct sockaddr *)&sa, sizeof sa) < 0) {
|
if (bind(s, (struct sockaddr *)&sa, sizeof sa) < 0) {
|
||||||
perror("bind");
|
perror("bind");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* start daemonizing */
|
/* start daemonizing */
|
||||||
curPID = fork();
|
curPID = fork();
|
||||||
|
|
||||||
@ -190,12 +192,10 @@ daemon_start()
|
|||||||
perror("accept");
|
perror("accept");
|
||||||
return (EXIT_FAILURE);
|
return (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((client = fdopen(c, "r")) == NULL) {
|
if ((client = fdopen(c, "r")) == NULL) {
|
||||||
perror("fdopen");
|
perror("fdopen");
|
||||||
return (EXIT_FAILURE);
|
return (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
fgets(inputstr, sizeof(inputstr), client);
|
fgets(inputstr, sizeof(inputstr), client);
|
||||||
|
|
||||||
process_request(inputstr);
|
process_request(inputstr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user