1
// NOLINT(namespace-envoy)
2
#pragma once
3

            
4
#define PROXY_WASM_PROTOBUF 1
5
#define PROXY_WASM_PROTOBUF_FULL 1
6

            
7
#include "envoy/config/core/v3/grpc_service.pb.h"
8

            
9
#include "source/extensions/common/wasm/ext/declare_property.pb.h"
10
#include "source/extensions/common/wasm/ext/sign.pb.h"
11
#include "source/extensions/common/wasm/ext/verify_signature.pb.h"
12

            
13
#include "include/proxy-wasm/null_plugin.h"
14

            
15
namespace Envoy {
16
namespace Extensions {
17
namespace Common {
18
namespace Wasm {
19

            
20
proxy_wasm::Word resolve_dns(proxy_wasm::Word dns_address, proxy_wasm::Word dns_address_size,
21
                             proxy_wasm::Word token_ptr);
22

            
23
} // namespace Wasm
24
} // namespace Common
25
} // namespace Extensions
26
} // namespace Envoy
27

            
28
namespace proxy_wasm {
29
namespace null_plugin {
30

            
31
#include "source/extensions/common/wasm/ext/envoy_proxy_wasm_api.h"
32
using GrpcService = envoy::config::core::v3::GrpcService;
33
using namespace proxy_wasm::null_plugin;
34

            
35
4
#define WS(_x) Word(static_cast<uint64_t>(_x))
36
8
#define WR(_x) Word(reinterpret_cast<uint64_t>(_x))
37

            
38
inline WasmResult envoy_resolve_dns(const char* dns_address, size_t dns_address_size,
39
4
                                    uint32_t* token) {
40
4
  return static_cast<WasmResult>(::Envoy::Extensions::Common::Wasm::resolve_dns(
41
4
                                     WR(dns_address), WS(dns_address_size), WR(token))
42
4
                                     .u64_);
43
4
}
44

            
45
#undef WS
46
#undef WR
47

            
48
} // namespace null_plugin
49
} // namespace proxy_wasm