blob: 79923b682e3c2e8f9e6bbee30fa1d49097bdc90d [file] [log] [blame]
michaeltfcea39d2017-04-20 05:39:30 -07001/*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
kwibergad43d4b2017-09-05 08:38:22 -070011#ifndef WEBRTC_RTC_TOOLS_NETWORK_TESTER_PACKET_LOGGER_H_
12#define WEBRTC_RTC_TOOLS_NETWORK_TESTER_PACKET_LOGGER_H_
michaeltfcea39d2017-04-20 05:39:30 -070013
14#include <fstream>
15#include <string>
16
Edward Lemurc20978e2017-07-06 19:44:34 +020017#include "webrtc/rtc_base/constructormagic.h"
18#include "webrtc/rtc_base/ignore_wundef.h"
michaeltfcea39d2017-04-20 05:39:30 -070019
20#ifdef WEBRTC_NETWORK_TESTER_PROTO
21RTC_PUSH_IGNORING_WUNDEF()
kjellanderd2b63cf2017-06-30 03:04:59 -070022#include "webrtc/rtc_tools/network_tester/network_tester_packet.pb.h"
michaeltfcea39d2017-04-20 05:39:30 -070023RTC_POP_IGNORING_WUNDEF()
24using webrtc::network_tester::packet::NetworkTesterPacket;
25#else
26class NetworkTesterPacket;
27#endif // WEBRTC_NETWORK_TESTER_PROTO
28
29namespace webrtc {
30
31class PacketLogger {
32 public:
33 explicit PacketLogger(const std::string& log_file_path);
34 ~PacketLogger();
35
36 void LogPacket(const NetworkTesterPacket& packet);
37
38 private:
39 std::ofstream packet_logger_stream_;
40
41 RTC_DISALLOW_COPY_AND_ASSIGN(PacketLogger);
42};
43
44} // namespace webrtc
45
kwibergad43d4b2017-09-05 08:38:22 -070046#endif // WEBRTC_RTC_TOOLS_NETWORK_TESTER_PACKET_LOGGER_H_