LCOV - code coverage report
Current view: top level - bfd - bfd_connection.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 3 3 100.0 %
Date: 2026-06-18 01:51:13 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2014 CodiLime, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #ifndef SRC_BFD_BFD_CONNECTION_H_
       6             : #define SRC_BFD_BFD_CONNECTION_H_
       7             : 
       8             : #include <boost/asio.hpp>
       9             : #include <boost/asio/ip/address.hpp>
      10             : #include "bfd/bfd_server.h"
      11             : 
      12             : namespace BFD {
      13             : struct ControlPacket;
      14             : class Server;
      15             : 
      16             : class Connection {
      17             : public:
      18             :     virtual void SendPacket(
      19             :             const boost::asio::ip::udp::endpoint &local_endpoint,
      20             :             const boost::asio::ip::udp::endpoint &remote_endpoint,
      21             :             const SessionIndex &session_index,
      22             :             const boost::asio::mutable_buffer &packet, int pktSize) = 0;
      23         118 :     virtual void HandleReceive(const boost::asio::const_buffer &recv_buffer,
      24             :                     const boost::asio::ip::udp::endpoint &local_endpoint,
      25             :                     const boost::asio::ip::udp::endpoint &remote_endpoint,
      26             :                     const SessionIndex &session_index,
      27             :                     std::size_t bytes_transferred,
      28             :                     const boost::system::error_code& error) {
      29         118 :         GetServer()->ProcessControlPacket(local_endpoint, remote_endpoint,
      30             :                                           session_index, recv_buffer,
      31             :                                           bytes_transferred, error);
      32         118 :     }
      33             :     virtual void NotifyStateChange(const SessionKey &key, const bool &up) = 0;
      34             :     virtual Server *GetServer() const = 0;
      35             :     virtual void SetServer(Server *server) = 0;
      36             : };
      37             : 
      38             : }  // namespace BFD
      39             : 
      40             : #endif  // SRC_BFD_BFD_CONNECTION_H_

Generated by: LCOV version 1.14