5 #include <hilti/ast/builder/type.h> 6 #include <hilti/ast/operators/common.h> 7 #include <hilti/ast/types/integer.h> 8 #include <hilti/ast/types/network.h> 13 STANDARD_OPERATOR_2(network, Equal, type::Bool(), type::Network(), type::Network(),
"Compares two network values.")
14 STANDARD_OPERATOR_2(network, Unequal, type::Bool(), type::Network(), type::Network(), "Compares two network values.")
15 STANDARD_OPERATOR_2(network, In, type::Bool(), type::Address(), type::Network(),
16 "Returns true if the address is part of the network range.")
18 BEGIN_METHOD(network, Family)
19 auto signature()
const {
20 return Signature{.self = type::Network(),
21 .result = builder::typeByID(
"hilti::AddressFamily"),
25 Returns the protocol family of the network, which can be IPv4 or IPv6. 30 BEGIN_METHOD(network, Prefix) 31 auto signature()
const {
32 return Signature{.self = type::Network(), .result = type::Address(), .id =
"prefix", .args = {}, .doc = R
"( 33 Returns the network's prefix as a masked IP address. 38 BEGIN_METHOD(network, Length) 39 auto signature()
const {
40 return Signature{.self = type::Network(),
41 .result = type::SignedInteger(64),
45 Returns the length of the network's prefix.