Change the default size of hash table to smaller value
[com/gs-lite.git] / include / filter.h
1 /* ------------------------------------------------
2 Copyright 2014 AT&T Intellectual Property
3    Licensed under the Apache License, Version 2.0 (the "License");
4    you may not use this file except in compliance with the License.
5    You may obtain a copy of the License at
6
7      http://www.apache.org/licenses/LICENSE-2.0
8
9    Unless required by applicable law or agreed to in writing, software
10    distributed under the License is distributed on an "AS IS" BASIS,
11    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12    See the License for the specific language governing permissions and
13    limitations under the License.
14  ------------------------------------------- */
15
16 /*
17  * filter.h: hash table function which match the interface
18  */
19 #ifndef FILTER_H
20 #define FILTER_H
21
22 /* FILTER FUNCTIONS */
23 /* ===============  */
24
25 /* The following functions are used to manage filter sets for flow
26    and connection filters
27 */
28
29 struct filter {
30     gs_uint32_t size;
31     gs_uint8_t data[1];
32 };
33
34 struct filter * ftafilter_create(gs_int32_t size);
35 void ftafilter_delete(struct filter * filter);
36 void ftafilter_add_flow ( struct filter * filter, gs_uint32_t ip, gs_uint32_t port);
37 void fyafilter_add_connection ( struct filter * filter, gs_uint32_t ip1,
38                              gs_uint32_t port1, gs_uint32_t ip2, gs_uint32_t port2);
39 void ftafilter_rm_flow ( struct filter * filter, gs_uint32_t ip, gs_uint32_t port);
40 void ftafilter_rm_connection ( struct filter * filter, gs_uint32_t ip1,
41                             gs_uint32_t port1, gs_uint32_t ip2, gs_uint32_t port2);
42 struct vstring * ftafilter_to_vstring(struct filter * f );
43 void ftafilter_vstring_free(struct vstring * res);
44
45
46 #endif