1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace allow_deny 5 { 6 // clang-format off 7 8 enum class IPAddressType{ 9 Invalid, 10 IPv4, 11 IPv6, 12 }; 13 14 enum class AllowType{ 15 Invalid, 16 Allow, 17 Deny, 18 }; 19 20 enum class DataDirection{ 21 Invalid, 22 Ingress, 23 Egress, 24 }; 25 26 NLOHMANN_JSON_SERIALIZE_ENUM(IPAddressType, { 27 {IPAddressType::Invalid, "Invalid"}, 28 {IPAddressType::IPv4, "IPv4"}, 29 {IPAddressType::IPv6, "IPv6"}, 30 }); 31 32 NLOHMANN_JSON_SERIALIZE_ENUM(AllowType, { 33 {AllowType::Invalid, "Invalid"}, 34 {AllowType::Allow, "Allow"}, 35 {AllowType::Deny, "Deny"}, 36 }); 37 38 NLOHMANN_JSON_SERIALIZE_ENUM(DataDirection, { 39 {DataDirection::Invalid, "Invalid"}, 40 {DataDirection::Ingress, "Ingress"}, 41 {DataDirection::Egress, "Egress"}, 42 }); 43 44 } 45 // clang-format on 46