Spicy
address.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <hilti/ast/builder/type.h>
6 #include <hilti/ast/operators/common.h>
7 #include <hilti/ast/types/address.h>
8 
9 namespace hilti::operator_ {
10 
11 STANDARD_OPERATOR_2(address, Equal, type::Bool(), type::Address(), type::Address(), "Compares two address values.")
12 STANDARD_OPERATOR_2(address, Unequal, type::Bool(), type::Address(), type::Address(), "Compares two address values.")
13 
14 BEGIN_METHOD(address, Family)
15  const auto& signature() const {
16  static auto _signature = Signature{.self = type::Address(),
17  .result = builder::typeByID("hilti::AddressFamily"),
18  .id = "family",
19  .args = {},
20  .doc = R"(
21 Returns the protocol family of the address, which can be IPv4 or IPv6.
22 )"};
23  return _signature;
24  }
25 END_METHOD
26 
27 } // namespace hilti::operator_
Definition: operator-registry.h:15