LCOV - code coverage report
Current view: top level - source/extensions/http/original_ip_detection/xff - config.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 4 4 100.0 %
Date: 2024-01-05 06:35:25 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include "envoy/extensions/http/original_ip_detection/xff/v3/xff.pb.h"
       4             : #include "envoy/http/original_ip_detection.h"
       5             : #include "envoy/registry/registry.h"
       6             : 
       7             : #include "source/common/protobuf/protobuf.h"
       8             : 
       9             : namespace Envoy {
      10             : namespace Extensions {
      11             : namespace Http {
      12             : namespace OriginalIPDetection {
      13             : namespace Xff {
      14             : 
      15             : /**
      16             :  * Config registration for the x-forwarded-for IP detection extension.
      17             :  * @see OriginalIPDetectionFactory.
      18             :  */
      19             : class XffIPDetectionFactory : public Envoy::Http::OriginalIPDetectionFactory {
      20             : public:
      21             :   Envoy::Http::OriginalIPDetectionSharedPtr
      22             :   createExtension(const Protobuf::Message& message,
      23             :                   Server::Configuration::FactoryContext& context) override;
      24             : 
      25         153 :   ProtobufTypes::MessagePtr createEmptyConfigProto() override {
      26         153 :     return std::make_unique<envoy::extensions::http::original_ip_detection::xff::v3::XffConfig>();
      27         153 :   }
      28             : 
      29         190 :   std::string name() const override { return "envoy.http.original_ip_detection.xff"; }
      30             : };
      31             : 
      32             : DECLARE_FACTORY(XffIPDetectionFactory);
      33             : 
      34             : } // namespace Xff
      35             : } // namespace OriginalIPDetection
      36             : } // namespace Http
      37             : } // namespace Extensions
      38             : } // namespace Envoy

Generated by: LCOV version 1.15