1 // Copyright 2012 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_SOCKET_UDP_NET_LOG_PARAMETERS_H_ 6 #define NET_SOCKET_UDP_NET_LOG_PARAMETERS_H_ 7 8 #include "base/values.h" 9 #include "net/base/network_handle.h" 10 #include "net/log/net_log_event_type.h" 11 12 namespace net { 13 14 class NetLogWithSource; 15 class IPEndPoint; 16 17 // Emits a NetLog event with parameters describing a UDP receive/send event. 18 // |bytes| are only logged when byte logging is enabled. |address| may be 19 // nullptr. 20 void NetLogUDPDataTransfer(const NetLogWithSource& net_log, 21 NetLogEventType type, 22 int byte_count, 23 const char* bytes, 24 const IPEndPoint* address); 25 26 // Creates NetLog parameters describing a UDP connect event. 27 base::Value::Dict CreateNetLogUDPConnectParams(const IPEndPoint& address, 28 handles::NetworkHandle network); 29 30 } // namespace net 31 32 #endif // NET_SOCKET_UDP_NET_LOG_PARAMETERS_H_ 33