The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
regex.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: 0aa299c754a26d2b9406f9fa5ed1afa2aafee5cf $
20  *
21  * @file lib/server/regex.h
22  * @brief Regular expression functions used by the server library.
23  *
24  * @copyright 2014 The FreeRADIUS server project
25  */
26 RCSIDH(server_regex_h, "$Id: 0aa299c754a26d2b9406f9fa5ed1afa2aafee5cf $")
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #ifdef HAVE_REGEX
33 #include <freeradius-devel/server/request.h>
34 #include <freeradius-devel/util/regex.h>
35 #include <freeradius-devel/util/talloc.h>
36 
37 /*
38  * Increasing this is essentially free
39  * It just increases memory usage. 12-16 bytes for each additional subcapture.
40  */
41 # define REQUEST_MAX_REGEX 32
42 
43 void regex_sub_to_request(request_t *request, regex_t **preg, fr_regmatch_t **regmatch);
44 
45 int regex_request_to_sub(TALLOC_CTX *ctx, char **out, request_t *request, uint32_t num);
46 
47 /*
48  * Named capture groups only supported by PCRE.
49  */
50 # if defined(HAVE_REGEX_PCRE2) || defined(HAVE_REGEX_PCRE)
51 int regex_request_to_sub_named(TALLOC_CTX *ctx, char **out, request_t *request, char const *name);
52 # endif
53 #endif
54 
55 #ifdef __cplusplus
56 }
57 #endif
#define RCSIDH(h, id)
Definition: build.h:482
unsigned int uint32_t
Definition: merged_model.c:33
static char const * name
static size_t char ** out
Definition: value.h:997