xref: /aosp_15_r20/external/cronet/net/socket/socket_net_log_params.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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_SOCKET_NET_LOG_PARAMS_H_
6 #define NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
7 
8 #include "base/values.h"
9 #include "net/log/net_log_event_type.h"
10 
11 namespace net {
12 
13 class NetLogWithSource;
14 class HostPortPair;
15 class IPEndPoint;
16 
17 // Emits an event to NetLog with socket error parameters.
18 void NetLogSocketError(const NetLogWithSource& net_log,
19                        NetLogEventType type,
20                        int net_error,
21                        int os_error);
22 
23 // Creates a NetLog parameters for a HostPortPair.
24 base::Value::Dict CreateNetLogHostPortPairParams(
25     const HostPortPair* host_and_port);
26 
27 // Creates a NetLog parameters for an IPEndPoint.
28 base::Value::Dict CreateNetLogIPEndPointParams(const IPEndPoint* address);
29 
30 // Creates a NetLog parameters for the local and remote IPEndPoints on connect
31 // events.
32 base::Value::Dict CreateNetLogAddressPairParams(
33     const net::IPEndPoint& local_address,
34     const net::IPEndPoint& remote_address);
35 
36 }  // namespace net
37 
38 #endif  // NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
39