• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2019 The Chromium Authors. All rights reserved.
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 QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_
6 #define QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_
7 
8 #include <netinet/icmp6.h>
9 #include <netinet/in.h>
10 
11 #include <functional>
12 
13 #include "absl/strings/string_view.h"
14 #include "quiche/quic/platform/api/quic_ip_address.h"
15 
16 namespace quic {
17 
18 // Creates an ICMPv6 packet, returning a packed string representation of the
19 // packet to |cb|. The resulting packet is given to a callback because it's
20 // stack allocated inside CreateIcmpPacket.
21 void CreateIcmpPacket(in6_addr src, in6_addr dst, const icmp6_hdr& icmp_header,
22                       absl::string_view body,
23                       const std::function<void(absl::string_view)>& cb);
24 
25 }  // namespace quic
26 
27 #endif  // QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_
28