Commit ab3324be477b2663196e0cc73d96aa38d59da65a
Enable PCRE as RegEx Library
John Regan committed on 8/13/2015, 6:28:17 PMParent: 4cbaf447b5a634f703bc571bf0e12f3ae1514d8a
Files changed
Makefile | changed |
probe.c | changed |
sslh-main.c | changed |
Makefile | ||
---|---|---|
@@ -1,9 +1,10 @@ | ||
1 | 1 | # Configuration |
2 | 2 | |
3 | 3 | VERSION=$(shell ./genver.sh -r) |
4 | +ENABLE_REGEX=1 # Enable regex probes | |
4 | 5 | USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files) |
5 | -USELIBPCRE=1 # Use libpcre? (necessary to use regex probe) | |
6 | +USELIBPCRE=1 # Use libpcre? (needed for regex on musl) | |
6 | 7 | USELIBWRAP?= # Use libwrap? |
7 | 8 | USELIBCAP= # Use libcap? |
8 | 9 | COV_TEST= # Perform test coverage? |
9 | 10 | PREFIX?=/usr |
@@ -29,10 +30,15 @@ | ||
29 | 30 | LIBS:=$(LIBS) -lwrap |
30 | 31 | CPPFLAGS+=-DLIBWRAP |
31 | 32 | endif |
32 | 33 | |
34 | +ifneq ($(strip $(ENABLE_REGEX)),) | |
35 | + CPPFLAGS+=-DENABLE_REGEX | |
36 | +endif | |
37 | + | |
33 | 38 | ifneq ($(strip $(USELIBPCRE)),) |
34 | 39 | CPPFLAGS+=-DLIBPCRE |
40 | + LIBS:=$(LIBS) -lpcre | |
35 | 41 | endif |
36 | 42 | |
37 | 43 | ifneq ($(strip $(USELIBCONFIG)),) |
38 | 44 | LIBS:=$(LIBS) -lconfig |
probe.c | ||
---|---|---|
@@ -20,11 +20,15 @@ | ||
20 | 20 | */ |
21 | 21 | |
22 | 22 | |
23 | 23 | |
24 | + | |
24 | 25 | |
26 | + | |
27 | + | |
25 | 28 | |
26 | 29 | |
30 | + | |
27 | 31 | |
28 | 32 | |
29 | 33 | |
30 | 34 | |
@@ -274,9 +278,9 @@ | ||
274 | 278 | } |
275 | 279 | |
276 | 280 | static int regex_probe(const char *p, int len, struct proto *proto) |
277 | 281 | { |
278 | - | |
282 | + | |
279 | 283 | regex_t **probe = proto->data; |
280 | 284 | regmatch_t pos = { 0, len }; |
281 | 285 | |
282 | 286 | for (; *probe && regexec(*probe, p, 0, &pos, REG_STARTEND); probe++) |
sslh-main.c | ||
---|---|---|
@@ -24,11 +24,15 @@ | ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | 27 | |
28 | + | |
28 | 29 | |
30 | + | |
31 | + | |
29 | 32 | |
30 | 33 | |
34 | + | |
31 | 35 | |
32 | 36 | |
33 | 37 | |
34 | 38 | |
@@ -175,9 +179,9 @@ | ||
175 | 179 | |
176 | 180 | |
177 | 181 | static void setup_regex_probe(struct proto *p, config_setting_t* probes) |
178 | 182 | { |
179 | - | |
183 | + | |
180 | 184 | int num_probes, errsize, i, res; |
181 | 185 | char *err; |
182 | 186 | const char * expr; |
183 | 187 | regex_t** probe_list; |
Built with git-ssb-web