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.
23 #include "pcappkt.hpp"
24 #include "timestamp.hpp"
31 PcapPkt::L4Proto getProto(void) const {return m_proto;}
32 Stream3(uint32_t id, PcapPkt::L4Proto proto);
33 Stream3() : m_id(UINT32_MAX), m_proto(PcapPkt::PROTO_UDP), m_pktCount(0), m_flushCount(0) {}
34 void addPkt(const PcapPkt& pkt);
35 void flush(ofstream *outputFile);
36 void addFromMemory(uint8_t *mem, size_t *len);
37 static uint32_t getIDFromMem(uint8_t *mem);
38 bool hasFlushablePackets() const {return !!m_flushCount;}
39 Timestamp getTimeout() const;
40 uint32_t getID() const {return m_id;}
41 void removeAllPackets();
42 void setID(const uint32_t id) {m_id = id;}
44 void writeHeader(ofstream *outputFile) const;
45 void writePackets(ofstream *outputFile) const;
49 PcapPkt::L4Proto m_proto;
50 vector<PcapPkt *> m_pkts;
52 uint32_t m_flushCount;
55 #endif /* _STREAM3_H_ */