diff --git a/include/proxy-wasm/exports.h b/include/proxy-wasm/exports.h index 5d4df20d..914176b8 100644 --- a/include/proxy-wasm/exports.h +++ b/include/proxy-wasm/exports.h @@ -27,6 +27,11 @@ extern thread_local ContextBase *current_context_; namespace exports { +template size_t pairsSize(const Pairs &result); +template void marshalPairs(const Pairs &result, char *buffer); +template +bool getPairs(ContextBase *context, const Pairs &result, uint64_t ptr_ptr, uint64_t size_ptr); + // ABI functions exported from envoy to wasm. Word get_configuration(void *raw_context, Word address, Word size); diff --git a/src/exports.cc b/src/exports.cc index c1ea49c3..0e635381 100644 --- a/src/exports.cc +++ b/src/exports.cc @@ -67,6 +67,8 @@ Pairs toPairs(std::string_view buffer) { return result; } +} // namespace + template size_t pairsSize(const Pairs &result) { size_t size = 4; // number of headers for (auto &p : result) { @@ -115,8 +117,6 @@ bool getPairs(ContextBase *context, const Pairs &result, uint64_t ptr_ptr, uint6 return true; } -} // namespace - // General ABI. Word set_property(void *raw_context, Word key_ptr, Word key_size, Word value_ptr, Word value_size) {