1/*
2 * Copyright (c) 2015-2016, Intel Corporation
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * * Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of Intel Corporation nor the names of its contributors
13 * may be used to endorse or promote products derived from this software
14 * without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef LBR_H
30#define LBR_H
31
32#include "ue2common.h"
33
34struct mq;
35struct NFA;
36
37#ifdef __cplusplus
38extern "C"
39{
40#endif
41
42// LBR Dot
43
44char nfaExecLbrDot_Q(const struct NFA *n, struct mq *q, s64a end);
45char nfaExecLbrDot_Q2(const struct NFA *n, struct mq *q, s64a end);
46char nfaExecLbrDot_QR(const struct NFA *n, struct mq *q, ReportID report);
47char nfaExecLbrDot_reportCurrent(const struct NFA *n, struct mq *q);
48char nfaExecLbrDot_inAccept(const struct NFA *n, ReportID report, struct mq *q);
49char nfaExecLbrDot_inAnyAccept(const struct NFA *n, struct mq *q);
50char nfaExecLbrDot_queueInitState(const struct NFA *n, struct mq *q);
51char nfaExecLbrDot_initCompressedState(const struct NFA *n, u64a offset,
52 void *state, u8 key);
53char nfaExecLbrDot_queueCompressState(const struct NFA *nfa, const struct mq *q,
54 s64a loc);
55char nfaExecLbrDot_expandState(const struct NFA *nfa, void *dest,
56 const void *src, u64a offset, u8 key);
57
58#define nfaExecLbrDot_testEOD NFA_API_NO_IMPL
59#define nfaExecLbrDot_B_Reverse NFA_API_NO_IMPL
60#define nfaExecLbrDot_zombie_status NFA_API_ZOMBIE_NO_IMPL
61
62// LBR Verm
63
64char nfaExecLbrVerm_Q(const struct NFA *n, struct mq *q, s64a end);
65char nfaExecLbrVerm_Q2(const struct NFA *n, struct mq *q, s64a end);
66char nfaExecLbrVerm_QR(const struct NFA *n, struct mq *q, ReportID report);
67char nfaExecLbrVerm_reportCurrent(const struct NFA *n, struct mq *q);
68char nfaExecLbrVerm_inAccept(const struct NFA *n, ReportID report,
69 struct mq *q);
70char nfaExecLbrVerm_inAnyAccept(const struct NFA *n, struct mq *q);
71char nfaExecLbrVerm_queueInitState(const struct NFA *n, struct mq *q);
72char nfaExecLbrVerm_initCompressedState(const struct NFA *n, u64a offset,
73 void *state, u8 key);
74char nfaExecLbrVerm_queueCompressState(const struct NFA *nfa,
75 const struct mq *q, s64a loc);
76char nfaExecLbrVerm_expandState(const struct NFA *nfa, void *dest,
77 const void *src, u64a offset, u8 key);
78
79#define nfaExecLbrVerm_testEOD NFA_API_NO_IMPL
80#define nfaExecLbrVerm_B_Reverse NFA_API_NO_IMPL
81#define nfaExecLbrVerm_zombie_status NFA_API_ZOMBIE_NO_IMPL
82
83// LBR Negated Verm
84
85char nfaExecLbrNVerm_Q(const struct NFA *n, struct mq *q, s64a end);
86char nfaExecLbrNVerm_Q2(const struct NFA *n, struct mq *q, s64a end);
87char nfaExecLbrNVerm_QR(const struct NFA *n, struct mq *q, ReportID report);
88char nfaExecLbrNVerm_reportCurrent(const struct NFA *n, struct mq *q);
89char nfaExecLbrNVerm_inAccept(const struct NFA *n, ReportID report,
90 struct mq *q);
91char nfaExecLbrNVerm_inAnyAccept(const struct NFA *n, struct mq *q);
92char nfaExecLbrNVerm_queueInitState(const struct NFA *n, struct mq *q);
93char nfaExecLbrNVerm_initCompressedState(const struct NFA *n, u64a offset,
94 void *state, u8 key);
95char nfaExecLbrNVerm_queueCompressState(const struct NFA *nfa,
96 const struct mq *q, s64a loc);
97char nfaExecLbrNVerm_expandState(const struct NFA *nfa, void *dest,
98 const void *src, u64a offset, u8 key);
99
100#define nfaExecLbrNVerm_testEOD NFA_API_NO_IMPL
101#define nfaExecLbrNVerm_B_Reverse NFA_API_NO_IMPL
102#define nfaExecLbrNVerm_zombie_status NFA_API_ZOMBIE_NO_IMPL
103
104// LBR Shuf
105
106char nfaExecLbrShuf_Q(const struct NFA *n, struct mq *q, s64a end);
107char nfaExecLbrShuf_Q2(const struct NFA *n, struct mq *q, s64a end);
108char nfaExecLbrShuf_QR(const struct NFA *n, struct mq *q, ReportID report);
109char nfaExecLbrShuf_reportCurrent(const struct NFA *n, struct mq *q);
110char nfaExecLbrShuf_inAccept(const struct NFA *n, ReportID report,
111 struct mq *q);
112char nfaExecLbrShuf_inAnyAccept(const struct NFA *n, struct mq *q);
113char nfaExecLbrShuf_queueInitState(const struct NFA *n, struct mq *q);
114char nfaExecLbrShuf_initCompressedState(const struct NFA *n, u64a offset,
115 void *state, u8 key);
116char nfaExecLbrShuf_queueCompressState(const struct NFA *nfa,
117 const struct mq *q, s64a loc);
118char nfaExecLbrShuf_expandState(const struct NFA *nfa, void *dest,
119 const void *src, u64a offset, u8 key);
120
121#define nfaExecLbrShuf_testEOD NFA_API_NO_IMPL
122#define nfaExecLbrShuf_B_Reverse NFA_API_NO_IMPL
123#define nfaExecLbrShuf_zombie_status NFA_API_ZOMBIE_NO_IMPL
124
125// LBR Truffle
126
127char nfaExecLbrTruf_Q(const struct NFA *n, struct mq *q, s64a end);
128char nfaExecLbrTruf_Q2(const struct NFA *n, struct mq *q, s64a end);
129char nfaExecLbrTruf_QR(const struct NFA *n, struct mq *q, ReportID report);
130char nfaExecLbrTruf_reportCurrent(const struct NFA *n, struct mq *q);
131char nfaExecLbrTruf_inAccept(const struct NFA *n, ReportID report,
132 struct mq *q);
133char nfaExecLbrTruf_inAnyAccept(const struct NFA *n, struct mq *q);
134char nfaExecLbrTruf_queueInitState(const struct NFA *n, struct mq *q);
135char nfaExecLbrTruf_initCompressedState(const struct NFA *n, u64a offset,
136 void *state, u8 key);
137char nfaExecLbrTruf_queueCompressState(const struct NFA *nfa,
138 const struct mq *q, s64a loc);
139char nfaExecLbrTruf_expandState(const struct NFA *nfa, void *dest,
140 const void *src, u64a offset, u8 key);
141
142#define nfaExecLbrTruf_testEOD NFA_API_NO_IMPL
143#define nfaExecLbrTruf_B_Reverse NFA_API_NO_IMPL
144#define nfaExecLbrTruf_zombie_status NFA_API_ZOMBIE_NO_IMPL
145
146#ifdef __cplusplus
147}
148#endif
149
150#endif
151