Merge branch 'master' of https://github.com/farrokhi/fsipd
This commit is contained in:
commit
23785e3df1
6
Makefile
6
Makefile
@ -1,7 +1,7 @@
|
|||||||
PREFIX=/usr/local
|
PREFIX?=/usr/local
|
||||||
INC=-I$(PREFIX)/include
|
INC=-I$(PREFIX)/include
|
||||||
LIB=-L$(PREFIX)/lib -L. -lpidfile
|
LIB=-L$(PREFIX)/lib -L. -lpidfile
|
||||||
CFLAGS=-Wall -g -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing
|
CFLAGS=-Wall -Wextra -g -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing
|
||||||
CC?=cc
|
CC?=cc
|
||||||
AR?=AR
|
AR?=AR
|
||||||
RANLIB?=ranlib
|
RANLIB?=ranlib
|
||||||
@ -20,5 +20,5 @@ fsipd: fsipd.c $(LIBPIDFILE)
|
|||||||
$(CC) $(CFLAGS) $(INC) $(LIB) fsipd.c -o fsipd
|
$(CC) $(CFLAGS) $(INC) $(LIB) fsipd.c -o fsipd
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o a.out core temp.* $(LIBPIDFILE) $(PROGS)
|
rm -f *.o *.a a.out core temp.* $(LIBPIDFILE) $(PROGS)
|
||||||
rm -fr *.dSYM
|
rm -fr *.dSYM
|
11
fsipd.c
11
fsipd.c
@ -32,6 +32,7 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -89,12 +90,8 @@ process_request(char *str)
|
|||||||
{
|
{
|
||||||
/* check input str for SIP requests */
|
/* check input str for SIP requests */
|
||||||
|
|
||||||
/*
|
syslog(LOG_ALERT, "sip: %s, sport: %d, payload: \"%s\"\n",
|
||||||
* TODO: log connection info including SRC/DST IP, SRC/DST PORT,
|
inet_ntoa(sa.sin_addr), ntohs(sa.sin_port), str);
|
||||||
* Timestamp and Message Type in CSV Format
|
|
||||||
*/
|
|
||||||
|
|
||||||
syslog(LOG_ALERT, "incoming packet: %s\n", str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -208,7 +205,7 @@ daemon_start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(void)
|
||||||
{
|
{
|
||||||
return (daemon_start());
|
return (daemon_start());
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,8 @@ struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr)
|
|||||||
struct pidfh *pfh;
|
struct pidfh *pfh;
|
||||||
struct timespec rqtp;
|
struct timespec rqtp;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int len, fd, error, count;
|
size_t len;
|
||||||
|
int fd, error, count;
|
||||||
|
|
||||||
pfh = malloc(sizeof(*pfh));
|
pfh = malloc(sizeof(*pfh));
|
||||||
if (pfh == NULL) return NULL;
|
if (pfh == NULL) return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user