Autoconfiscate, thanks to gilles-chanteperdrix (https://github.com/gilles-chanteperdrix/uvrrpd/commit/ae45e71)
This commit is contained in:
parent
4737ff78cc
commit
095796a318
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -3,3 +3,8 @@
|
||||||
*.swp
|
*.swp
|
||||||
uvrrpd
|
uvrrpd
|
||||||
deploy.sh
|
deploy.sh
|
||||||
|
Makefile.in
|
||||||
|
aclocal.m4
|
||||||
|
config/
|
||||||
|
configure
|
||||||
|
autom4te.cache/
|
||||||
|
|
49
Makefile
49
Makefile
|
@ -1,49 +0,0 @@
|
||||||
### Makefile
|
|
||||||
## simple makefile for dev purpose
|
|
||||||
|
|
||||||
|
|
||||||
TIME := $(shell date '+%D_%H:%M'| sed 's/\//\\\//g')
|
|
||||||
|
|
||||||
CC := gcc
|
|
||||||
|
|
||||||
CFLAGS += -std=gnu99 -D_GNU_SOURCE\
|
|
||||||
-Wall -Wextra -Werror -Wbad-function-cast -Wshadow \
|
|
||||||
-Wcast-qual -Wold-style-definition -Wmissing-noreturn \
|
|
||||||
-Wstrict-prototypes -Waggregate-return -Wformat=2 \
|
|
||||||
-Wundef -Wbad-function-cast -Wunused-parameter -Wnonnull
|
|
||||||
LDFLAGS += -lrt -Wall
|
|
||||||
|
|
||||||
CFLAGS += -DPATH=\"$(shell pwd)\"
|
|
||||||
|
|
||||||
ifdef DEBUG
|
|
||||||
CFLAGS += -g -ggdb -DDEBUG
|
|
||||||
LDFLAGS +=
|
|
||||||
else
|
|
||||||
CFLAGS += #-Os -fomit-frame-pointer -DNDEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
# select C-files
|
|
||||||
sources := $(wildcard *.c)
|
|
||||||
headers := $(wildcard *.h)
|
|
||||||
|
|
||||||
# Get objects from C-files
|
|
||||||
objects := $(sources:.c=.o)
|
|
||||||
|
|
||||||
uvrrpd: $(objects)
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
all: uvrrpd
|
|
||||||
|
|
||||||
|
|
||||||
INDENT_ARGS := -kr -i8 -c8 -nprs -nce -l80 -cp1
|
|
||||||
.PHONY: indent
|
|
||||||
indent:
|
|
||||||
@echo "indent $(INDENT_ARGS)"
|
|
||||||
@indent $(INDENT_ARGS) $(sources) > /dev/null
|
|
||||||
@indent $(INDENT_ARGS) $(headers) > /dev/null
|
|
||||||
@find -name "*~" -delete
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
find -name "*.o" -delete
|
|
||||||
@rm -f uvrrpd
|
|
43
Makefile.am
Normal file
43
Makefile.am
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
ACLOCAL_AMFLAGS = -I config
|
||||||
|
|
||||||
|
sbin_SCRIPTS = vrrp_switch.sh
|
||||||
|
EXTRA_DIST = vrrp_switch.sh
|
||||||
|
|
||||||
|
AM_CPPFLAGS = $(DEBUG_OPTS) -DPATH="$(sbindir)"
|
||||||
|
|
||||||
|
AM_CFLAGS = -Wall -W -Werror
|
||||||
|
|
||||||
|
sbin_PROGRAMS = uvrrpd
|
||||||
|
|
||||||
|
noinst_HEADERS = \
|
||||||
|
bits.h \
|
||||||
|
common.h \
|
||||||
|
list.h \
|
||||||
|
log.h \
|
||||||
|
uvrrpd.h \
|
||||||
|
vrrp_adv.h \
|
||||||
|
vrrp_arp.h \
|
||||||
|
vrrp_exec.h \
|
||||||
|
vrrp.h \
|
||||||
|
vrrp_ipx.h \
|
||||||
|
vrrp_na.h \
|
||||||
|
vrrp_net.h \
|
||||||
|
vrrp_options.h \
|
||||||
|
vrrp_rfc.h \
|
||||||
|
vrrp_state.h \
|
||||||
|
vrrp_timer.h
|
||||||
|
|
||||||
|
uvrrpd_SOURCES = \
|
||||||
|
log.c \
|
||||||
|
uvrrpd.c \
|
||||||
|
vrrp_adv.c \
|
||||||
|
vrrp_arp.c \
|
||||||
|
vrrp.c \
|
||||||
|
vrrp_exec.c \
|
||||||
|
vrrp_ip4.c \
|
||||||
|
vrrp_ip6.c \
|
||||||
|
vrrp_na.c \
|
||||||
|
vrrp_net.c \
|
||||||
|
vrrp_options.c \
|
||||||
|
vrrp_state.c \
|
||||||
|
vrrp_timer.c
|
6
common.h
6
common.h
|
@ -54,6 +54,12 @@ typedef enum {
|
||||||
( memcmp ( s, c_str, sizeof( c_str ) ) == 0 ); \
|
( memcmp ( s, c_str, sizeof( c_str ) ) == 0 ); \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stringify(x)
|
||||||
|
*/
|
||||||
|
#define _stringify(x) #x
|
||||||
|
#define stringify(x) _stringify(x)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ARRAY_SIZE()
|
* ARRAY_SIZE()
|
||||||
*/
|
*/
|
||||||
|
|
37
configure.ac
Normal file
37
configure.ac
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
AC_PREREQ(2.50)
|
||||||
|
AC_INIT(uvrrpd, 0.1, arno@ankhoon.net)
|
||||||
|
AC_CONFIG_AUX_DIR([config])
|
||||||
|
AC_CONFIG_MACRO_DIR([config])
|
||||||
|
AM_INIT_AUTOMAKE([foreign dist-xz tar-ustar])
|
||||||
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||||
|
AC_CONFIG_SRCDIR(uvrrpd.c)
|
||||||
|
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_CC_STDC dnl for -std=gnu99
|
||||||
|
AC_USE_SYSTEM_EXTENSIONS dnl for -D_GNU_SOURCE
|
||||||
|
AC_PROG_LIBTOOL
|
||||||
|
AC_SEARCH_LIBS([clock_gettime],[rt posix4])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for debug options)
|
||||||
|
|
||||||
|
DEBUG_OPTS=""
|
||||||
|
AC_ARG_ENABLE(debug-logs,
|
||||||
|
AS_HELP_STRING([--enable-debug-logs],[Enable debug logs]),
|
||||||
|
[case "$enableval" in
|
||||||
|
y | yes) DEBUG_OPTS="-DDEBUG";;
|
||||||
|
esac])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(asserts,
|
||||||
|
AS_HELP_STRING([--disable-asserts],[Disable run-time assertions]),
|
||||||
|
[case "$enableval" in
|
||||||
|
n | no) DEBUG_OPTS="$DEBUG_OPTS -DNDEBUG";;
|
||||||
|
esac])
|
||||||
|
|
||||||
|
AC_MSG_RESULT(${DEBUG_OPTS:-none})
|
||||||
|
AC_SUBST(DEBUG_OPTS)
|
||||||
|
|
||||||
|
AC_CONFIG_FILES([
|
||||||
|
Makefile
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_OUTPUT()
|
2
vrrp.h
2
vrrp.h
|
@ -41,7 +41,7 @@
|
||||||
#define PRIO_DFL 100
|
#define PRIO_DFL 100
|
||||||
|
|
||||||
/* External script */
|
/* External script */
|
||||||
#define VRRP_SCRIPT PATH "/vrrp_switch.sh"
|
#define VRRP_SCRIPT stringify(PATH) "/vrrp_switch.sh"
|
||||||
#define VRRP_SCRIPT_MAX sysconf(_SC_ARG_MAX)
|
#define VRRP_SCRIPT_MAX sysconf(_SC_ARG_MAX)
|
||||||
|
|
||||||
/* preemption */
|
/* preemption */
|
||||||
|
|
Loading…
Reference in a new issue