Merge remote-tracking branch 'origin/master' into topic/johanna/table-changes

* origin/master: (33 commits)
  Fix location where CI places build.tgz
  Update submodule(s)
  Disable some deprecation diagnostics for GCC
  Compare pcap_next_ex() result to PCAP_ERROR/PCAP_ERROR_BREAK
  Optimize Connection::RemovalEvent() for bare-mode usage
  Rename BroType to Type
  Update NEWS
  Review cleanup
  Move Type types to zeek namespace
  Review cleanup
  Restrict Cirrus CI to only zeek repo's branches
  GH-977: Improve pcap error handling
  Remove not-useful code in iosource::Manager::OpenPktSrc
  GH-999: Stop formatting DHCP Client ID Hardware Type 0 as MAC
  Remove inline from some static KeyedHash members
  Improve Func.h inclusion
  Fix NVT analyzer memory leak from multiple telnet authn name options
  Rename aux/ to auxil/
  Move Flare/Pipe from the bro namespace to zeek::detail
  Move Attr to the zeek::detail namespace
  ...
This commit is contained in:
Johanna Amann 2020-06-15 14:18:44 -07:00
commit c8a3a90339
324 changed files with 4779 additions and 3673 deletions

View file

@ -9,6 +9,8 @@
#include "IntrusivePtr.h"
#include "threading/SerialTypes.h"
namespace zeek::detail {
const char* attr_name(attr_tag t)
{
static const char* attr_names[int(NUM_ATTRS)] = {
@ -36,9 +38,20 @@ Attr::Attr(attr_tag t)
{
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Attr::Attr(::attr_tag t, IntrusivePtr<Expr> e) : Attr(static_cast<attr_tag>(t), e)
{
}
Attr::Attr(::attr_tag t) : Attr(static_cast<attr_tag>(t))
{
}
#pragma GCC diagnostic pop
Attr::~Attr() = default;
void Attr::SetAttrExpr(IntrusivePtr<Expr> e)
void Attr::SetAttrExpr(IntrusivePtr<zeek::detail::Expr> e)
{ expr = std::move(e); }
void Attr::Describe(ODesc* d) const
@ -137,7 +150,7 @@ void Attr::AddTag(ODesc* d) const
d->Add(attr_name(Tag()));
}
Attributes::Attributes(attr_list* a, IntrusivePtr<BroType> t, bool arg_in_record, bool is_global)
Attributes::Attributes(attr_list* a, IntrusivePtr<Type> t, bool arg_in_record, bool is_global)
{
attrs.reserve(a->length());
in_record = arg_in_record;
@ -155,14 +168,14 @@ Attributes::Attributes(attr_list* a, IntrusivePtr<BroType> t, bool arg_in_record
delete a;
}
Attributes::Attributes(IntrusivePtr<BroType> t,
Attributes::Attributes(IntrusivePtr<Type> t,
bool arg_in_record, bool is_global)
: Attributes(std::vector<IntrusivePtr<Attr>>{}, std::move(t),
arg_in_record, is_global)
{}
Attributes::Attributes(std::vector<IntrusivePtr<Attr>> a,
IntrusivePtr<BroType> t,
IntrusivePtr<Type> t,
bool arg_in_record, bool is_global)
: type(std::move(t))
{
@ -245,6 +258,19 @@ void Attributes::RemoveAttr(attr_tag t)
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Attr* Attributes::FindAttr(::attr_tag t) const
{
return FindAttr(static_cast<attr_tag>(t));
}
void Attributes::RemoveAttr(::attr_tag t)
{
RemoveAttr(static_cast<attr_tag>(t));
}
#pragma GCC diagnostic pop
void Attributes::Describe(ODesc* d) const
{
if ( attrs.empty() )
@ -686,3 +712,5 @@ bool Attributes::operator==(const Attributes& other) const
return true;
}
}