mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Deprecate TunnelEncapsulation BuildRecordVal/BuildVectorVal methods
Replaced with ToVal methods that return IntrusivePtr
This commit is contained in:
parent
61649d5da7
commit
2cfbbd8cdb
3 changed files with 19 additions and 12 deletions
|
@ -3,6 +3,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "zeek-config.h"
|
||||
#include "IntrusivePtr.h"
|
||||
#include "NetVar.h"
|
||||
#include "IPAddr.h"
|
||||
#include "Var.h" // for internal_type()
|
||||
|
@ -79,7 +80,11 @@ public:
|
|||
/**
|
||||
* Returns record value of type "EncapsulatingConn" representing the tunnel.
|
||||
*/
|
||||
RecordVal* GetRecordVal() const;
|
||||
IntrusivePtr<RecordVal> ToVal() const;
|
||||
|
||||
[[deprecated("Remove in v4.1. Use ToVal() instead.")]]
|
||||
RecordVal* GetRecordVal() const
|
||||
{ return ToVal().release(); }
|
||||
|
||||
friend bool operator==(const EncapsulatingConn& ec1,
|
||||
const EncapsulatingConn& ec2)
|
||||
|
@ -190,20 +195,24 @@ public:
|
|||
* Get the value of type "EncapsulatingConnVector" represented by the
|
||||
* entire encapsulation chain.
|
||||
*/
|
||||
VectorVal* GetVectorVal() const
|
||||
IntrusivePtr<VectorVal> ToVal() const
|
||||
{
|
||||
VectorVal* vv = new VectorVal(
|
||||
auto vv = make_intrusive<VectorVal>(
|
||||
internal_type("EncapsulatingConnVector")->AsVectorType());
|
||||
|
||||
if ( conns )
|
||||
{
|
||||
for ( size_t i = 0; i < conns->size(); ++i )
|
||||
vv->Assign(i, (*conns)[i].GetRecordVal());
|
||||
vv->Assign(i, (*conns)[i].ToVal());
|
||||
}
|
||||
|
||||
return vv;
|
||||
}
|
||||
|
||||
[[deprecated("Remove in v4.1. Use ToVal() instead.")]]
|
||||
VectorVal* GetVectorVal() const
|
||||
{ return ToVal().release(); }
|
||||
|
||||
friend bool operator==(const EncapsulationStack& e1,
|
||||
const EncapsulationStack& e2);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue