Commit 01fbdaca authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Complete namespace cleanup.

Add stuff to libvarnishapi to make it self-sufficient.

Remove libvarnish from tools' Makefiles, they should not link
against it, to ensure that libvarnishapi is enough for such tasks.

Where we need special stuff from libvarnish, like VPF, pull
it into tools' Makefile directly.
parent ab0b3e26
......@@ -12,7 +12,6 @@ varnishadm_SOURCES = \
varnishadm_CFLAGS = @LIBEDIT_CFLAGS@
varnishadm_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
${PTHREAD_LIBS} ${NET_LIBS} @LIBEDIT_LIBS@
......
......@@ -110,7 +110,7 @@ cli_sock(const char *T_arg, const char *S_arg)
AZ(close(sock));
return (-1);
}
VCLI_response(fd, answer, buf);
VCLI_AuthResponse(fd, answer, buf);
AZ(close(fd));
free(answer);
......
......@@ -292,7 +292,7 @@ mcf_auth(struct cli *cli, const char *const *av, void *priv)
return;
}
mgt_got_fd(fd);
VCLI_response(fd, cli->challenge, buf);
VCLI_AuthResponse(fd, cli->challenge, buf);
AZ(close(fd));
if (strcasecmp(buf, av[2])) {
mgt_cli_challenge(cli);
......
......@@ -6,10 +6,12 @@ bin_PROGRAMS = varnishlog
dist_man_MANS = varnishlog.1
varnishlog_SOURCES = varnishlog.c
varnishlog_SOURCES = \
varnishlog.c \
$(top_builddir)/lib/libvarnish/flopen.c \
$(top_builddir)/lib/libvarnish/vpf.c
varnishlog_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${PTHREAD_LIBS}
......
......@@ -6,10 +6,12 @@ bin_PROGRAMS = varnishncsa
dist_man_MANS = varnishncsa.1
varnishncsa_SOURCES = varnishncsa.c
varnishncsa_SOURCES = \
varnishncsa.c \
$(top_builddir)/lib/libvarnish/flopen.c \
$(top_builddir)/lib/libvarnish/vpf.c
varnishncsa_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${PTHREAD_LIBS}
......
......@@ -10,7 +10,6 @@ varnishreplay_SOURCES = \
varnishreplay.c
varnishreplay_LDADD = \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${PTHREAD_LIBS} ${NET_LIBS}
......
......@@ -341,7 +341,7 @@ varnish_launch(struct varnish *v)
assert(sizeof abuf >= CLI_AUTH_RESPONSE_LEN + 6);
strcpy(abuf, "auth ");
VCLI_response(nfd, r, abuf + 5);
VCLI_AuthResponse(nfd, r, abuf + 5);
AZ(close(nfd));
free(r);
strcat(abuf, "\n");
......
......@@ -49,5 +49,5 @@ int VCLI_ReadResult(int fd, unsigned *status, char **ptr, double tmo);
#define CLI_AUTH_RESPONSE_LEN 65 /* 64 hex + NUL */
void VCLI_response(int S_fd, const char *challenge,
void VCLI_AuthResponse(int S_fd, const char *challenge,
char reponse[CLI_AUTH_RESPONSE_LEN]);
......@@ -188,9 +188,9 @@ struct VSC_point {
const volatile void *ptr; /* field value */
};
typedef int vsc_iter_f(void *priv, const struct VSC_point *const pt);
typedef int VSC_iter_f(void *priv, const struct VSC_point *const pt);
int VSC_Iter(struct VSM_data *vd, vsc_iter_f *func, void *priv);
int VSC_Iter(struct VSM_data *vd, VSC_iter_f *func, void *priv);
/*
* Iterate over all statistics counters, calling "func" for
* each counter not suppressed by any "-f" arguments.
......
......@@ -39,7 +39,7 @@
void
VCLI_response(int S_fd, const char *challenge,
VCLI_AuthResponse(int S_fd, const char *challenge,
char response[CLI_AUTH_RESPONSE_LEN])
{
SHA256_CTX ctx;
......
......@@ -14,9 +14,15 @@ libvarnishapi_la_SOURCES = \
../libvarnish/argv.c \
../libvarnish/vcs_version.c \
../libvarnish/version.c \
../libvarnish/cli_common.c \
../libvarnish/cli_auth.c \
../libvarnish/tcp.c \
../libvarnish/vin.c \
../libvarnish/vmb.c \
../libvarnish/vre.c \
../libvarnish/vsb.c \
../libvarnish/vsha256.c \
../libvarnish/vss.c \
base64.c \
vsm.c \
vsl_arg.c \
......@@ -26,4 +32,4 @@ libvarnishapi_la_SOURCES = \
libvarnishapi_la_CFLAGS = \
-DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
libvarnishapi_la_LIBADD = @PCRE_LIBS@
libvarnishapi_la_LIBADD = @PCRE_LIBS@ ${LIBM}
......@@ -250,7 +250,7 @@ iter_test(const char *s1, const char *s2, int wc)
}
static int
iter_call(const struct vsc *vsc, vsc_iter_f *func, void *priv,
iter_call(const struct vsc *vsc, VSC_iter_f *func, void *priv,
const struct VSC_point *const sp)
{
struct vsc_sf *sf;
......@@ -283,7 +283,7 @@ iter_call(const struct vsc *vsc, vsc_iter_f *func, void *priv,
#define VSC_DO(U,l,t) \
static int \
iter_##l(const struct vsc *vsc, struct VSM_chunk *sha, \
vsc_iter_f *func, void *priv) \
VSC_iter_f *func, void *priv) \
{ \
struct VSC_C_##l *st; \
struct VSC_point sp; \
......@@ -315,7 +315,7 @@ iter_call(const struct vsc *vsc, vsc_iter_f *func, void *priv,
#undef VSC_DONE
int
VSC_Iter(struct VSM_data *vd, vsc_iter_f *func, void *priv)
VSC_Iter(struct VSM_data *vd, VSC_iter_f *func, void *priv)
{
struct vsc *vsc;
struct VSM_chunk *sha;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment