summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h
blob: ae440d2901aebced7069d2576042a62efebd5b1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_
#define QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_

#include <netinet/icmp6.h>
#include <netinet/in.h>

#include <functional>

#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"

namespace quic {

// Creates an ICMPv6 packet, returning a packed string representation of the
// packet to |cb|. The resulting packet is given to a callback because it's
// stack allocated inside CreateIcmpPacket.
void CreateIcmpPacket(in6_addr src,
                      in6_addr dst,
                      const icmp6_hdr& icmp_header,
                      quic::QuicStringPiece body,
                      const std::function<void(quic::QuicStringPiece)>& cb);

}  // namespace quic

#endif  // QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_