Browse Source

now this seem to build.

master
root 14 years ago
committed by Georg Hopp
parent
commit
7971fc1555
  1. 7
      Makefile.am
  2. 32
      configure.ac
  3. 18
      mod_entropy.c

7
Makefile.am

@ -2,13 +2,12 @@ ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libmodentropy.la
libmodentropy_la_SOURCES = mod_entropy.c mod_entropy_get_entropy_bits.c \
mod_entropy_add_entropy.c
libmodentropy_la_SOURCES = mod_entropy.c
libmodentropy_la_LDFLAGS = -lrt -lm
install: libmodentropy.la
apxs -i -a -n entropy libmodentropy.la
@APXS@ -i -a -n entropy libmodentropy.la
## Define that an include directory is required.
#INCLUDES = -I@apache_dir@/include -I/usr/include/apr-1
INCLUDES = -I@AP_INCLUDE@ -I@APR_INCLUDE@

32
configure.ac

@ -1,6 +1,7 @@
AC_PREREQ([2.68])
AC_INIT([mod_entropy], [0.1.0], [Georg Hopp <georg@steffers.org])
LT_INIT
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([mod_entropy.c])
@ -9,7 +10,7 @@ AC_CONFIG_MACRO_DIR([m4])
#AM_SILENT_RULES([yes])
AC_COPYRIGHT([Copyright © 2012 Georg Hopp])
AC_REVISION([$Revision: 0.02 $])
AC_REVISION([$Revision: 0.01 $])
# Checks for programs.
AC_PROG_CC
@ -20,25 +21,32 @@ AC_CHECK_LIB([m], [log])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_LIB([aprutil], [apr_palloc])
# apache apxs linking
# apache apxs
AC_SUBST(APXS)
AC_CHECK_PROGS(APXS, apxs)
if test -z "$APXS"; then
AC_MSG_WARN([[apxs missing]])
AC_MSG_ERROR([[apxs missing]])
fi
AC_SUBST(MODULEDIR)
AC_MSG_CHECKING(apache module directory)
if test -x "$APXS"; then
MODULEDIR=`${APXS} -q LIBEXECDIR`
else
MODULEDIR=/usr/local/lib
fi
AC_MSG_RESULT($MODULEDIR)
# apache include dir
AC_SUBST(AP_INCLUDE)
AC_MSG_CHECKING(apache include directory)
AP_INCLUDE=$(${APXS} -q INCLUDEDIR)
AC_MSG_RESULT($AP_INCLUDE)
# apr-1
AC_SUBST(APR1)
AC_CHECK_PROGS(APR1, apr-1-config)
# apr-1 include dir
AC_SUBST(APR_INCLUDE)
AC_MSG_CHECKING(apr-1 include directory)
APR_INCLUDE=$(${APR1} --includedir)
AC_MSG_RESULT($APR_INCLUDE)
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h sys/ioctl.h])
AC_CHECK_HEADERS([fcntl.h sys/ioctl.h linux/random.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

18
mod_entropy.c

@ -13,11 +13,15 @@
*/
#define _POSIX_C_SOURCE 199309L
#include <apache2/httpd.h>
#include <apache2/http_core.h>
#include <apr-1/apu.h>
#include <apr-1/apr_general.h>
#include <apr-1/apr_sha1.h>
#include "httpd.h"
#include "http_core.h"
#include "http_connection.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "apu.h"
#include "apr_general.h"
#include "apr_sha1.h"
#include <time.h>
#include <math.h>
@ -127,8 +131,8 @@ entropy_filter_in(
*/
apr_sha1_update(
&sha1_ctx,
connection->client_ip,
strlen(connection->client_ip));
connection->remote_ip,
strlen(connection->remote_ip));
/**
* add request line to sha1

Loading…
Cancel
Save