1 /** @file
2  *
3  *  A brief file description
4  *
5  *  @section license License
6  *
7  *  Licensed to the Apache Software Foundation (ASF) under one
8  *  or more contributor license agreements.  See the NOTICE file
9  *  distributed with this work for additional information
10  *  regarding copyright ownership.  The ASF licenses this file
11  *  to you under the Apache License, Version 2.0 (the
12  *  "License"); you may not use this file except in compliance
13  *  with the License.  You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  *  Unless required by applicable law or agreed to in writing, software
18  *  distributed under the License is distributed on an "AS IS" BASIS,
19  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  *  See the License for the specific language governing permissions and
21  *  limitations under the License.
22  */
23 
24 #pragma once
25 
26 struct QUICPacketInfo {
27   // 6.3.1.  Sent Packet Fields
28   QUICPacketNumber packet_number;
29   ink_hrtime time_sent;
30   bool ack_eliciting;
31   bool is_crypto_packet;
32   bool in_flight;
33   size_t sent_bytes;
34 
35   // addition
36   QUICPacketType type;
37   std::vector<QUICFrameInfo> frames;
38   QUICPacketNumberSpace pn_space;
39   // end
40 };
41 
42 class QUICCongestionController
43 {
44 public:
~QUICCongestionController()45   virtual ~QUICCongestionController() {}
46   virtual void on_packet_sent(size_t bytes_sent)                                                                    = 0;
47   virtual void on_packet_acked(const QUICPacketInfo &acked_packet)                                                  = 0;
48   virtual void process_ecn(const QUICPacketInfo &acked_largest_packet, const QUICAckFrame::EcnSection *ecn_section) = 0;
49   virtual void on_packets_lost(const std::map<QUICPacketNumber, QUICPacketInfo *> &packets)                         = 0;
50   virtual void add_extra_credit()                                                                                   = 0;
51   virtual void reset()                                                                                              = 0;
52   virtual uint32_t credit() const                                                                                   = 0;
53 };
54