1 /*
2    BAREOS® - Backup Archiving REcovery Open Sourced
3 
4    Copyright (C) 2019-2019 Bareos GmbH & Co. KG
5 
6    This program is Free Software; you can redistribute it and/or
7    modify it under the terms of version three of the GNU Affero General Public
8    License as published by the Free Software Foundation and included
9    in the file LICENSE.
10 
11    This program is distributed in the hope that it will be useful, but
12    WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14    Affero General Public License for more details.
15 
16    You should have received a copy of the GNU Affero General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19    02110-1301, USA.
20 */
21 
22 #ifndef BAREOS_LIB_BNET_NETWORK_DUMP_H_
23 #define BAREOS_LIB_BNET_NETWORK_DUMP_H_
24 
25 class BareosResource;
26 class QualifiedResourceNameTypeConverter;
27 class BnetDumpPrivate;
28 
29 class BnetDump {
30  public:
31   static std::unique_ptr<BnetDump> Create(std::string own_qualified_name);
32   static bool EvaluateCommandLineArgs(const char* cmdline_optarg);
33 
34   void SetDestinationQualifiedName(std::string destination_qualified_name);
35   void DumpMessageAndStacktraceToFile(const char* ptr, int nbytes) const;
36 
37  public:
38   ~BnetDump();
39 
40   BnetDump(const BnetDump& other) = delete;
41   BnetDump(const BnetDump&& other) = delete;
42   BnetDump& operator=(const BnetDump& rhs) = delete;
43   BnetDump& operator=(const BnetDump&& rhs) = delete;
44   BnetDump() = delete;
45 
46  private:
47   BnetDump(const std::string& own_qualified_name);
48   std::unique_ptr<BnetDumpPrivate> impl_;
49 };
50 
51 #endif  // BAREOS_LIB_BNET_NETWORK_DUMP_H_
52