15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "net/base/net_log.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "net/base/sys_addrinfo.h"
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace net {
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class HostPortPair;
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class IPEndPoint;
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates a NetLog callback for socket error events.
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)NetLog::ParametersCallback CreateNetLogSocketErrorCallback(int net_error,
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                                           int os_error);
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates a NetLog callback for a HostPortPair.
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |host_and_port| must remain valid for the lifetime of the returned callback.
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)NetLog::ParametersCallback CreateNetLogHostPortPairCallback(
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const HostPortPair* host_and_port);
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates a NetLog callback for an IPEndPoint.
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |address| must remain valid for the lifetime of the returned callback.
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)NetLog::ParametersCallback CreateNetLogIPEndPointCallback(
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const IPEndPoint* address);
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates a NetLog callback for the source sockaddr on connect events.
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |net_address| must remain valid for the lifetime of the returned callback.
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)NetLog::ParametersCallback CreateNetLogSourceAddressCallback(
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const struct sockaddr* net_address,
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    socklen_t address_len);
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace net
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
39