Merge "Fix changing impair delay through command line"
[samplevnf.git] / VNFs / DPPD-PROX / dpi / dpi_stub.c
1 /*
2 // Copyright (c) 2010-2017 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 #include <stdio.h>
18
19 #include "dpi.h"
20
21 /* The following functions are not a real implementation of a
22    DPI. They serve only to create dpi_stub.so which can be loaded into
23    prox. */
24
25 static int dpi_init(uint32_t thread_count, int argc, const char *argv[])
26 {
27         return 0;
28 }
29
30 size_t dpi_get_flow_entry_size(void) {return 0;}
31 void flow_data_dpi_flow_expire(void *flow_data) {}
32 void *dpi_thread_start() {return NULL;}
33 void dpi_thread_stop(void *opaque) {}
34 void dpi_finish(void) {}
35
36 int dpi_process(void *opaque, struct flow_info *fi, void *flow_data,
37                 struct dpi_payload *payload, uint32_t results[],
38                 size_t *result_len)
39 {
40         return 0;
41 }
42
43 static struct dpi_engine dpi_engine = {
44         .dpi_init = dpi_init,
45         .dpi_get_flow_entry_size = dpi_get_flow_entry_size,
46         .dpi_flow_expire = flow_data_dpi_flow_expire,
47         .dpi_thread_start = dpi_thread_start,
48         .dpi_thread_stop = dpi_thread_stop,
49         .dpi_process = dpi_process,
50         .dpi_finish = dpi_finish,
51         .dpi_print = printf,
52 };
53
54 struct dpi_engine *get_dpi_engine(void)
55 {
56         return &dpi_engine;
57 }