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 #include <hilti/ast/types/computed.h>
9 
10 namespace hilti {
11 namespace operator_ {
12 
13 STANDARD_OPERATOR_2(address, Equal, type::Bool(), type::Address(), type::Address(), "Compares two address values.")
14 STANDARD_OPERATOR_2(address, Unequal, type::Bool(), type::Address(), type::Address(), "Compares two address values.")
15 
16 BEGIN_METHOD(address, Family)
17  auto signature() const {
18  return Signature{.self = type::Address(),
19  .result = builder::typeByID("hilti::AddressFamily"),
20  .id = "family",
21  .args = {},
22  .doc = R"(
23 Returns the protocol family of the address, which can be IPv4 or IPv6.
24 )"};
25  }
26 END_METHOD
27 
28 } // namespace operator_
29 } // namespace hilti