1
#include "source/common/network/downstream_network_namespace.h"
2

            
3
#include "envoy/registry/registry.h"
4
#include "envoy/stream_info/filter_state.h"
5

            
6
#include "source/common/common/macros.h"
7

            
8
namespace Envoy {
9
namespace Network {
10

            
11
1709
const std::string& DownstreamNetworkNamespace::key() {
12
1709
  CONSTRUCT_ON_FIRST_USE(std::string, "envoy.network.network_namespace");
13
1709
}
14

            
15
class DownstreamNetworkNamespaceObjectFactory : public StreamInfo::FilterState::ObjectFactory {
16
public:
17
1672
  std::string name() const override { return DownstreamNetworkNamespace::key(); }
18
  std::unique_ptr<StreamInfo::FilterState::Object>
19
1
  createFromBytes(absl::string_view data) const override {
20
1
    return std::make_unique<DownstreamNetworkNamespace>(data);
21
1
  }
22
};
23

            
24
REGISTER_FACTORY(DownstreamNetworkNamespaceObjectFactory, StreamInfo::FilterState::ObjectFactory);
25

            
26
} // namespace Network
27
} // namespace Envoy