commit the latest rev
This commit is contained in:
parent
41efee12e3
commit
175c39c499
23 changed files with 3568 additions and 3078 deletions
|
@ -1,6 +1,8 @@
|
|||
bin_PROGRAMS = testclient
|
||||
bin_PROGRAMS = testclient testserver
|
||||
testclient_SOURCES = testclient.c list.c hash.c
|
||||
testclient_LDADD = -L$(top_srcdir)/Libs/ -lmqpacket
|
||||
AM_CFLAGS = -I$(top_srcdir)/Include -I$(top_srcdir)/adns -I$(top_srcdir)/libevent
|
||||
testserver_SOURCES = testserver.c list.c hash.c
|
||||
testserver_LDADD = -L$(top_srcdir)/Libs/ -lmqpacket
|
||||
AM_CFLAGS = -I$(top_srcdir)/Include -I$(top_srcdir)/adns -I$(top_srcdir)/libevent -DNDEBUG
|
||||
|
||||
include $(top_srcdir)/rules.mk
|
|
@ -1,8 +1,8 @@
|
|||
# Makefile.in generated by automake 1.7.9 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -14,13 +14,14 @@
|
|||
|
||||
@SET_MAKE@
|
||||
|
||||
SOURCES = $(testclient_SOURCES) $(testserver_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
|
@ -34,8 +35,44 @@ POST_INSTALL = :
|
|||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
|
||||
bin_PROGRAMS = testclient$(EXEEXT) testserver$(EXEEXT)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/rules.mk
|
||||
subdir = Client
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/Include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_testclient_OBJECTS = testclient.$(OBJEXT) list.$(OBJEXT) \
|
||||
hash.$(OBJEXT)
|
||||
testclient_OBJECTS = $(am_testclient_OBJECTS)
|
||||
testclient_DEPENDENCIES =
|
||||
am_testserver_OBJECTS = testserver.$(OBJEXT) list.$(OBJEXT) \
|
||||
hash.$(OBJEXT)
|
||||
testserver_OBJECTS = $(am_testserver_OBJECTS)
|
||||
testserver_DEPENDENCIES =
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/Include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
SOURCES = $(testclient_SOURCES) $(testserver_SOURCES)
|
||||
DIST_SOURCES = $(testclient_SOURCES) $(testserver_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkglibdir = $(prefix)/modules
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
|
@ -106,6 +143,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
|||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
@ -127,6 +166,7 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
|
@ -142,62 +182,58 @@ xds_uint16_t = @xds_uint16_t@
|
|||
xds_uint32_t = @xds_uint32_t@
|
||||
xds_uint64_t = @xds_uint64_t@
|
||||
xds_uint8_t = @xds_uint8_t@
|
||||
bin_PROGRAMS = testclient
|
||||
testclient_SOURCES = testclient.c list.c hash.c
|
||||
testclient_LDADD = -L$(top_srcdir)/Libs/ -lmqpacket
|
||||
AM_CFLAGS = -I$(top_srcdir)/Include -I$(top_srcdir)/adns -I$(top_srcdir)/libevent
|
||||
testserver_SOURCES = testserver.c list.c hash.c
|
||||
testserver_LDADD = -L$(top_srcdir)/Libs/ -lmqpacket
|
||||
AM_CFLAGS = -I$(top_srcdir)/Include -I$(top_srcdir)/adns -I$(top_srcdir)/libevent -DNDEBUG
|
||||
LINK = @echo "Linking $@"; $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
subdir = Client
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/Include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
bin_PROGRAMS = testclient$(EXEEXT)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
am_testclient_OBJECTS = testclient.$(OBJEXT) list.$(OBJEXT) \
|
||||
hash.$(OBJEXT)
|
||||
testclient_OBJECTS = $(am_testclient_OBJECTS)
|
||||
testclient_DEPENDENCIES =
|
||||
testclient_LDFLAGS =
|
||||
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/Include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/hash.Po ./$(DEPDIR)/list.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/testclient.Po
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
|
||||
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
DIST_SOURCES = $(testclient_SOURCES)
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/rules.mk Makefile.am
|
||||
SOURCES = $(testclient_SOURCES)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/rules.mk $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Client/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Client/Makefile
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
|
@ -205,8 +241,8 @@ uninstall-binPROGRAMS:
|
|||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(bindir)/$$f; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
|
@ -218,9 +254,12 @@ clean-binPROGRAMS:
|
|||
testclient$(EXEEXT): $(testclient_OBJECTS) $(testclient_DEPENDENCIES)
|
||||
@rm -f testclient$(EXEEXT)
|
||||
$(LINK) $(testclient_LDFLAGS) $(testclient_OBJECTS) $(testclient_LDADD) $(LIBS)
|
||||
testserver$(EXEEXT): $(testserver_OBJECTS) $(testserver_DEPENDENCIES)
|
||||
@rm -f testserver$(EXEEXT)
|
||||
$(LINK) $(testserver_LDFLAGS) $(testserver_OBJECTS) $(testserver_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT) core *.core
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
@ -228,6 +267,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testclient.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testserver.Po@am__quote@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
@ -239,14 +279,6 @@ distclean-libtool:
|
|||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
|
@ -255,6 +287,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
|||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
@ -266,10 +299,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
@ -292,13 +326,9 @@ GTAGS:
|
|||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(mkinstalldirs) $(distdir)/..
|
||||
$(mkdir_p) $(distdir)/..
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
|
@ -310,7 +340,7 @@ distdir: $(DISTFILES)
|
|||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
|
@ -328,9 +358,10 @@ distdir: $(DISTFILES)
|
|||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
@ -350,7 +381,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -369,6 +400,8 @@ dvi: dvi-am
|
|||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
@ -406,14 +439,14 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am
|
|||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am info info-am install install-am install-binPROGRAMS \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-binPROGRAMS \
|
||||
uninstall-info-am
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-binPROGRAMS install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
|
||||
.c.o:
|
||||
|
|
|
@ -32,50 +32,20 @@
|
|||
|
||||
#include "defines.h"
|
||||
#include "packet.h"
|
||||
#include "log.h"
|
||||
|
||||
void pck_logger(char *fmt,...);
|
||||
|
||||
int main() {
|
||||
int connect;
|
||||
struct sockaddr_in sa;
|
||||
struct hostent *hp;
|
||||
init_socket();
|
||||
debug_socket(1);
|
||||
|
||||
pck_set_logger(pck_logger);
|
||||
pck_set_server();
|
||||
pck_init();
|
||||
connect = 0;
|
||||
|
||||
if ((hp = gethostbyname("localhost")) == NULL) {
|
||||
printf("gethostbyname failed\n");
|
||||
exit(-1);
|
||||
}
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = htons(8888);
|
||||
bcopy(hp->h_addr, (char *) &sa.sin_addr, hp->h_length);
|
||||
|
||||
|
||||
pck_make_connection("localhost", "fish", "haha", 0, NULL);
|
||||
while (1) {
|
||||
pck_process();
|
||||
sleep(2);
|
||||
if (connect == 0) {
|
||||
if (pck_make_connection(sa, NULL) == NS_FAILURE) {
|
||||
printf("connect failed\n");
|
||||
exit(-1);
|
||||
} else {
|
||||
connect = 1;
|
||||
}
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pck_logger(char *fmt,...) {
|
||||
va_list ap;
|
||||
char log_buf[BUFSIZE];
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(log_buf, BUFSIZE, fmt, ap);
|
||||
va_end(ap);
|
||||
printf("MQ: %s\n", log_buf);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#ifndef _DNS_H_
|
||||
#define _DNS_H_
|
||||
#include "adns.h"
|
||||
#include "serversock.h"
|
||||
|
||||
int init_dns (void);
|
||||
void do_dns (void);
|
||||
|
@ -30,5 +32,7 @@ void fini_adns();
|
|||
void canx_dns(const char *modname);
|
||||
void do_dns_stats_Z();
|
||||
int dns_lookup (char *str, adns_rrtype type, void (*callback) (void *data, adns_answer * a), void *data);
|
||||
void do_reverse_lookup(mqsock *mqs);
|
||||
void setup_dns_socks();
|
||||
|
||||
#endif /* _DNS_H_ */
|
||||
|
|
206
Include/packet.h
206
Include/packet.h
|
@ -29,64 +29,12 @@
|
|||
#include "defines.h"
|
||||
#include "xds.h"
|
||||
#include "xds_engine_xdr_mqs.h"
|
||||
#include "list.h"
|
||||
|
||||
/* encoding engine structs */
|
||||
#define NUMENGINES 30
|
||||
|
||||
#ifndef INPACK_MAX
|
||||
#define INPACK_MAX 100
|
||||
#endif
|
||||
|
||||
#ifndef OUTPACK_MAX
|
||||
#define OUTPACK_MAX 100
|
||||
#endif
|
||||
|
||||
#define PCK_MIN_PACK_SIZE 84
|
||||
|
||||
|
||||
list_t *connections;
|
||||
|
||||
|
||||
#define MQP_CLIENTAUTHED 0x01
|
||||
#define MQP_CLIENTSETUP 0x02
|
||||
|
||||
#define MQP_IS_AUTHED(x) (x->flags & MQP_CLIENTAUTHED)
|
||||
#define MQP_SET_AUTHED(x) (x->flags |= MQP_CLIENTAUTHED)
|
||||
|
||||
#define MQP_IS_SETUP(x) ((x->flags & MQP_CLIENTSETUP) && (x->flags & MQP_CLIENTAUTHED))
|
||||
#define MQP_SET_SETUP(x) (x->flags |= MQP_CLIENTSETUP)
|
||||
|
||||
|
||||
|
||||
/* client protocol struct */
|
||||
typedef struct mqprotocol {
|
||||
list_t *inpack;
|
||||
unsigned long nxtinmid;
|
||||
list_t *outpack;
|
||||
unsigned long nxtoutmid;
|
||||
int wtforinpack;
|
||||
int servorclnt;
|
||||
int sock;
|
||||
int pollopts;
|
||||
int flags;
|
||||
void *cbarg;
|
||||
void *buffer;
|
||||
size_t bufferlen;
|
||||
size_t offset;
|
||||
void *outbuffer;
|
||||
size_t outbufferlen;
|
||||
size_t outoffset;
|
||||
} mqprotocol;
|
||||
|
||||
typedef void (logfunc)(char *fmt, ...) __attribute__((format(printf,1,2))); /* 3=format 4=params */
|
||||
typedef int (connectauthfunc)(int fd, struct sockaddr_in);
|
||||
|
||||
struct mqpconfig {
|
||||
logfunc *logger;
|
||||
connectauthfunc *connectauth;
|
||||
int server;
|
||||
int port;
|
||||
int listenfd;
|
||||
} mqpconfig;
|
||||
#define ENG_TYPE_XDR 1
|
||||
#define ENG_TYPE_XML 2
|
||||
|
||||
/* server or client or repl flags mqprotocol->servorclnt */
|
||||
#define PCK_IS_CLIENT 0x1
|
||||
|
@ -97,19 +45,7 @@ struct mqpconfig {
|
|||
#define MQP_IS_SERVER(x) (x->servorclnt & PCK_IS_SERVER)
|
||||
#define MQP_IS_REPL(x) (x->servorclnt & PCK_IS_REPL)
|
||||
|
||||
/* individual packets struct */
|
||||
typedef struct mqpacket {
|
||||
unsigned long MID;
|
||||
int MSGTYPE;
|
||||
int VERSION;
|
||||
unsigned long flags;
|
||||
void *data;
|
||||
unsigned long dataoffset;
|
||||
xds_t *xds;
|
||||
} mqpacket;
|
||||
|
||||
|
||||
/* flags to indicate the connection status */
|
||||
/* flags to indicate the message type */
|
||||
#define PCK_ACK 1
|
||||
#define PCK_ERROR 2
|
||||
#define PCK_SRVCAP 3
|
||||
|
@ -130,25 +66,91 @@ typedef struct mqpacket {
|
|||
#define PCK_SENTTOCLNT 18
|
||||
#define PCK_MSGFROMCLNT 19
|
||||
|
||||
/* format strings */
|
||||
#define PCK_ACK_FMT "int32"
|
||||
#define PCK_ERROR_FMT "string"
|
||||
#define PCK_SRVCAP_FMT "int32 int32 string"
|
||||
|
||||
|
||||
|
||||
/* packet flags, not message flags */
|
||||
#define PCK_FLG_REQUIREACK 0x01
|
||||
#define PCK_FLG_REQUIREACPPROCESS 0x02
|
||||
|
||||
|
||||
/* encoding engine structs */
|
||||
#define NUMENGINES 9
|
||||
struct mq_data_stream {
|
||||
void *data;
|
||||
size_t len;
|
||||
} mq_data_stream;
|
||||
|
||||
#define ENG_TYPE_XDR 1
|
||||
#define ENG_TYPE_XML 2
|
||||
struct mq_data_srvcap {
|
||||
int srvcap1;
|
||||
int srvcap2;
|
||||
char *capstr;
|
||||
} mq_data_srvcap;
|
||||
|
||||
typedef struct myengines {
|
||||
|
||||
|
||||
struct message {
|
||||
int MID;
|
||||
int MSGTYPE;
|
||||
int VERSION;
|
||||
int flags;
|
||||
union {
|
||||
struct mq_data_stream *stream;
|
||||
struct mq_data_srvcap *srvcap;
|
||||
char *string;
|
||||
int num;
|
||||
} data;
|
||||
} message;
|
||||
|
||||
struct simpleif {
|
||||
char username[BUFSIZE];
|
||||
char password[BUFSIZE];
|
||||
char host[BUFSIZE];
|
||||
long flags;
|
||||
} simpleif;
|
||||
|
||||
/* client protocol struct */
|
||||
typedef struct mqpacket {
|
||||
int nxtoutmid;
|
||||
int servorclnt;
|
||||
int sock;
|
||||
int pollopts;
|
||||
int flags;
|
||||
struct simpleif si;
|
||||
void *cbarg;
|
||||
void *buffer;
|
||||
size_t bufferlen;
|
||||
size_t offset;
|
||||
void *outbuffer;
|
||||
size_t outbufferlen;
|
||||
size_t outoffset;
|
||||
struct message inmsg;
|
||||
struct message outmsg;
|
||||
xds_t *xdsin;
|
||||
xds_t *xdsout;
|
||||
} mqpacket;
|
||||
|
||||
typedef void (logfunc)(char *fmt, ...) __attribute__((format(printf,1,2))); /* 3=format 4=params */
|
||||
typedef int (connectauthfunc)(mqp *, mqpacket *);
|
||||
typedef int (callbackfunc)(mqp *, mqpacket *);
|
||||
|
||||
|
||||
typedef struct myeng {
|
||||
xds_mode_t dir;
|
||||
int type;
|
||||
xds_engine_t ptr;
|
||||
const char myname[BUFSIZE];
|
||||
}myengines;
|
||||
|
||||
extern myengines enc_xdr_engines[NUMENGINES];
|
||||
} myeng;
|
||||
|
||||
|
||||
typedef struct mqp {
|
||||
logfunc *logger;
|
||||
connectauthfunc *connectauth;
|
||||
myeng *myengines;
|
||||
callbackfunc *callback;
|
||||
} mqp;
|
||||
|
||||
|
||||
extern int encode_mqs_header (xds_t * xds, void *engine_context, void *buffer, size_t buffer_size, size_t * used_buffer_size, va_list * args);
|
||||
|
@ -157,23 +159,49 @@ extern int decode_mqs_header (xds_t * xds, void *engine_context, void *buffer, s
|
|||
|
||||
|
||||
|
||||
void pck_init();
|
||||
void pck_set_logger(logfunc *logger);
|
||||
mqprotocol *pck_new_conn(void *cbarg, int type);
|
||||
int pck_parse_packet(mqprotocol *mqp, u_char *buffer, unsigned long buflen);
|
||||
void pck_set_logger(mqp *, logfunc *logger);
|
||||
void pck_set_callback(mqp *, callbackfunc *);
|
||||
void pck_set_authcallback(mqp *, connectauthfunc *);
|
||||
mqp *init_mqlib ();
|
||||
int read_fd (mqp *mqplib, mqpacket *mqp);
|
||||
int close_fd (mqp *mqplib, mqpacket * mqp);
|
||||
int write_fd (mqp *mqplib, mqpacket * mqp);
|
||||
mqpacket * pck_new_connection (mqp *mqplib, int fd, int type, int contype);
|
||||
void print_decode(void *buf, size_t len);
|
||||
int pck_parse_packet (mqp *mqplib, mqpacket * mqp, u_char * buffer, unsigned long buflen);
|
||||
unsigned long send_ack(mqp *mqplib, mqpacket *mqp, int MID);
|
||||
|
||||
|
||||
void pck_destroy_mqpacket(mqpacket *mqpck, mqprotocol *mqp);
|
||||
mqpacket *pck_create_mqpacket(int type, xds_mode_t direction);
|
||||
lnode_t *pck_find_mid_node(unsigned long MID, list_t *queue);
|
||||
mqpacket *pck_new_packet (int msgtype, unsigned long flags);
|
||||
unsigned long pck_commit_data (mqprotocol * mqp, mqpacket * mqpck);
|
||||
void pck_set_server();
|
||||
int pck_process();
|
||||
int pck_make_connection(struct sockaddr_in sa, void *cbarg);
|
||||
|
||||
|
||||
/* this is the standalone un-threadsafe interface */
|
||||
int init_socket();
|
||||
int debug_socket(int i);
|
||||
int enable_server(int port);
|
||||
int pck_process ();
|
||||
int pck_make_connection (char *hostname, char *, char *, long , void *cbarg);
|
||||
|
||||
|
||||
|
||||
/* these are error defines */
|
||||
#define PCK_ERR_BUFFULL 1
|
||||
#define PCK_ERR_CRC 2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,11 +26,4 @@
|
|||
#ifndef SOCK_H
|
||||
#define SOCK_H
|
||||
|
||||
int ConnectTo (char * host, int port);
|
||||
void read_loop (void);
|
||||
int getmaxsock (void);
|
||||
void sts (const char *buf, const int buflen);
|
||||
void start (void);
|
||||
|
||||
int check_sql_sock();
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
lib_LTLIBRARIES = libmqpacket.la
|
||||
libmqpacket_la_SOURCES = packet.c decodepacket.c encodepacket.c encode.c \
|
||||
libmqpacket_la_SOURCES = packet.c decodepacket.c encodepacket.c\
|
||||
xds.c xds_engine_xdr.c xds_engine_xml.c xds_version.c \
|
||||
xds_engine_xdr_mqs.c protocol.c
|
||||
xds_engine_xdr_mqs.c sock.c
|
||||
include $(top_srcdir)/rules.mk
|
182
Libs/Makefile.in
182
Libs/Makefile.in
|
@ -1,8 +1,8 @@
|
|||
# Makefile.in generated by automake 1.7.9 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -14,13 +14,14 @@
|
|||
|
||||
@SET_MAKE@
|
||||
|
||||
SOURCES = $(libmqpacket_la_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
|
@ -34,8 +35,46 @@ POST_INSTALL = :
|
|||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/rules.mk
|
||||
subdir = Libs
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/Include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libmqpacket_la_LIBADD =
|
||||
am_libmqpacket_la_OBJECTS = packet.lo decodepacket.lo encodepacket.lo \
|
||||
xds.lo xds_engine_xdr.lo xds_engine_xml.lo xds_version.lo \
|
||||
xds_engine_xdr_mqs.lo sock.lo
|
||||
libmqpacket_la_OBJECTS = $(am_libmqpacket_la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/Include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
SOURCES = $(libmqpacket_la_SOURCES)
|
||||
DIST_SOURCES = $(libmqpacket_la_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkglibdir = $(prefix)/modules
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
|
@ -106,6 +145,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
|||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
@ -127,6 +168,7 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
|
@ -143,80 +185,70 @@ xds_uint32_t = @xds_uint32_t@
|
|||
xds_uint64_t = @xds_uint64_t@
|
||||
xds_uint8_t = @xds_uint8_t@
|
||||
lib_LTLIBRARIES = libmqpacket.la
|
||||
libmqpacket_la_SOURCES = packet.c decodepacket.c encodepacket.c encode.c \
|
||||
libmqpacket_la_SOURCES = packet.c decodepacket.c encodepacket.c\
|
||||
xds.c xds_engine_xdr.c xds_engine_xml.c xds_version.c \
|
||||
xds_engine_xdr_mqs.c protocol.c
|
||||
xds_engine_xdr_mqs.c sock.c
|
||||
|
||||
LINK = @echo "Linking $@"; $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
subdir = Libs
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/Include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
|
||||
libmqpacket_la_LDFLAGS =
|
||||
libmqpacket_la_LIBADD =
|
||||
am_libmqpacket_la_OBJECTS = packet.lo decodepacket.lo encodepacket.lo \
|
||||
encode.lo xds.lo xds_engine_xdr.lo xds_engine_xml.lo \
|
||||
xds_version.lo xds_engine_xdr_mqs.lo protocol.lo
|
||||
libmqpacket_la_OBJECTS = $(am_libmqpacket_la_OBJECTS)
|
||||
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/Include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/decodepacket.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/encode.Plo ./$(DEPDIR)/encodepacket.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/packet.Plo ./$(DEPDIR)/protocol.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xds.Plo ./$(DEPDIR)/xds_engine_xdr.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xds_engine_xdr_mqs.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xds_engine_xml.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xds_version.Plo
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
|
||||
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
DIST_SOURCES = $(libmqpacket_la_SOURCES)
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/rules.mk Makefile.am
|
||||
SOURCES = $(libmqpacket_la_SOURCES)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/rules.mk $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Libs/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Libs/Makefile
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
|
||||
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" = "$$p" && dir=.; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
|
@ -224,16 +256,15 @@ libmqpacket.la: $(libmqpacket_la_OBJECTS) $(libmqpacket_la_DEPENDENCIES)
|
|||
$(LINK) -rpath $(libdir) $(libmqpacket_la_LDFLAGS) $(libmqpacket_la_OBJECTS) $(libmqpacket_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT) core *.core
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decodepacket.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encodepacket.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xds.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xds_engine_xdr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xds_engine_xdr_mqs.Plo@am__quote@
|
||||
|
@ -250,14 +281,6 @@ distclean-libtool:
|
|||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
|
@ -266,6 +289,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
|||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
@ -277,10 +301,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
@ -303,13 +328,9 @@ GTAGS:
|
|||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(mkinstalldirs) $(distdir)/..
|
||||
$(mkdir_p) $(distdir)/..
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
|
@ -321,7 +342,7 @@ distdir: $(DISTFILES)
|
|||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
|
@ -339,9 +360,10 @@ distdir: $(DISTFILES)
|
|||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
@ -361,7 +383,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -381,6 +403,8 @@ dvi: dvi-am
|
|||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
@ -418,8 +442,8 @@ uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
|
|||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am info info-am install \
|
||||
install-am install-data install-data-am install-exec \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
|
|
|
@ -42,94 +42,87 @@
|
|||
|
||||
/* this is called from the socket recv code. */
|
||||
int
|
||||
pck_parse_packet (mqprotocol * mqp, u_char * buffer, unsigned long buflen)
|
||||
pck_parse_packet (mqp *mqplib, mqpacket * mqp, u_char * buffer, unsigned long buflen)
|
||||
{
|
||||
mqpacket *mqpck;
|
||||
u_char *buf2, *mybuf;
|
||||
int rc, len;
|
||||
int rc, usedbuf;
|
||||
|
||||
if (mqp->wtforinpack == 1) {
|
||||
if (!strchr(buffer, '\0')) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Buffer isn't terminated\n");
|
||||
}
|
||||
mybuf = malloc(buflen);
|
||||
len = sqlite_decode_binary(buffer, mybuf);
|
||||
printf("decode %d\n", len);
|
||||
/* XXX XDR engine for now */
|
||||
mqpck = pck_create_mqpacket (ENG_TYPE_XDR, XDS_DECODE);
|
||||
if (mqpck == NULL) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger("create packet failed");
|
||||
/* XXX drop client ? */
|
||||
free(mybuf);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
if (xds_setbuffer (mqpck->xds, XDS_LOAN, mybuf, len) != XDS_OK) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("XDS setbuffer Failed");
|
||||
pck_destroy_mqpacket (mqpck, NULL);
|
||||
/* XXX drop client ? */
|
||||
free(mybuf);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
/* lets use a switch here to handle it intelegently */
|
||||
rc = xds_decode (mqpck->xds, "mqpheader", &mqpck);
|
||||
free(mybuf);
|
||||
switch (rc) {
|
||||
|
||||
print_decode(buffer, buflen);
|
||||
|
||||
/* XXX XDR engine for now */
|
||||
if (xds_setbuffer (mqp->xdsin, XDS_LOAN, buffer, buflen) != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("XDS setbuffer Failed");
|
||||
/* XXX drop client ? */
|
||||
return NS_FAILURE;
|
||||
}
|
||||
/* lets use a switch here to handle it intelegently */
|
||||
rc = xds_decode (mqp->xdsin, "mqpheader", mqp);
|
||||
switch (rc) {
|
||||
case XDS_OK:
|
||||
usedbuf = xds_get_usedbuffer (mqp->xdsin);
|
||||
printf("breaking here\n");
|
||||
break;
|
||||
case XDS_ERR_UNDERFLOW:
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("XDS Decode of Header Failed. Buffer Underflow");
|
||||
pck_destroy_mqpacket (mqpck, NULL);
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("XDS Decode of Header Failed. Buffer Underflow");
|
||||
/* don't consume any buffer */
|
||||
return NS_SUCCESS;
|
||||
default:
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("XDS Decode of Header Failed: %d", rc);
|
||||
pck_destroy_mqpacket (mqpck, NULL);
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("XDS Decode of Header Failed: %d", rc);
|
||||
/* drop client */
|
||||
return NS_FAILURE;
|
||||
}
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Got Packet Decode: mid %lu msgtype %d Version %d flags %lu ", mqpck->MID, mqpck->MSGTYPE, mqpck->VERSION, mqpck->flags);
|
||||
|
||||
}
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("Got Packet Decode: mid %d msgtype %d Version %d flags %d ", mqp->inmsg.MID, mqp->inmsg.MSGTYPE, mqp->inmsg.VERSION, mqp->inmsg.flags);
|
||||
/* check the version number */
|
||||
if (mqpck->VERSION != 1) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Invalid Protocol Version recieved");
|
||||
pck_destroy_mqpacket (mqpck, NULL);
|
||||
/* XXX drop client ? */
|
||||
return NS_FAILURE;
|
||||
}
|
||||
/* ok, lets handle this message based on the message type */
|
||||
switch (mqpck->MSGTYPE) {
|
||||
|
||||
|
||||
if (mqp->inmsg.VERSION != 1) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("Invalid Protocol Version recieved");
|
||||
/* XXX drop client ? */
|
||||
return usedbuf;
|
||||
}
|
||||
/* ok, lets handle this message based on the message type */
|
||||
switch (mqp->inmsg.MSGTYPE) {
|
||||
case PCK_ACK:
|
||||
rc = xds_decode(mqp->xdsin, PCK_ACK_FMT, &mqp->inmsg.data.num);
|
||||
printf("%d\n", mqp->inmsg.data.num);
|
||||
break;
|
||||
case PCK_ERROR:
|
||||
mqp->inmsg.data.string = malloc(BUFSIZE);
|
||||
rc = xds_decode(mqp->xdsin, PCK_ERROR_FMT, &mqp->inmsg.data.string);
|
||||
printf("%s\n", mqp->inmsg.data.string);
|
||||
break;
|
||||
case PCK_SRVCAP:
|
||||
rc = xds_decode(mqp->xdsin, PCK_SRVCAP_FMT, &mqp->inmsg.data.srvcap->srvcap1, &mqp->inmsg.data.srvcap->srvcap2, &mqp->inmsg.data.srvcap->capstr);
|
||||
printf("%d %d\n", strlen(mqp->inmsg.data.srvcap->capstr), rc);
|
||||
printf("%d %d %s\n", mqp->inmsg.data.srvcap->srvcap1, mqp->inmsg.data.srvcap->srvcap2, mqp->inmsg.data.srvcap->capstr);
|
||||
break;
|
||||
default:
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Invalid MsgType Recieved");
|
||||
// pck_destroy_mqpacket (mqpck, NULL);
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("Invalid MsgType Recieved");
|
||||
/* XXX drop client */
|
||||
return usedbuf;
|
||||
}
|
||||
switch (rc) {
|
||||
case XDS_OK:
|
||||
usedbuf = xds_get_usedbuffer (mqp->xdsin);
|
||||
printf("decode data ok\n");
|
||||
break;
|
||||
case XDS_ERR_UNDERFLOW:
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("XDS Decode of Data Failed. Buffer Underflow");
|
||||
/* don't consume any buffer */
|
||||
return NS_SUCCESS;
|
||||
default:
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("XDS Decode of Data Failed: %d", rc);
|
||||
/* drop client */
|
||||
return NS_FAILURE;
|
||||
}
|
||||
/* finished processing the message. grab what buffer we consumed and return */
|
||||
// rc = xds_get_usedbuffer (mqpck->xds);
|
||||
// pck_destroy_mqpacket (mqpck, NULL);
|
||||
return len;
|
||||
}
|
||||
|
||||
/* nothing done on the buffer, so return 0 */
|
||||
return 0;
|
||||
/* finished processing the message. grab what buffer we consumed and return */
|
||||
return usedbuf;
|
||||
}
|
||||
|
||||
void
|
||||
pck_send_err (mqprotocol * mqp, int err, const char *msg)
|
||||
{
|
||||
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("pck_send_error: %s", msg);
|
||||
|
||||
}
|
||||
|
|
|
@ -31,90 +31,130 @@
|
|||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
/* needed for crc32 function */
|
||||
#include <zlib.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "list.h"
|
||||
#include "packet.h"
|
||||
#include "getchar.h"
|
||||
|
||||
#define SRVCAP1 2
|
||||
#define SRVCAP2 3
|
||||
|
||||
|
||||
int sqlite_encode_binary (const unsigned char *in, int n, unsigned char *out);
|
||||
unsigned long pck_commit_data (mqp * mqplib, mqpacket * mqpck);
|
||||
void print_decode(void *buf, size_t len);
|
||||
|
||||
mqpacket *
|
||||
pck_new_packet (int msgtype, unsigned long flags)
|
||||
{
|
||||
mqpacket *mqpck;
|
||||
|
||||
mqpck = pck_create_mqpacket (ENG_TYPE_XDR, XDS_ENCODE);
|
||||
if (mqpck == NULL)
|
||||
return NULL;
|
||||
/* MID is null till we send, this way we can reuse this packet def */
|
||||
mqpck->MID = -1;
|
||||
mqpck->MSGTYPE = msgtype;
|
||||
mqpck->flags = flags;
|
||||
mqpck->dataoffset = 0;
|
||||
mqpck->data = NULL;
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Created a New Packet with MID %lud", mqpck->MID);
|
||||
return mqpck;
|
||||
|
||||
int pck_prepare(mqp *mqplib, mqpacket *mqp, int type) {
|
||||
int rc;
|
||||
if (mqp->outmsg.MID == -1) {
|
||||
mqp->outmsg.MID = mqp->nxtoutmid++;
|
||||
mqp->outmsg.VERSION = 1;
|
||||
mqp->outmsg.MSGTYPE = type;
|
||||
rc = xds_encode (mqp->xdsout, "mqpheader", mqp);
|
||||
if (rc != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("xds encode header failed %d.", rc);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
} else {
|
||||
if (mqplib->logger) {
|
||||
mqplib->logger("Outbound Message Not clear %d", mqp->outmsg.MID);
|
||||
}
|
||||
return NS_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
pck_set_packet_data (mqpacket * mqpck, void *data, size_t len)
|
||||
{
|
||||
/* if its empty, malloc it */
|
||||
/* size is taken from encode.c sqlite_encode_binary description */
|
||||
#if 0
|
||||
mqpck->data = malloc (2 + (257 * len) / 254);
|
||||
mqpck->dataoffset = sqlite_encode_binary (data, len, mqpck->data);
|
||||
printf ("Encode Size %lu Allocated %d\n", mqpck->dataoffset, 2 + (257 * len) / 254);
|
||||
#endif
|
||||
int pck_remove(mqp *mqplib, mqpacket *mqp) {
|
||||
mqp->outmsg.MID = -1;
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
pck_commit_data (mqprotocol * mqp, mqpacket * mqpck)
|
||||
{
|
||||
lnode_t *node;
|
||||
int rc;
|
||||
unsigned char *data;
|
||||
int length;
|
||||
|
||||
if (list_isfull (mqp->outpack)) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("OutBuffer is Full.");
|
||||
unsigned long pck_send_ack(mqp *mqplib, mqpacket *mqp, int MID) {
|
||||
int rc;
|
||||
|
||||
if (pck_prepare(mqplib, mqp, PCK_ACK) != NS_SUCCESS) {
|
||||
return NS_FAILURE;
|
||||
}
|
||||
if (mqpck == NULL) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger("pck_commit_data was empty");
|
||||
rc = xds_encode (mqp->xdsout, PCK_ACK_FMT, MID);
|
||||
|
||||
if (rc != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("xds encode ack failed %d.", rc);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
|
||||
/* we are always at version one atm */
|
||||
mqpck->VERSION = 1;
|
||||
/* increment the mid */
|
||||
mqpck->MID = mqp->nxtoutmid++;
|
||||
rc = xds_encode (mqpck->xds, "mqpheader", &mqpck);
|
||||
|
||||
if (rc != XDS_OK) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("xds encode header failed %d.", rc);
|
||||
pck_destroy_mqpacket (mqpck, NULL);
|
||||
return -1;
|
||||
}
|
||||
rc = xds_getbuffer (mqpck->xds, XDS_GIFT, (void **) &mqpck->data, (size_t *)&mqpck->dataoffset) ;
|
||||
if (rc != XDS_OK) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("OutBuffer is Full. %d", rc);
|
||||
pck_destroy_mqpacket (mqpck, NULL);
|
||||
return -1;
|
||||
}
|
||||
node = lnode_create (mqpck);
|
||||
list_append (mqp->outpack, node);
|
||||
write_fd(mqp->sock, mqp);
|
||||
|
||||
return mqpck->MID;
|
||||
return (pck_commit_data(mqplib, mqp));
|
||||
}
|
||||
|
||||
unsigned long pck_send_srvcap(mqp *mqplib, mqpacket *mqp) {
|
||||
int rc;
|
||||
char srvcap[BUFSIZE];
|
||||
|
||||
|
||||
if (pck_prepare(mqplib, mqp, PCK_SRVCAP) != NS_SUCCESS) {
|
||||
return NS_FAILURE;
|
||||
}
|
||||
|
||||
snprintf(srvcap, BUFSIZE, "STD");
|
||||
#ifdef DEBUG
|
||||
strncat(srvcap, ":DBG", BUFSIZE);
|
||||
#endif
|
||||
rc = xds_encode (mqp->xdsout, PCK_SRVCAP_FMT, SRVCAP1, SRVCAP2, srvcap);
|
||||
|
||||
if (rc != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("xds encode srvcap failed %d.", rc);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
|
||||
return (pck_commit_data(mqplib, mqp));
|
||||
}
|
||||
|
||||
|
||||
unsigned long pck_send_error(mqp *mqplib, mqpacket *mqp, char *fmt, ...) {
|
||||
int rc;
|
||||
va_list ap;
|
||||
char log_buf[BUFSIZE];
|
||||
|
||||
if (pck_prepare(mqplib, mqp, PCK_ERROR) != NS_SUCCESS) {
|
||||
return NS_FAILURE;
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(log_buf, BUFSIZE, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
rc = xds_encode (mqp->xdsout, PCK_ERROR_FMT, log_buf);
|
||||
|
||||
if (rc != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("xds encode error failed %d.", rc);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
|
||||
return (pck_commit_data(mqplib, mqp));
|
||||
}
|
||||
|
||||
|
||||
unsigned long
|
||||
pck_commit_data (mqp * mqplib, mqpacket * mqpck)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = xds_getbuffer (mqpck->xdsout, XDS_GIFT, (void **) &mqpck->outbuffer, &mqpck->outbufferlen) ;
|
||||
if (rc != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("OutBuffer is Full. %d", rc);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
print_decode(mqpck->outbuffer, mqpck->outbufferlen);
|
||||
write_fd(mqplib, mqpck);
|
||||
rc = mqpck->outmsg.MID;
|
||||
pck_remove(mqplib, mqpck);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
|
718
Libs/packet.c
718
Libs/packet.c
|
@ -34,368 +34,202 @@
|
|||
#include "defines.h"
|
||||
#include "list.h"
|
||||
#include "packet.h"
|
||||
#include "getchar.h"
|
||||
#include "xds.h"
|
||||
|
||||
|
||||
int close_fd (int fd, mqprotocol * mqp);
|
||||
int buffer_add (mqprotocol * mqp, void *data, size_t datlen);
|
||||
void buffer_del (mqprotocol * mqp, size_t drainlen);
|
||||
int sqlite_encode_binary (const unsigned char *in, int n, unsigned char *out);
|
||||
int listen_on_port (int port);
|
||||
int pck_accept_connection (int fd);
|
||||
int close_fd (mqp *mqplib, mqpacket * mqp);
|
||||
int buffer_add (mqpacket * mqp, void *data, size_t datlen);
|
||||
void buffer_del (mqpacket * mqp, size_t drainlen);
|
||||
|
||||
|
||||
|
||||
myengines enc_xdr_engines[NUMENGINES] = {
|
||||
{ xdr_encode_uint32, "uint32" },
|
||||
{ xdr_encode_int32, "int32" },
|
||||
{ xdr_encode_uint64, "unit64" },
|
||||
{ xdr_encode_int64, "int64" },
|
||||
{ xdr_encode_float, "float" },
|
||||
{ xdr_encode_double, "double" },
|
||||
{ xdr_encode_octetstream, "octet" },
|
||||
{ xdr_encode_string, "string" },
|
||||
{ encode_mqs_header, "mqpheader" },
|
||||
};
|
||||
|
||||
myengines dec_xdr_engines[NUMENGINES] = {
|
||||
{ xdr_decode_uint32, "uint32" },
|
||||
{ xdr_decode_int32, "int32" },
|
||||
{ xdr_decode_uint64, "unit64" },
|
||||
{ xdr_decode_int64, "int64" },
|
||||
{ xdr_decode_float, "float" },
|
||||
{ xdr_decode_double, "double" },
|
||||
{ xdr_decode_octetstream, "octet" },
|
||||
{ xdr_decode_string, "string" },
|
||||
{ decode_mqs_header, "mqpheader" },
|
||||
};
|
||||
|
||||
myengines enc_xml_engines[NUMENGINES] = {
|
||||
{ xml_encode_uint32, "uint32" },
|
||||
{ xml_encode_int32, "int32" },
|
||||
{ xml_encode_uint64, "unit64" },
|
||||
{ xml_encode_int64, "int64" },
|
||||
{ xml_encode_float, "float" },
|
||||
{ xml_encode_double, "double" },
|
||||
{ xml_encode_octetstream, "octet" },
|
||||
{ xml_encode_string, "string" },
|
||||
};
|
||||
|
||||
myengines dec_xml_engines[NUMENGINES] = {
|
||||
{ xml_decode_uint32, "uint32" },
|
||||
{ xml_decode_int32, "int32" },
|
||||
{ xml_decode_uint64, "unit64" },
|
||||
{ xml_decode_int64, "int64" },
|
||||
{ xml_decode_float, "float" },
|
||||
{ xml_decode_double, "double" },
|
||||
{ xml_decode_octetstream, "octet" },
|
||||
{ xml_decode_string, "string" },
|
||||
myeng standeng[] = {
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_uint32, "uint32" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_int32, "int32" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_uint64, "unit64" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_int64, "int64" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_float, "float" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_double, "double" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_octetstream, "octet" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, xdr_encode_string, "string" },
|
||||
{ XDS_ENCODE, ENG_TYPE_XDR, encode_mqs_header, "mqpheader" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_uint32, "uint32" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_int32, "int32" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_uint64, "unit64" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_int64, "int64" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_float, "float" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_double, "double" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_octetstream, "octet" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, xdr_decode_string, "string" },
|
||||
{ XDS_DECODE, ENG_TYPE_XDR, decode_mqs_header, "mqpheader" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_uint32, "uint32" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_int32, "int32" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_uint64, "unit64" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_int64, "int64" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_float, "float" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_double, "double" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_octetstream, "octet" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_encode_string, "string" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_uint32, "uint32" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_int32, "int32" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_uint64, "unit64" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_int64, "int64" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_float, "float" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_double, "double" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_octetstream, "octet" },
|
||||
{ XDS_DECODE, ENG_TYPE_XML, xml_decode_string, "string" },
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
void
|
||||
pck_init ()
|
||||
{
|
||||
int i;
|
||||
connections = list_create (-1);
|
||||
if (mqpconfig.server) {
|
||||
i = listen_on_port (mqpconfig.port);
|
||||
if (i > 0) {
|
||||
mqpconfig.listenfd = i;
|
||||
} else {
|
||||
mqpconfig.listenfd = -1;
|
||||
}
|
||||
} else {
|
||||
mqpconfig.listenfd = -1;
|
||||
}
|
||||
mqp *init_mqlib () {
|
||||
|
||||
mqp *mqplib;
|
||||
|
||||
mqplib = malloc(sizeof(mqp));
|
||||
mqplib->logger = NULL;
|
||||
|
||||
mqplib->myengines = standeng;
|
||||
return mqplib;
|
||||
}
|
||||
|
||||
void
|
||||
pck_set_logger (logfunc * logger)
|
||||
pck_set_logger (mqp *mqplib, logfunc * logger)
|
||||
{
|
||||
mqpconfig.logger = logger;
|
||||
mqplib->logger = logger;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pck_set_server ()
|
||||
{
|
||||
mqpconfig.server = 1;
|
||||
mqpconfig.port = 8888;
|
||||
pck_set_callback(mqp *mqplib, callbackfunc *callback) {
|
||||
mqplib->callback = callback;
|
||||
}
|
||||
|
||||
void
|
||||
pck_set_port (int port)
|
||||
{
|
||||
mqpconfig.port = port;
|
||||
}
|
||||
|
||||
static int
|
||||
compare_mid (const void *key1, const void *key2)
|
||||
{
|
||||
mqpacket *mqpck = (void *) key1;
|
||||
unsigned long mid = (int) key2;
|
||||
|
||||
if (mqpck->MID == mid) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
compare_fd (const void *key1, const void *key2)
|
||||
{
|
||||
mqprotocol *mqp = (void *) key1;
|
||||
unsigned long fd = (int) key2;
|
||||
|
||||
if (mqp->sock == fd) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
lnode_t *
|
||||
pck_find_fd_node (unsigned long fd, list_t * queue)
|
||||
{
|
||||
return (list_find (queue, (void *) fd, compare_fd));
|
||||
}
|
||||
|
||||
|
||||
lnode_t *
|
||||
pck_find_mid_node (unsigned long MID, list_t * queue)
|
||||
{
|
||||
return (list_find (queue, (void *) MID, compare_mid));
|
||||
void
|
||||
pck_set_authcallback(mqp *mqplib, connectauthfunc *ca) {
|
||||
mqplib->connectauth = ca;
|
||||
}
|
||||
|
||||
mqpacket *
|
||||
pck_create_mqpacket (int type, xds_mode_t direction)
|
||||
pck_new_connection (mqp *mqplib, int fd, int type, int contype)
|
||||
{
|
||||
int i, rc;
|
||||
mqpacket *mqpck;
|
||||
|
||||
mqpck = malloc (sizeof (mqpacket));
|
||||
if (xds_init (&mqpck->xds, direction) != XDS_OK) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("xds init failed: %s", strerror (errno));
|
||||
mqpck->offset = mqpck->outoffset = 0;
|
||||
mqpck->sock = fd;
|
||||
mqpck->outmsg.MID = -1;
|
||||
mqpck->nxtoutmid = 1;
|
||||
|
||||
if (xds_init (&mqpck->xdsin, XDS_DECODE) != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("xds init failed: %s", strerror (errno));
|
||||
free (mqpck);
|
||||
return NULL;
|
||||
}
|
||||
if (xds_init (&mqpck->xdsout, XDS_ENCODE) != XDS_OK) {
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("xds init failed: %s", strerror (errno));
|
||||
free (mqpck);
|
||||
return NULL;
|
||||
}
|
||||
i = 0;
|
||||
switch (type) {
|
||||
case ENG_TYPE_XDR:
|
||||
while (i < NUMENGINES) {
|
||||
if (direction == XDS_ENCODE) {
|
||||
rc = xds_register (mqpck->xds, enc_xdr_engines[i].myname, enc_xdr_engines[i].ptr, NULL);
|
||||
while (i < NUMENGINES) {
|
||||
if (mqplib->myengines[i].type == type) {
|
||||
if (mqplib->myengines[i].dir == XDS_ENCODE) {
|
||||
rc = xds_register (mqpck->xdsout, mqplib->myengines[i].myname, mqplib->myengines[i].ptr, NULL);
|
||||
} else {
|
||||
rc = xds_register (mqpck->xds, dec_xdr_engines[i].myname, dec_xdr_engines[i].ptr, NULL);
|
||||
rc = xds_register (mqpck->xdsin, mqplib->myengines[i].myname, mqplib->myengines[i].ptr, NULL);
|
||||
}
|
||||
if (rc != XDS_OK) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("xds_register failed for %s", dec_xdr_engines[i].myname);
|
||||
xds_destroy (mqpck->xds);
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("xds_register failed for %s", mqplib->myengines[i].myname);
|
||||
xds_destroy (mqpck->xdsout);
|
||||
xds_destroy (mqpck->xdsin);
|
||||
free (mqpck);
|
||||
mqpck = NULL;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return mqpck;
|
||||
case ENG_TYPE_XML:
|
||||
while (i < NUMENGINES - 1) {
|
||||
if (direction == XDS_ENCODE) {
|
||||
rc = xds_register (mqpck->xds, enc_xml_engines[i].myname, enc_xml_engines[i].ptr, NULL);
|
||||
} else {
|
||||
rc = xds_register (mqpck->xds, dec_xml_engines[i].myname, dec_xml_engines[i].ptr, NULL);
|
||||
}
|
||||
if (rc != XDS_OK) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("xds_register failed for %s", dec_xml_engines[i].myname);
|
||||
xds_destroy (mqpck->xds);
|
||||
free (mqpck);
|
||||
mqpck = NULL;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return mqpck;
|
||||
default:
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("invalid pck_create_mqpacket type %d", type);
|
||||
xds_destroy (mqpck->xds);
|
||||
free (mqpck);
|
||||
mqpck = NULL;
|
||||
return mqpck;
|
||||
i++;
|
||||
}
|
||||
|
||||
switch (contype) {
|
||||
case PCK_IS_CLIENT:
|
||||
pck_send_srvcap(mqplib, mqpck);
|
||||
break;
|
||||
case PCK_IS_SERVER:
|
||||
break;
|
||||
default:
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("pck_new_connection invalid type %d", contype);
|
||||
break;
|
||||
}
|
||||
return mqpck;
|
||||
}
|
||||
|
||||
void
|
||||
pck_destroy_mqpacket (mqpacket * mqpck, mqprotocol * mqp)
|
||||
pck_del_connection (mqp *mqplib, mqpacket * mqpck)
|
||||
{
|
||||
lnode_t *node;
|
||||
|
||||
if (mqp) {
|
||||
node = pck_find_mid_node (mqpck->MID, mqp->inpack);
|
||||
if (node) {
|
||||
#ifdef DEBUG
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Destroy Packet MessageID %lu", mqpck->MID);
|
||||
#endif
|
||||
list_delete (mqp->inpack, node);
|
||||
lnode_destroy (node);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
if (mqpck->data) free (mqpck->data);
|
||||
xds_destroy (mqpck->xds);
|
||||
#endif
|
||||
xds_destroy (mqpck->xdsout);
|
||||
xds_destroy (mqpck->xdsin);
|
||||
free (mqpck);
|
||||
|
||||
}
|
||||
|
||||
|
||||
mqprotocol *
|
||||
pck_new_conn (void *cbarg, int type)
|
||||
{
|
||||
mqprotocol *mqp;
|
||||
lnode_t *node;
|
||||
|
||||
if (type > 0 && type < 4) {
|
||||
mqp = malloc (sizeof (mqprotocol));
|
||||
bzero (mqp, sizeof (mqprotocol));
|
||||
mqp->inpack = list_create (-1);
|
||||
mqp->outpack = list_create (-1);
|
||||
mqp->cbarg = cbarg;
|
||||
mqp->sock = 0;
|
||||
mqp->pollopts = 0;
|
||||
mqp->servorclnt = type;
|
||||
mqp->nxtoutmid = mqp->nxtinmid = 1;
|
||||
/* we are waiting for a new packet */
|
||||
mqp->wtforinpack = 1;
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("New Protocol Struct created %d", type);
|
||||
node = lnode_create (mqp);
|
||||
list_append (connections, node);
|
||||
return mqp;
|
||||
} else {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Invalid Connection Type %d", type);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
pck_free_conn (mqprotocol * mqp)
|
||||
{
|
||||
lnode_t *node, *node2;
|
||||
mqprotocol *mqp2;
|
||||
mqpacket *mqpck;
|
||||
|
||||
node = list_first (connections);
|
||||
while (node != NULL) {
|
||||
mqp2 = lnode_get (node);
|
||||
if (mqp2 == mqp) {
|
||||
/* its a match */
|
||||
list_delete (connections, node);
|
||||
lnode_destroy (node);
|
||||
node2 = list_first (mqp->inpack);
|
||||
while (node2 != NULL) {
|
||||
mqpck = lnode_get (node2);
|
||||
free (mqpck->data);
|
||||
xds_destroy (mqpck->xds);
|
||||
free (mqpck);
|
||||
node2 = list_next (mqp->inpack, node2);
|
||||
}
|
||||
node2 = list_first (mqp->outpack);
|
||||
while (node2 != NULL) {
|
||||
mqpck = lnode_get (node2);
|
||||
free (mqpck->data);
|
||||
xds_destroy (mqpck->xds);
|
||||
free (mqpck);
|
||||
node2 = list_next (mqp->outpack, node2);
|
||||
}
|
||||
list_destroy_nodes (mqp->inpack);
|
||||
list_destroy_nodes (mqp->outpack);
|
||||
list_destroy (mqp->inpack);
|
||||
list_destroy (mqp->outpack);
|
||||
free (mqp);
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Deleted Protocol Struct");
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
}
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Couldn't Find Protocol Struct for deletion");
|
||||
return NS_FAILURE;
|
||||
}
|
||||
|
||||
int
|
||||
read_fd (int fd, void *arg)
|
||||
read_fd (mqp *mqplib, mqpacket *mqp)
|
||||
{
|
||||
void *buf[BUFSIZE];
|
||||
mqprotocol *mqp;
|
||||
size_t i;
|
||||
lnode_t *node;
|
||||
printf("read %d\n", fd);
|
||||
|
||||
node = pck_find_fd_node (fd, connections);
|
||||
if (node) {
|
||||
mqp = lnode_get (node);
|
||||
bzero (buf, BUFSIZE);
|
||||
i = read (fd, buf, BUFSIZE);
|
||||
printf("read %d bytes from %d\n", i,fd);
|
||||
if (i < 1) {
|
||||
/* error */
|
||||
close_fd (fd, mqp);
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger("Failed to Read fd %d: %s", fd, strerror(errno));
|
||||
/* XXX close and clean up */
|
||||
return NS_FAILURE;
|
||||
} else {
|
||||
buffer_add (mqp, buf, i);
|
||||
}
|
||||
/* don't process packet till its authed */
|
||||
if (MQP_IS_AUTHED(mqp)) {
|
||||
i = pck_parse_packet (mqp, mqp->buffer, mqp->offset);
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("processed %d bytes %d left", i, mqp->offset);
|
||||
if (i > 0) {
|
||||
buffer_del (mqp, i);
|
||||
} else if (i == -1) {
|
||||
close_fd (fd, mqp);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Can't find client for %d", fd);
|
||||
close_fd (fd, NULL);
|
||||
|
||||
printf("read %d\n", mqp->sock);
|
||||
bzero (buf, BUFSIZE);
|
||||
i = read (mqp->sock, buf, BUFSIZE);
|
||||
printf("read %d bytes from %d\n", i,mqp->sock);
|
||||
if (i < 1) {
|
||||
/* error */
|
||||
close_fd (mqplib, mqp);
|
||||
if (mqplib->logger)
|
||||
mqplib->logger("Failed to Read fd %d: %s", mqp->sock, strerror(errno));
|
||||
/* XXX close and clean up */
|
||||
return NS_FAILURE;
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
close_fd (int fd, mqprotocol * mqp)
|
||||
{
|
||||
lnode_t *node;
|
||||
if (!mqp) {
|
||||
node = pck_find_fd_node (fd, connections);
|
||||
if (node)
|
||||
mqp = lnode_get (node);
|
||||
}
|
||||
if (mqp) {
|
||||
pck_free_conn (mqp);
|
||||
} else {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Closing a FD without a connection?");
|
||||
buffer_add (mqp, buf, i);
|
||||
}
|
||||
close (fd);
|
||||
/* don't process packet till its authed */
|
||||
while ((mqp->offset > 0) && i > 0) {
|
||||
i = pck_parse_packet (mqplib, mqp, mqp->buffer, mqp->offset);
|
||||
if (i > 0) {
|
||||
buffer_del (mqp, i);
|
||||
} else if (i < 0) {
|
||||
close_fd (mqplib, mqp);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
}
|
||||
if (mqplib->logger) {
|
||||
mqplib->logger ("processed %d bytes %d left", i, mqp->offset);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
close_fd (mqp *mqplib, mqpacket * mqp)
|
||||
{
|
||||
pck_del_connection (mqplib, mqp);
|
||||
close (mqp->sock);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
buffer_add (mqprotocol * mqp, void *data, size_t datlen)
|
||||
buffer_add (mqpacket * mqp, void *data, size_t datlen)
|
||||
{
|
||||
size_t need = mqp->offset + datlen;
|
||||
// size_t oldoff = mqp->offset;
|
||||
|
@ -426,7 +260,7 @@ buffer_add (mqprotocol * mqp, void *data, size_t datlen)
|
|||
}
|
||||
|
||||
void
|
||||
buffer_del (mqprotocol * mqp, size_t drainlen)
|
||||
buffer_del (mqpacket * mqp, size_t drainlen)
|
||||
{
|
||||
|
||||
memmove (mqp->buffer, mqp->buffer + drainlen, mqp->offset - drainlen);
|
||||
|
@ -434,26 +268,10 @@ buffer_del (mqprotocol * mqp, size_t drainlen)
|
|||
}
|
||||
|
||||
int
|
||||
write_fd (int fd, mqprotocol * mqp)
|
||||
write_fd (mqp *mqplib, mqpacket * mqp)
|
||||
{
|
||||
int i, len;
|
||||
lnode_t *node;
|
||||
mqpacket *mqpacket;
|
||||
int i;
|
||||
|
||||
|
||||
if (!mqp) {
|
||||
node = pck_find_fd_node (fd, connections);
|
||||
if (node) {
|
||||
mqp = lnode_get (node);
|
||||
} else {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Can not find mqprotocol for fd %d", fd);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
}
|
||||
/* ok, first we figure out what stage we are at */
|
||||
printf("write %d buf: %d count: %d\n", fd, mqp->outbufferlen, list_count(mqp->outpack));
|
||||
|
||||
if (mqp->outbufferlen > 0) {
|
||||
i = write (mqp->sock, mqp->outbuffer, mqp->outbufferlen);
|
||||
printf("write %d - %d\n", mqp->sock, i);
|
||||
|
@ -467,254 +285,28 @@ printf("write %d buf: %d count: %d\n", fd, mqp->outbufferlen, list_count(mqp->ou
|
|||
mqp->pollopts |= POLLOUT;
|
||||
} else {
|
||||
/* something went wrong sending the data */
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Error Sending on fd %d", mqp->sock);
|
||||
close_fd (mqp->sock, mqp);
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("Error Sending on fd %d", mqp->sock);
|
||||
close_fd (mqplib, mqp);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
}
|
||||
if (list_count (mqp->outpack) > 0) {
|
||||
node = list_first (mqp->outpack);
|
||||
mqpacket = lnode_get (node);
|
||||
len = 2 + (257 * mqpacket->dataoffset) / 254;
|
||||
mqp->outbuffer = malloc (len);
|
||||
bzero(mqp->outbuffer, len);
|
||||
mqp->outbufferlen = sqlite_encode_binary (mqpacket->data, mqpacket->dataoffset, mqp->outbuffer);
|
||||
printf("len %d %d %d\n", len, mqpacket->dataoffset, mqp->outbufferlen);
|
||||
mqp->outoffset = mqp->outbufferlen;
|
||||
if (mqp->outbufferlen > 0) {
|
||||
i = write (mqp->sock, mqp->outbuffer, mqp->outbufferlen);
|
||||
list_delete (mqp->outpack, node);
|
||||
lnode_destroy (node);
|
||||
if (i == mqp->outbufferlen) {
|
||||
free (mqp->outbuffer);
|
||||
mqp->bufferlen = mqp->offset = 0;
|
||||
mqp->pollopts &= ~POLLOUT;
|
||||
} else if (i > 0) {
|
||||
memmove (mqp->outbuffer, mqp->outbuffer + i, mqp->outoffset - i);
|
||||
mqp->outoffset = mqp->outoffset - i;
|
||||
mqp->pollopts |= POLLOUT;
|
||||
} else {
|
||||
/* something went wrong sending the data */
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Error Sending on fd %d", mqp->sock);
|
||||
close_fd (mqp->sock, mqp);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
} else {
|
||||
/* somethign went wrong encoding the data */
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Error Encoding the data on fd %d", mqp->sock);
|
||||
close_fd (mqp->sock, mqp);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
pck_before_poll (struct pollfd ufds[MAXCONNECTIONS])
|
||||
{
|
||||
lnode_t *node;
|
||||
mqprotocol *mqp;
|
||||
int count = 0;
|
||||
|
||||
node = list_first (connections);
|
||||
while (node != NULL) {
|
||||
mqp = lnode_get (node);
|
||||
printf("mqp->sock %d events (%d) - %d\n", mqp->sock, mqp->pollopts, list_count(connections));
|
||||
if (mqp->pollopts > 0) {
|
||||
//ufds = realloc (ufds, count + 1 * sizeof (struct pollfd));
|
||||
ufds[count].fd = mqp->sock;
|
||||
ufds[count].events = mqp->pollopts;
|
||||
count++;
|
||||
}
|
||||
node = list_next (connections, node);
|
||||
if (count == (MAXCONNECTIONS -1)) {
|
||||
printf("count %d\n", count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* now do the listen ports */
|
||||
if (mqpconfig.listenfd > 0) {
|
||||
printf("doing listen port %d\n", mqpconfig.listenfd);
|
||||
//ufds = realloc (ufds, count + 1 * sizeof (struct pollfd));
|
||||
ufds[count].fd = mqpconfig.listenfd;
|
||||
/* XXX */
|
||||
ufds[count].events = POLLIN;
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
pck_after_poll (const struct pollfd *ufds, int nfds)
|
||||
{
|
||||
int i;
|
||||
printf("%d\n", nfds);
|
||||
if (nfds == 0) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
for (i = 0; i <= nfds; i++) {
|
||||
printf("checking fd %d %d\n", ufds[i].fd, ufds[i].revents);
|
||||
if (mqpconfig.listenfd == ufds[i].fd) {
|
||||
printf("accept!\n");
|
||||
pck_accept_connection (ufds[i].fd);
|
||||
continue;
|
||||
}
|
||||
if (ufds[i].revents & POLLHUP || ufds[i].revents & POLLERR) {
|
||||
printf("close %d\n", ufds[i].fd);
|
||||
close_fd (ufds[i].fd, NULL);
|
||||
}
|
||||
if (ufds[i].revents & POLLIN) {
|
||||
printf("readfd %d\n", ufds[i].fd);
|
||||
read_fd (ufds[i].fd, NULL);
|
||||
}
|
||||
if (ufds[i].revents & POLLOUT) {
|
||||
printf("writefd %d\n", ufds[i].fd);
|
||||
write_fd (ufds[i].fd, NULL);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
pck_process ()
|
||||
{
|
||||
struct pollfd ufds[MAXCONNECTIONS];
|
||||
int i, j;
|
||||
|
||||
/* first thing we do is see if we are meant to be a server */
|
||||
if (mqpconfig.server == 1 && mqpconfig.listenfd == -1) {
|
||||
i = listen_on_port (mqpconfig.port);
|
||||
if (i > 0) {
|
||||
mqpconfig.listenfd = i;
|
||||
} else {
|
||||
mqpconfig.listenfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
i = pck_before_poll (ufds);
|
||||
j = poll (ufds, i, 100);
|
||||
|
||||
if (j < 0) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger("poll returned %d: %s", j, strerror(j));
|
||||
return NS_FAILURE;
|
||||
}
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger("checked %d returned %d", i, j);
|
||||
return pck_after_poll (ufds, j);
|
||||
}
|
||||
|
||||
int
|
||||
listen_on_port (int port)
|
||||
{
|
||||
int srvfd; /* FD for our listen server socket */
|
||||
struct sockaddr_in srvskt;
|
||||
int adrlen;
|
||||
int flags;
|
||||
|
||||
adrlen = sizeof (struct sockaddr_in);
|
||||
(void) memset ((void *) &srvskt, 0, (size_t) adrlen);
|
||||
srvskt.sin_family = AF_INET;
|
||||
srvskt.sin_addr.s_addr = INADDR_ANY;
|
||||
srvskt.sin_port = htons (port);
|
||||
|
||||
|
||||
if ((srvfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("SqlSrv: Unable to get socket for port %d.", port);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
flags = fcntl (srvfd, F_GETFL, 0);
|
||||
flags |= O_NONBLOCK;
|
||||
// (void) fcntl (srvfd, F_SETFL, flags);
|
||||
// setsockopt(srvfd, SOL_SOCKET, SO_REUSEADDR, (char*) 1, sizeof(1));
|
||||
|
||||
if (bind (srvfd, (struct sockaddr *) &srvskt, adrlen) < 0) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Unable to bind to port %d", port);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
if (listen (srvfd, 1) < 0) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Unable to listen on port %d", port);
|
||||
return -1;
|
||||
}
|
||||
return (srvfd);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
pck_accept_connection (int fd)
|
||||
{
|
||||
unsigned int al;
|
||||
struct sockaddr_in client_address;
|
||||
int l;
|
||||
mqprotocol *mqp;
|
||||
|
||||
memset (&client_address, 0, al = sizeof (client_address));
|
||||
l = accept (fd, (struct sockaddr *) &client_address, &al);
|
||||
if (l < 0) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Accept Failed on %d: %s", fd, strerror (errno));
|
||||
return NS_FAILURE;
|
||||
}
|
||||
mqp = pck_new_conn (NULL, PCK_IS_CLIENT);
|
||||
mqp->sock = l;
|
||||
mqp->flags = 0;
|
||||
if (mqpconfig.connectauth) {
|
||||
if (!mqpconfig.connectauth (mqp->sock, client_address)) {
|
||||
/* close the sock */
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Un-Authorized Connection. Dropping %d", l);
|
||||
close_fd (l, mqp);
|
||||
}
|
||||
} else {
|
||||
MQP_SET_AUTHED(mqp);
|
||||
}
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Connection on fd %d", l);
|
||||
|
||||
/* send out caps and wait for reply for client caps */
|
||||
pck_send_srvcap(mqp);
|
||||
mqp->pollopts |= POLLIN;
|
||||
return l;
|
||||
}
|
||||
|
||||
int
|
||||
pck_make_connection (struct sockaddr_in sa, void *cbarg)
|
||||
{
|
||||
int s;
|
||||
int flags;
|
||||
mqprotocol *mqp;
|
||||
|
||||
if ((s = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Can't create socket");
|
||||
/* somethign went wrong encoding the data */
|
||||
if (mqplib->logger)
|
||||
mqplib->logger ("No Data to Send?");
|
||||
close_fd (mqplib, mqp);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
/* XXX bind */
|
||||
flags = fcntl (s, F_GETFL, 0);
|
||||
flags |= O_NONBLOCK;
|
||||
(void) fcntl (s, F_SETFL, flags);
|
||||
|
||||
flags = connect (s, (struct sockaddr *) &sa, sizeof (sa));
|
||||
if (flags < 0) {
|
||||
if (errno != EINPROGRESS) {
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger ("Connect Failed %s", strerror(errno));
|
||||
return NS_FAILURE;
|
||||
}
|
||||
}
|
||||
mqp = pck_new_conn (cbarg, PCK_IS_SERVER);
|
||||
mqp->sock = s;
|
||||
/* outgoing connections are always authed */
|
||||
MQP_SET_AUTHED(mqp);
|
||||
mqp->pollopts |= POLLIN;
|
||||
if (mqpconfig.logger)
|
||||
mqpconfig.logger("OutGoing Connection on fd %d", s);
|
||||
return s;
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void print_decode(void *buf, size_t len) {
|
||||
int i;
|
||||
char *buf2 = buf;
|
||||
printf("%d\n", len);
|
||||
for (i=0; i < len; i++) {
|
||||
printf("%x ", buf2[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
|
|
@ -647,9 +647,8 @@ xdr_decode_string (xds_t * xds, void *engine_context, void *buffer, size_t buffe
|
|||
return XDS_ERR_NO_MEM;
|
||||
|
||||
/* Copy data into the buffer. */
|
||||
memmove (*p, (xds_uint8_t *) buffer + 4, p_len);
|
||||
memmove (*p, (xds_uint8_t *) buffer + 4, p_len+1);
|
||||
((xds_uint8_t *) buffer)[4 + p_len] = '\0';
|
||||
|
||||
return XDS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@ encode_mqs_header (xds_t * xds, void *engine_context, void *buffer, size_t buffe
|
|||
{
|
||||
struct mqpacket *mqp;
|
||||
mqp = va_arg (*args, struct mqpacket *);
|
||||
return xds_encode (xds, "uint32 uint32 uint32 uint32", mqp->MID, mqp->MSGTYPE, mqp->VERSION, mqp->flags);
|
||||
printf("encode %d\n", mqp->outmsg.MID);
|
||||
return xds_encode (xds, "int32 int32 int32 int32", mqp->outmsg.MID, mqp->outmsg.MSGTYPE, mqp->outmsg.VERSION, mqp->outmsg.flags);
|
||||
}
|
||||
|
||||
extern int
|
||||
|
@ -19,6 +20,6 @@ decode_mqs_header (xds_t * xds, void *engine_context, void *buffer, size_t buffe
|
|||
struct mqpacket *mqp;
|
||||
int rc;
|
||||
mqp = va_arg (*args, struct mqpacket *);
|
||||
rc = xds_decode (xds, "uint32 uint32 uint32 uint32", &(mqp->MID), &(mqp->MSGTYPE), &(mqp->VERSION), &(mqp->flags));
|
||||
rc = xds_decode (xds, "int32 int32 int32 int32", &(mqp->inmsg.MID), &(mqp->inmsg.MSGTYPE), &(mqp->inmsg.VERSION), &(mqp->inmsg.flags));
|
||||
return rc;
|
||||
}
|
||||
|
|
247
Makefile.in
247
Makefile.in
|
@ -1,8 +1,8 @@
|
|||
# Makefile.in generated by automake 1.7.9 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -13,14 +13,12 @@
|
|||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
|
@ -34,8 +32,45 @@ POST_INSTALL = :
|
|||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
|
||||
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(top_srcdir)/Include/config.h.in \
|
||||
$(top_srcdir)/Include/xds.h.in $(top_srcdir)/configure \
|
||||
$(top_srcdir)/rules.mk config.guess config.sub depcomp \
|
||||
install-sh ltmain.sh missing mkinstalldirs
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/Include/config.h
|
||||
CONFIG_CLEAN_FILES = Include/xds.h
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
pkglibdir = $(prefix)/modules
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
|
@ -106,6 +141,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
|||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
@ -127,6 +164,7 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
|
@ -148,42 +186,42 @@ ACLOCAL_AMFLAGS = -I .
|
|||
LINK = @echo "Linking $@"; $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/Include/config.h
|
||||
CONFIG_CLEAN_FILES = Server/Makefile Include/xds.h
|
||||
DIST_SOURCES =
|
||||
|
||||
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
|
||||
ps-recursive install-info-recursive uninstall-info-recursive \
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure \
|
||||
$(top_srcdir)/rules.mk ./Include/config.h.in Makefile.am \
|
||||
aclocal.m4 config.guess config.sub configure configure.in \
|
||||
depcomp install-sh ltmain.sh missing mkinstalldirs
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/rules.mk $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in ax_maintainer_mode_auto_silent.m4 subdirconfig.m4 xds.m4
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
Include/config.h: Include/stamp-h1
|
||||
|
@ -192,18 +230,16 @@ Include/config.h: Include/stamp-h1
|
|||
$(MAKE) Include/stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
Include/stamp-h1: $(srcdir)/./Include/config.h.in $(top_builddir)/config.status
|
||||
Include/stamp-h1: $(top_srcdir)/Include/config.h.in $(top_builddir)/config.status
|
||||
@rm -f Include/stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status Include/config.h
|
||||
|
||||
$(srcdir)/./Include/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(top_srcdir)/Include/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
touch $(srcdir)/./Include/config.h.in
|
||||
rm -f Include/stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f Include/config.h Include/stamp-h1
|
||||
Server/Makefile: $(top_builddir)/config.status $(top_srcdir)/Server/Makefile.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
Include/xds.h: $(top_builddir)/config.status $(top_srcdir)/Include/xds.h.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
|
@ -276,14 +312,6 @@ ctags-recursive:
|
|||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
|
@ -292,19 +320,22 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
|||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if (etags --etags-include --version) >/dev/null 2>&1; then \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
|
@ -314,10 +345,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
@ -340,24 +372,11 @@ GTAGS:
|
|||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = .
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkinstalldirs) $(distdir)/./Include $(distdir)/Include $(distdir)/Server
|
||||
$(mkdir_p) $(distdir)/Include
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
|
@ -369,7 +388,7 @@ distdir: $(DISTFILES)
|
|||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
|
@ -384,15 +403,17 @@ distdir: $(DISTFILES)
|
|||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" \
|
||||
distdir=../$(distdir)/$$subdir \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
|
@ -403,19 +424,46 @@ distdir: $(DISTFILES)
|
|||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
$(am__remove_distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
|
@ -435,19 +483,20 @@ distcheck: dist
|
|||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
||||
&& rm -f $(distdir).tar.gz \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|
@ -471,7 +520,6 @@ check: check-recursive
|
|||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
|
@ -491,7 +539,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -503,13 +551,15 @@ clean-am: clean-generic clean-libtool mostlyclean-am
|
|||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
@ -546,23 +596,20 @@ uninstall-am: uninstall-info-am
|
|||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
|
||||
clean-generic clean-libtool clean-recursive ctags \
|
||||
ctags-recursive dist dist-all dist-gzip distcheck distclean \
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
|
||||
check-am clean clean-generic clean-libtool clean-recursive \
|
||||
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
|
||||
dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-recursive distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am dvi-recursive info info-am \
|
||||
info-recursive install install-am install-data install-data-am \
|
||||
install-data-recursive install-exec install-exec-am \
|
||||
install-exec-recursive install-info install-info-am \
|
||||
install-info-recursive install-man install-recursive \
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am installdirs-recursive maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
|
||||
pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \
|
||||
tags-recursive uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-info-recursive uninstall-recursive
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
|
||||
tags tags-recursive uninstall uninstall-am uninstall-info-am
|
||||
|
||||
|
||||
.c.o:
|
||||
|
|
|
@ -1,144 +1,503 @@
|
|||
# Makefile for NeoStats
|
||||
CC=@CC@
|
||||
CFLAGS =@CFLAGS@
|
||||
LD=ld
|
||||
RM=/bin/rm -rf
|
||||
LDFLAGS = @LDFLAGS@ @LIBS@
|
||||
MODLDFLAGS = @MODLDFLAGS@
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
SOURCES = $(mqserver_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_MOD = @INSTALL_DATA@
|
||||
NEOINCLUDES = -I. -I../adns -I../libevent -I../Include
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
bin_PROGRAMS = mqserver$(EXEEXT)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/rules.mk
|
||||
subdir = Server
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/Include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_mqserver_OBJECTS = main.$(OBJEXT) serversock.$(OBJEXT) \
|
||||
client.$(OBJEXT) dns.$(OBJEXT) admincli.$(OBJEXT) \
|
||||
libcli.$(OBJEXT) list.$(OBJEXT) hash.$(OBJEXT) conf.$(OBJEXT) \
|
||||
dict.$(OBJEXT) dotconf.$(OBJEXT) log.$(OBJEXT) \
|
||||
mythread.$(OBJEXT)
|
||||
mqserver_OBJECTS = $(am_mqserver_OBJECTS)
|
||||
mqserver_DEPENDENCIES =
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/Include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
SOURCES = $(mqserver_SOURCES)
|
||||
DIST_SOURCES = $(mqserver_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkglibdir = $(prefix)/modules
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MODULES = @MODULES@
|
||||
DIRECTORY = @prefix@
|
||||
MODDIRECTORY = @prefix@/dl
|
||||
DATADIRECTORY = @prefix@/data
|
||||
INCDIRECTORY = @prefix@/include
|
||||
DISTDIR = @PACKAGE@-@VERSION@
|
||||
extauth_src = @EXTAUTH_SRC@
|
||||
extauth_objs = @EXTAUTH_OBJS@
|
||||
LEX = @LEX@
|
||||
LEXLIBS = @LEXLIBS@
|
||||
YACC = @YACC@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = $(prefix)/data
|
||||
exec_prefix = @exec_prefix@
|
||||
have_64_bit_support = @have_64_bit_support@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
xds_int16_t = @xds_int16_t@
|
||||
xds_int32_t = @xds_int32_t@
|
||||
xds_int64_t = @xds_int64_t@
|
||||
xds_int8_t = @xds_int8_t@
|
||||
xds_uint16_t = @xds_uint16_t@
|
||||
xds_uint32_t = @xds_uint32_t@
|
||||
xds_uint64_t = @xds_uint64_t@
|
||||
xds_uint8_t = @xds_uint8_t@
|
||||
mqserver_SOURCES = main.c serversock.c client.c dns.c admincli.c libcli.c list.c hash.c conf.c dict.c dotconf.c log.c mythread.c
|
||||
mqserver_LDADD = -L$(top_srcdir)/Libs/ -lmqpacket -L$(top_srcdir)/libevent/ -levent -L$(top_srcdir)/adns/ -ladns -lpthread -lcrypt
|
||||
AM_CFLAGS = -I$(top_srcdir)/Include -I$(top_srcdir)/adns -I$(top_srcdir)/libevent -DNDEBUG -ggdb
|
||||
LINK = @echo "Linking $@"; $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
all: all-am
|
||||
|
||||
NEOCFLAGS = $(CFLAGS)
|
||||
EXTRA_LDFLAGS = -L../libevent -levent -L../adns -ladns -L../Libs -lmqpacket -lz
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Server/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Server/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
PROGS = mqserver
|
||||
CONF =
|
||||
DOCS =
|
||||
DOCS_PROGS =
|
||||
DATA =
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
OBJS = ${SRCS:.c=.o}
|
||||
SRCS = main.c hash.c list.c log.c dotconf.c sock.c conf.c client.c dict.c dns.c
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
INCLUDES = config.h hash.h list.h mqserver.h log.h dotconf.h dict.h
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
BUILDFILES = configure config.sub config.guess *.in
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
mqserver$(EXEEXT): $(mqserver_OBJECTS) $(mqserver_DEPENDENCIES)
|
||||
@rm -f mqserver$(EXEEXT)
|
||||
$(LINK) $(mqserver_LDFLAGS) $(mqserver_OBJECTS) $(mqserver_LDADD) $(LIBS)
|
||||
|
||||
DISTFILES = $(INCLUDES) $(COREINCS) $(SRCS) $(IRCDSRC) $(IRCDINC) \
|
||||
$(BUILDFILES) $(DATA) $(DOCS) $(DOCS_PROGS) $(CONF)
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
SUBDIRS =
|
||||
DISTLIBS =
|
||||
DISTMOD =
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
all: mqserver testclient
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/admincli.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dns.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dotconf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcli.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mythread.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serversock.Po@am__quote@
|
||||
|
||||
testclient:
|
||||
$(CC) $(LDFLAGS) $(NEOCFLAGS) $(NEOINCLUDES) testclient.c $(EXTRA_LDFLAGS) -o testclient
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
mqserver: $(OBJS)
|
||||
$(CC) $(LDFLAGS) $(OBJS) $(EXTRA_LDFLAGS) -o $@
|
||||
cp -f mqserver ..
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(mkdir_p) $(distdir)/..
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-binPROGRAMS install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
# include dependency info
|
||||
@MAKEDEPENDENCIES@
|
||||
|
||||
.c.o:
|
||||
$(CC) $(NEOCFLAGS) $(NEOINCLUDES) -c $<
|
||||
$(CC) -MM $(NEOINCLUDES) -c $< > $*.d
|
||||
@echo "Building $@"
|
||||
@am__fastdepCC_TRUE@ @if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
|
||||
|
||||
clean:
|
||||
(cd dl; $(MAKE) $@)
|
||||
$(RM) *.o neostats *.cache Makefile config.h *.log *.a *.d *.exe version.h
|
||||
.c.obj:
|
||||
@echo "Building $@"
|
||||
@am__fastdepCC_TRUE@ @if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
|
||||
|
||||
distclean:
|
||||
(cd dl; $(MAKE) $@)
|
||||
$(RM) *.o neostats *.cache Makefile config.h *.log *.a *.d *.exe config.status version.h
|
||||
.c.lo:
|
||||
@echo "Building $@"
|
||||
@am__fastdepCC_TRUE@ @if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
|
||||
|
||||
install: neostats
|
||||
@echo "Installing ..."
|
||||
@$(RM) @prefix@/include/*.h
|
||||
$(INSTALL) -m 755 -d @prefix@
|
||||
$(INSTALL) -m 755 -d @prefix@/dl
|
||||
$(INSTALL) -m 755 -d @prefix@/include
|
||||
$(INSTALL) -m 755 -d @prefix@/doc
|
||||
$(INSTALL) -m 755 -d @prefix@/data
|
||||
$(INSTALL) -m 750 -d @prefix@/logs
|
||||
$(INSTALL) -m 755 $(PROGS) @prefix@
|
||||
$(INSTALL_DATA) $(CONF) @prefix@
|
||||
$(INSTALL_DATA) $(DOCS) @prefix@/doc
|
||||
$(INSTALL) -m 755 $(DOCS_PROGS) @prefix@/doc
|
||||
$(INSTALL_DATA) $(DATA) @prefix@/data
|
||||
$(INSTALL_DATA) $(INCLUDES) @prefix@/include
|
||||
$(INSTALL_DATA) version.h @prefix@/include
|
||||
$(INSTALL_DATA) @IRCD_FILES_INC@ @prefix@/include
|
||||
(cd adns; $(MAKE) $@)
|
||||
(cd sqlsrv; $(MAKE) $@)
|
||||
(cd dl; $(MAKE) $@)
|
||||
(cd tools; $(MAKE) $@)
|
||||
@echo "Done."
|
||||
@cat INSTNOTES
|
||||
@if test -f INSTNOTES.svn ; then cat INSTNOTES.svn ; fi
|
||||
|
||||
dist:
|
||||
@echo -n "Creating Directories"
|
||||
@$(RM) $(DISTDIR)
|
||||
@echo -n "."
|
||||
@mkdir $(DISTDIR)
|
||||
@echo -n "."
|
||||
@mkdir $(DISTDIR)/dl
|
||||
@echo -n "."
|
||||
@for subdir in $(SUBDIRS); do \
|
||||
echo -n "."; \
|
||||
mkdir $(DISTDIR)/$$subdir; \
|
||||
chmod 777 $(DISTDIR)/$$subdir; \
|
||||
install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
|
||||
@list='ls .libs/*.so'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f"; \
|
||||
$(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \
|
||||
else :; fi; \
|
||||
done
|
||||
@echo "Done"
|
||||
@echo -n "Copying Core Distribution files"
|
||||
@for file in $(DISTFILES); do \
|
||||
echo -n "."; \
|
||||
cp -pr $$file $(DISTDIR)/$$file; \
|
||||
done
|
||||
@$(RM) $(DISTDIR)/config.h
|
||||
@$(RM) $(DISTDIR)/configure.in
|
||||
@echo "Done"
|
||||
@echo "Copying Library Distribution files"
|
||||
@for subdir in $(DISTLIBS); do \
|
||||
mkdir $(DISTDIR)/$$subdir; \
|
||||
chmod 777 $(DISTDIR)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) dist DISTDIR=../$(DISTDIR)/$$subdir && cd ..) || exit 1; \
|
||||
done
|
||||
@echo "Done"
|
||||
@echo "Copying Tools Distribution files"
|
||||
@(cd tools && $(MAKE) dist DISTDIR=../$(DISTDIR)/tools && cd ..) || exit 1;
|
||||
@echo "Done"
|
||||
@echo "Copying Module Distribution files"
|
||||
@for mod in $(DISTMOD); do \
|
||||
mkdir $(DISTDIR)/dl/$$mod; \
|
||||
(cd dl/$$mod && $(MAKE) dist DISTDIR=../../$(DISTDIR)/dl/$$mod && cd ../..) || exit 1; \
|
||||
done
|
||||
@echo "Done"
|
||||
@tar -czf $(DISTDIR).tar.gz $(DISTDIR)/*
|
||||
# @$(RM) $(DISTDIR)
|
||||
@echo "Tar file $(DISTDIR).tar.gz created. Freshmeat time!"
|
||||
|
||||
# Catch any changes in compilation options at the top of this file
|
||||
$(OBJS): Makefile
|
||||
mqserver: ../Libs/libmqpacket.a
|
||||
testclient: testclient.c
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
108
Server/client.c
108
Server/client.c
|
@ -35,115 +35,7 @@
|
|||
#include "adns.h"
|
||||
#include "conf.h"
|
||||
#include "log.h"
|
||||
#include "client.h"
|
||||
#include "list.h"
|
||||
#include "dns.h"
|
||||
#include "packet.h"
|
||||
|
||||
list_t *clientlist;
|
||||
|
||||
int init_client_list() {
|
||||
|
||||
clientlist = list_create(-1);
|
||||
if (!clientlist) {
|
||||
nlog(LOG_WARNING, LOG_CORE, "Warning, Client List create Failed");
|
||||
return NS_FAILURE;
|
||||
} else {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mqclient *new_client(int fd) {
|
||||
mqclient *mqc;
|
||||
lnode_t *node;
|
||||
|
||||
if (list_isfull(clientlist)) {
|
||||
nlog(LOG_WARNING, LOG_CORE, "Client List Full. Bye Bye");
|
||||
do_exit(NS_EXIT_ERROR, "Client List Full");
|
||||
}
|
||||
|
||||
mqc = malloc(sizeof(mqclient));
|
||||
bzero(mqc, sizeof(mqclient));
|
||||
mqc->type = MQC_TYPE_NONE;
|
||||
mqc->fd = fd;
|
||||
node = lnode_create(mqc);
|
||||
mqc->node = node;
|
||||
list_append(clientlist, node);
|
||||
nlog(LOG_DEBUG3, LOG_CORE, "New Client on Fd %d", fd);
|
||||
#ifdef DEBUG
|
||||
if (!list_verify(clientlist)) {
|
||||
nlog(LOG_WARNING, LOG_CORE, "Client Verify after insert failed");
|
||||
}
|
||||
#endif
|
||||
return mqc;
|
||||
}
|
||||
|
||||
static int list_find_fd(const void *key1, const void *key2) {
|
||||
const mqclient *mqc1 = key1;
|
||||
return ((int)key2 - mqc1->fd);
|
||||
}
|
||||
|
||||
mqclient *find_client_from_fd(int fd) {
|
||||
lnode_t *node;
|
||||
|
||||
node = list_find(clientlist, (void *)fd, list_find_fd);
|
||||
if (!node) {
|
||||
nlog(LOG_DEBUG1, LOG_CORE, "Can't Find Client for fd %d", fd);
|
||||
return NULL;
|
||||
}
|
||||
return lnode_get(node);
|
||||
}
|
||||
|
||||
void del_client(mqclient *mqc) {
|
||||
nlog(LOG_DEBUG1, LOG_CORE, "Deleting Client %s (%d)", mqc->user, mqc->fd);
|
||||
list_delete(clientlist, mqc->node);
|
||||
lnode_destroy(mqc->node);
|
||||
if (mqc->bufferlen > 0) {
|
||||
free(mqc->buffer);
|
||||
}
|
||||
free(mqc);
|
||||
}
|
||||
|
||||
void got_reverse_lookup_answer(void *data, adns_answer * a) {
|
||||
mqclient *mqc = data;
|
||||
int len, ri;
|
||||
char *show;
|
||||
if (a) {
|
||||
adns_rr_info(a->type, 0, 0, &len, 0, 0);
|
||||
if (a->nrrs > 0) {
|
||||
ri = adns_rr_info(a->type, 0, 0, 0, a->rrs.bytes, &show);
|
||||
if (!ri) {
|
||||
nlog(LOG_DEBUG2, LOG_CORE, "DNS for Host %s resolves to %s", mqc->host, show);
|
||||
strncpy(mqc->host, show, MAXHOST);
|
||||
} else {
|
||||
nlog(LOG_WARNING, LOG_CORE, "Dns Error: %s", adns_strerror(ri));
|
||||
}
|
||||
free(show);
|
||||
} else {
|
||||
nlog(LOG_DEBUG2, LOG_CORE, "DNS for IP %s Does not resolve", mqc->host);
|
||||
}
|
||||
}
|
||||
MQC_CLEAR_STAT_DNSLOOKUP(mqc);
|
||||
/* XXX check bans? */
|
||||
|
||||
|
||||
/* ok, create a new client */
|
||||
if (MQC_IS_TYPE_CLIENT(mqc))
|
||||
mqc->pck = pck_new_conn((void *)mqc, PCK_IS_CLIENT);
|
||||
|
||||
/* if there is data in the buffer, see if we can parse it already */
|
||||
while (mqc->offset >= PCK_MIN_PACK_SIZE) {
|
||||
len = pck_parse_packet(mqc->pck, mqc->buffer, mqc->offset);
|
||||
buffer_del(mqc, len);
|
||||
printf("dns processed %d bytes, %d left\n", len, mqc->offset);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void do_reverse_lookup(mqclient *mqc) {
|
||||
/* at this stage, what ever is in host, will be a plain ip address */
|
||||
dns_lookup(mqc->host, adns_r_ptr, got_reverse_lookup_answer, (void *)mqc);
|
||||
MQC_SET_STAT_DNSLOOKUP(mqc);
|
||||
}
|
||||
|
||||
|
|
53
Server/dns.c
53
Server/dns.c
|
@ -36,6 +36,7 @@
|
|||
#include "log.h"
|
||||
#include "adns.h"
|
||||
#include "dns.h"
|
||||
#include "serversock.h"
|
||||
|
||||
adns_state ads;
|
||||
|
||||
|
@ -79,6 +80,15 @@ list_t *dnsqueue;
|
|||
|
||||
void dns_check_queue();
|
||||
|
||||
|
||||
void setup_dns_socks() {
|
||||
/* acutally it would be better to use the select/poll interface, but this makes it easy */
|
||||
adns_processany(ads);
|
||||
do_dns();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** @brief starts a DNS lookup
|
||||
*
|
||||
* starts a DNS lookup for str of type type can callback the function
|
||||
|
@ -384,3 +394,46 @@ void do_dns_stats_Z() {
|
|||
numeric (RPL_MEMSTATS, u->nick, "Un-Successfull Lookups: %d", DNSStats.failure);
|
||||
#endif
|
||||
}
|
||||
|
||||
void got_reverse_lookup_answer(void *data, adns_answer * a) {
|
||||
mqsock *mqs = data;
|
||||
int len, ri;
|
||||
char *show;
|
||||
if (a) {
|
||||
adns_rr_info(a->type, 0, 0, &len, 0, 0);
|
||||
if (a->nrrs > 0) {
|
||||
ri = adns_rr_info(a->type, 0, 0, 0, a->rrs.bytes, &show);
|
||||
if (!ri) {
|
||||
nlog(LOG_DEBUG2, LOG_CORE, "DNS for Host %s resolves to %s", mqs->host, show);
|
||||
strncpy(mqs->host, show, MAXHOST);
|
||||
} else {
|
||||
nlog(LOG_WARNING, LOG_CORE, "Dns Error: %s", adns_strerror(ri));
|
||||
}
|
||||
free(show);
|
||||
} else {
|
||||
nlog(LOG_DEBUG2, LOG_CORE, "DNS for IP %s Does not resolve", mqs->host);
|
||||
}
|
||||
}
|
||||
MQC_CLEAR_STAT_DNSLOOKUP(mqs);
|
||||
/* XXX check bans? */
|
||||
|
||||
|
||||
#if 0
|
||||
/* ok, create a new client */
|
||||
if (MQC_IS_TYPE_CLIENT(mqc))
|
||||
mqc->pck = pck_new_conn((void *)mqc, PCK_IS_CLIENT);
|
||||
|
||||
/* if there is data in the buffer, see if we can parse it already */
|
||||
while (mqc->offset >= PCK_MIN_PACK_SIZE) {
|
||||
len = pck_parse_packet(mqc->pck, mqc->buffer, mqc->offset);
|
||||
buffer_del(mqc, len);
|
||||
printf("dns processed %d bytes, %d left\n", len, mqc->offset);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void do_reverse_lookup(mqsock *mqs) {
|
||||
/* at this stage, what ever is in host, will be a plain ip address */
|
||||
dns_lookup(mqs->host, adns_r_ptr, got_reverse_lookup_answer, (void *)mqs);
|
||||
MQC_SET_STAT_DNSLOOKUP(mqs);
|
||||
}
|
||||
|
|
24
Server/log.c
24
Server/log.c
|
@ -23,12 +23,15 @@
|
|||
** $Id$
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "defines.h"
|
||||
#include "conf.h"
|
||||
#include "hash.h"
|
||||
#include "log.h"
|
||||
#include "dotconf.h"
|
||||
#include "mythread.h"
|
||||
#ifdef HAVE_BACKTRACE
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
@ -36,6 +39,9 @@
|
|||
const char* CoreLogFileName="MQServer";
|
||||
char LogFileNameFormat[MAX_LOGFILENAME]="-%m-%d";
|
||||
|
||||
|
||||
mylocks logmutex;
|
||||
|
||||
const char *loglevels[10] = {
|
||||
"CRITICAL",
|
||||
"ERROR",
|
||||
|
@ -67,12 +73,18 @@ int
|
|||
init_logs ()
|
||||
{
|
||||
SET_SEGV_LOCATION();
|
||||
|
||||
MYLOCK_INIT(logmutex);
|
||||
MYLOCK(&logmutex);
|
||||
|
||||
logs = hash_create (-1, 0, 0);
|
||||
if (!logs) {
|
||||
printf ("ERROR: Can't initialize log subsystem. Exiting!");
|
||||
MYUNLOCK(&logmutex);
|
||||
return NS_FAILURE;
|
||||
}
|
||||
printf("Logging Subsystem Started\n");
|
||||
MYUNLOCK(&logmutex);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -86,6 +98,8 @@ close_logs ()
|
|||
struct logs_ *logentry;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
|
||||
MYLOCK(&logmutex);
|
||||
hash_scan_begin (&hs, logs);
|
||||
while ((hn = hash_scan_next (&hs)) != NULL) {
|
||||
logentry = hnode_get (hn);
|
||||
|
@ -103,6 +117,7 @@ close_logs ()
|
|||
hnode_destroy (hn);
|
||||
free (logentry);
|
||||
}
|
||||
MYUNLOCK(&logmutex);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -112,6 +127,8 @@ fini_logs() {
|
|||
struct logs_ *logentry;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
|
||||
MYLOCK(&logmutex);
|
||||
hash_scan_begin (&hs, logs);
|
||||
while ((hn = hash_scan_next (&hs)) != NULL) {
|
||||
logentry = hnode_get (hn);
|
||||
|
@ -131,6 +148,7 @@ fini_logs() {
|
|||
}
|
||||
/* for some reason, the logs are not getting flushed correctly */
|
||||
hash_destroy(logs);
|
||||
MYUNLOCK(&logmutex);
|
||||
}
|
||||
|
||||
void make_log_filename(char* modname, char *logname)
|
||||
|
@ -150,6 +168,8 @@ nlog (int level, int scope, char *fmt, ...)
|
|||
hnode_t *hn;
|
||||
struct logs_ *logentry;
|
||||
|
||||
MYLOCK(&logmutex);
|
||||
|
||||
if (level <= config.debug) {
|
||||
/* if scope is > 0, then log to a diff file */
|
||||
if (scope > 0) {
|
||||
|
@ -191,6 +211,7 @@ nlog (int level, int scope, char *fmt, ...)
|
|||
#ifdef DEBUG
|
||||
if (!logentry->logfile) {
|
||||
printf ("LOG ERROR: %s\n", strerror (errno));
|
||||
MYUNLOCK(&logmutex);
|
||||
do_exit (NS_EXIT_NORMAL, NULL);
|
||||
}
|
||||
#endif
|
||||
|
@ -209,6 +230,7 @@ nlog (int level, int scope, char *fmt, ...)
|
|||
#endif
|
||||
printf ("%s %s - %s\n", loglevels[level - 1], scope > 0 ? segv_inmodule : "CORE", log_buf);
|
||||
}
|
||||
MYUNLOCK(&logmutex);
|
||||
}
|
||||
|
||||
/** rotate logs, called at midnight
|
||||
|
@ -221,6 +243,7 @@ reset_logs ()
|
|||
struct logs_ *logentry;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
MYLOCK(&logmutex);
|
||||
hash_scan_begin (&hs, logs);
|
||||
while ((hn = hash_scan_next (&hs)) != NULL) {
|
||||
logentry = hnode_get (hn);
|
||||
|
@ -239,6 +262,7 @@ reset_logs ()
|
|||
/* make new file name but do not open until needed to avoid 0 length files*/
|
||||
make_log_filename(logentry->name, logentry->logname);
|
||||
}
|
||||
MYUNLOCK(&logmutex);
|
||||
}
|
||||
|
||||
/* this is for printing out details during an assertion failure */
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
#include "dotconf.h"
|
||||
#include "dns.h"
|
||||
#include "packet.h"
|
||||
#include "serversock.h"
|
||||
#include "mythread.h"
|
||||
|
||||
|
||||
/*! Date when we were compiled */
|
||||
const char version_date[] = __DATE__;
|
||||
|
@ -86,6 +89,10 @@ main (int argc, char *argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
#endif
|
||||
/* start up the thread engine */
|
||||
init_threadengine();
|
||||
|
||||
|
||||
/* before we do anything, make sure logging is setup */
|
||||
if(init_logs () != NS_SUCCESS)
|
||||
return EXIT_FAILURE;
|
||||
|
@ -118,11 +125,8 @@ main (int argc, char *argv[])
|
|||
/* prepare to catch errors */
|
||||
setup_signals ();
|
||||
|
||||
/* init libevent */
|
||||
event_init();
|
||||
|
||||
|
||||
pck_init();
|
||||
pck_set_logger(pck_logger);
|
||||
/* load the config files */
|
||||
if(ConfLoad () != NS_SUCCESS)
|
||||
return EXIT_FAILURE;
|
||||
|
@ -139,11 +143,7 @@ main (int argc, char *argv[])
|
|||
return EXIT_FAILURE;
|
||||
|
||||
|
||||
if (init_client_list() != NS_SUCCESS)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
|
||||
#ifndef DEBUG
|
||||
#if 0
|
||||
/* if we are compiled with debug, or forground switch was specified, DONT FORK */
|
||||
if (!config.foreground) {
|
||||
/* fix the double log message problem by closing logs prior to fork() */
|
||||
|
@ -168,7 +168,7 @@ main (int argc, char *argv[])
|
|||
}
|
||||
return EXIT_SUCCESS; /* parent exits */
|
||||
}
|
||||
#ifndef DEBUG
|
||||
#if 0
|
||||
/* child (daemon) continues */
|
||||
/* reopen logs for child */
|
||||
if(init_logs () != NS_SUCCESS)
|
||||
|
@ -181,7 +181,10 @@ main (int argc, char *argv[])
|
|||
#endif
|
||||
nlog (LOG_NOTICE, LOG_CORE, "MQServer started (Version %s).", me.versionfull);
|
||||
/* we are ready to start now Duh! */
|
||||
start ();
|
||||
|
||||
/* XXX init server socket thread */
|
||||
MQS_sock_start();
|
||||
|
||||
|
||||
/* We should never reach here but the compiler does not realise and may
|
||||
complain about not all paths control returning values without the return
|
||||
|
@ -471,11 +474,3 @@ void fatal_error(char* file, int line, char* func, char* error_text)
|
|||
do_exit (NS_EXIT_ERROR, "Fatal Error - check log file");
|
||||
}
|
||||
|
||||
void pck_logger(char *fmt,...) {
|
||||
va_list ap;
|
||||
char log_buf[BUFSIZE];
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(log_buf, BUFSIZE, fmt, ap);
|
||||
va_end(ap);
|
||||
nlog(LOG_DEBUG2, LOG_CORE, "%s", log_buf);
|
||||
}
|
2400
aclocal.m4
vendored
2400
aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
|
@ -3,7 +3,7 @@ dnl NEO_SUBDIR_CONFIG(dir [, sub-package-cmdline-args])
|
|||
dnl
|
||||
dnl Note that this code is a direct copy of that which is found in
|
||||
dnl the apr project's build/apr_common.m4.
|
||||
AC_DEFUN(NEO_SUBDIR_CONFIG, [
|
||||
AC_DEFUN([NEO_SUBDIR_CONFIG], [
|
||||
# save our work to this point; this allows the sub-package to use it
|
||||
AC_CACHE_SAVE
|
||||
|
||||
|
|
2
xds.m4
2
xds.m4
|
@ -28,7 +28,7 @@ dnl ##
|
|||
dnl ## xds.m4: XDS-specific autoconf macros
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN(AC_XDS,[
|
||||
AC_DEFUN([AC_XDS],[
|
||||
dnl Check for exact data types.
|
||||
dnl
|
||||
AC_CHECK_TYPE(u_int8_t, [xds_uint8_t=u_int8_t],
|
||||
|
|
Reference in a new issue