2 // Copyright (c) 2010-2017 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef _STREAMEXTRACT_H_
18 #define _STREAMEXTRACT_H_
25 #include "programconfig.hpp"
27 #include "pcapreader.hpp"
28 #include "flowtable.hpp"
29 #include "pcappkt.hpp"
30 #include "stream3.hpp"
31 #include "streamsorter.hpp"
38 /* The size of the flow table determines the number of flows
39 that can be active at a given time. When a flow expires, it
40 is written out to a file and the memory is freed. */
41 StreamExtract(const ProgramConfig &cfg);
44 int writeToPcaps(const string &sourceFilePath, const set<uint32_t> &streamIDs);
45 int writeToLua(const string& binFilePath, const Path &smallFinalBin, const string& luaFilePath, const string& orderedTemp);
46 int writeFinalBin(const string& sourceFilePath, const string& destFilePath);
47 string createStreamPcapFileName(int id);
48 vector<Bundle> createBundles(const string& streamPath);
49 set<uint32_t> getBundleStreamIDs(const vector<Bundle*>& bundleSamples);
50 FlowTable<pkt_tuple, Stream3> ft2;
51 StreamSorter streamSorter;
55 #endif /* _STREAMEXTRACT_H_ */