1 //--------------------------------------------------------------------------
2 // Copyright (C) 2015-2021 Cisco and/or its affiliates. All rights reserved.
3 //
4 // This program is free software; you can redistribute it and/or modify it
5 // under the terms of the GNU General Public License Version 2 as published
6 // by the Free Software Foundation.  You may not use, modify or distribute
7 // this program under any other version of the GNU General Public License.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License along
15 // with this program; if not, write to the Free Software Foundation, Inc.,
16 // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 //--------------------------------------------------------------------------
18 // file_session.h author Russ Combs <rucombs@cisco.com>
19 
20 #ifndef FILE_SESSION_H
21 #define FILE_SESSION_H
22 
23 #include "flow/session.h"
24 
25 class FileSession : public Session
26 {
27 public:
28     FileSession(snort::Flow*);
29     ~FileSession() override;
30 
31     bool setup(snort::Packet*) override;
32     void clear() override;
33     int process(snort::Packet*) override;
34 
is_sequenced(uint8_t)35     bool is_sequenced(uint8_t /*dir*/) override
36     { return true; }
37 
are_packets_missing(uint8_t)38     bool are_packets_missing(uint8_t /*dir*/) override
39     { return false; }
40 
missing_in_reassembled(uint8_t)41     uint8_t missing_in_reassembled(uint8_t /*dir*/) override
42     { return SSN_MISSING_NONE; }
43 
44 private:
45     void start(snort::Packet*, snort::Flow*);
46     void update(snort::Packet*, snort::Flow*);
47     void end(snort::Packet*, snort::Flow*);
48 };
49 
50 #endif
51 
52