mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-13 15:47:15 +03:00
Add PCRE support for musl
This commit is contained in:
commit
e5cb33fcb7
8
Makefile
8
Makefile
@ -1,8 +1,9 @@
|
||||
# Configuration
|
||||
|
||||
VERSION=$(shell ./genver.sh -r)
|
||||
ENABLE_REGEX=1 # Enable regex probes
|
||||
USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
|
||||
USELIBPCRE=1 # Use libpcre? (necessary to use regex probe)
|
||||
USELIBPCRE=1 # Use libpcre? (needed for regex on musl)
|
||||
USELIBWRAP?= # Use libwrap?
|
||||
USELIBCAP= # Use libcap?
|
||||
COV_TEST= # Perform test coverage?
|
||||
@ -30,8 +31,13 @@ ifneq ($(strip $(USELIBWRAP)),)
|
||||
CPPFLAGS+=-DLIBWRAP
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(ENABLE_REGEX)),)
|
||||
CPPFLAGS+=-DENABLE_REGEX
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(USELIBPCRE)),)
|
||||
CPPFLAGS+=-DLIBPCRE
|
||||
LIBS:=$(LIBS) -lpcre
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(USELIBCONFIG)),)
|
||||
|
6
probe.c
6
probe.c
@ -21,9 +21,13 @@
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#ifdef ENABLE_REGEX
|
||||
#ifdef LIBPCRE
|
||||
#include <pcreposix.h>
|
||||
#else
|
||||
#include <regex.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include "probe.h"
|
||||
|
||||
@ -260,7 +264,7 @@ static int is_adb_protocol(const char *p, int len, struct proto *proto)
|
||||
|
||||
static int regex_probe(const char *p, int len, struct proto *proto)
|
||||
{
|
||||
#ifdef LIBPCRE
|
||||
#ifdef ENABLE_REGEX
|
||||
regex_t **probe = proto->data;
|
||||
regmatch_t pos = { 0, len };
|
||||
|
||||
|
@ -25,9 +25,13 @@
|
||||
#ifdef LIBCONFIG
|
||||
#include <libconfig.h>
|
||||
#endif
|
||||
#ifdef ENABLE_REGEX
|
||||
#ifdef LIBPCRE
|
||||
#include <pcreposix.h>
|
||||
#else
|
||||
#include <regex.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "probe.h"
|
||||
@ -177,7 +181,7 @@ static int config_listen(config_t *config, struct addrinfo **listen)
|
||||
#ifdef LIBCONFIG
|
||||
static void setup_regex_probe(struct proto *p, config_setting_t* probes)
|
||||
{
|
||||
#ifdef LIBPCRE
|
||||
#ifdef ENABLE_REGEX
|
||||
int num_probes, errsize, i, res;
|
||||
char *err;
|
||||
const char * expr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user