#include <fmt/format.h>

#include <stdplus/net/addr/subnet.hpp>

#include <format>
#include <string_view>

#include <gtest/gtest.h>

using std::literals::string_view_literals::operator""sv;

namespace stdplus
{

auto addr4Full = In4Addr{255, 255, 255, 255};
auto addr6Full = In6Addr{255, 255, 255, 255, 255, 255, 255, 255,
                         255, 255, 255, 255, 255, 255, 255, 255};

TEST(Subnet4, Basic)
{
    EXPECT_NO_THROW(Subnet4(in_addr{0xffffffff}, 32));
    EXPECT_NO_THROW(Subnet4(addr4Full, 0));
    EXPECT_NO_THROW(Subnet4(in_addr{}, 10));
    EXPECT_THROW(Subnet4(in_addr{0xffffffff}, 33), std::invalid_argument);
    EXPECT_THROW(Subnet4(in_addr{0xffffffff}, 64), std::invalid_argument);

    EXPECT_NE(Subnet4(in_addr{0xff}, 32), Subnet4(in_addr{}, 32));
    EXPECT_NE(Subnet4(in_addr{0xff}, 26), Subnet4(in_addr{0xff}, 27));
    EXPECT_EQ(Subnet4(in_addr{0xff}, 32), Subnet4(in_addr{0xff}, 32));
    EXPECT_EQ(Subnet4(in_addr{}, 1), Subnet4(in_addr{}, 1));
}

TEST(Subnet4, Network)
{
    EXPECT_EQ((In4Addr{}), Subnet4(In4Addr{}, 32).network());
    EXPECT_EQ(addr4Full, Subnet4(addr4Full, 32).network());
    EXPECT_EQ((In4Addr{255, 255, 128, 0}), Subnet4(addr4Full, 17).network());
    EXPECT_EQ((In4Addr{255, 255, 0, 0}), Subnet4(addr4Full, 16).network());
    EXPECT_EQ((In4Addr{255, 254, 0, 0}), Subnet4(addr4Full, 15).network());
    EXPECT_EQ((In4Addr{}), Subnet4(addr4Full, 0).network());
    EXPECT_EQ((In4Addr{}), Subnet4(In4Addr{}, 0).network());
}

TEST(Subnet4, Contains)
{
    EXPECT_TRUE(Subnet4(addr4Full, 32).contains(addr4Full));
    EXPECT_FALSE(Subnet4(addr4Full, 32).contains(In4Addr{255, 255, 255, 254}));
    EXPECT_FALSE(Subnet4(addr4Full, 32).contains(In4Addr{}));
    EXPECT_TRUE(
        Subnet4(addr4Full, 17).contains(static_cast<in_addr>(addr4Full)));
    EXPECT_TRUE(Subnet4(addr4Full, 17).contains(In4Addr{255, 255, 128, 134}));
    EXPECT_FALSE(Subnet4(addr4Full, 17).contains(In4Addr{255, 255, 127, 132}));
    EXPECT_TRUE(Subnet4(addr4Full, 14).contains(addr4Full));
    EXPECT_TRUE(Subnet4(addr4Full, 0).contains(addr4Full));
    EXPECT_TRUE(Subnet4(In4Addr{}, 0).contains(addr4Full));
    EXPECT_TRUE(Subnet4(addr4Full, 0).contains(In4Addr{}));
}

TEST(Subnet4, FromStr)
{
    constexpr FromStr<Subnet4> fs;
    EXPECT_THROW(fs("10"sv), std::invalid_argument);
    EXPECT_THROW(fs("/10"sv), std::invalid_argument);
    EXPECT_THROW(fs("0.0.0.0"sv), std::invalid_argument);
    EXPECT_THROW(fs("0.0.0.0/"sv), std::invalid_argument);
    EXPECT_THROW(fs("::/80"sv), std::invalid_argument);
    EXPECT_EQ((SubnetAny{in_addr{}, 30}), fs("0.0.0.0/30"sv));
    EXPECT_EQ((SubnetAny{in_addr{}, 30}), "0.0.0.0/30"_sub4);
}

TEST(Subnet4, ToStr)
{
    ToStrHandle<ToStr<Subnet4>> tsh;
    EXPECT_EQ("0.0.0.0/16", tsh(Subnet4({}, 16)));
    EXPECT_EQ("255.0.255.255/28", tsh(Subnet4(In4Addr{255, 0, 255, 255}, 28)));
    EXPECT_EQ("a 1.2.3.4/32 b",
              fmt::format("a {} b", Subnet4(In4Addr{1, 2, 3, 4}, 32)));
    EXPECT_EQ("a 1.2.3.4/32 b",
              std::format("a {} b", Subnet4(In4Addr{1, 2, 3, 4}, 32)));
}

TEST(Subnet6, Basic)
{
    EXPECT_NO_THROW(Subnet6(in6_addr{0xff}, 128));
    EXPECT_NO_THROW(Subnet6(addr6Full, 0));
    EXPECT_NO_THROW(Subnet6(in6_addr{}, 65));
    EXPECT_THROW(Subnet6(in6_addr{0xff}, 129), std::invalid_argument);
    EXPECT_THROW(Subnet6(in6_addr{0xff}, 150), std::invalid_argument);

    EXPECT_NE(Subnet6(in6_addr{0xff}, 32), Subnet6(in6_addr{}, 32));
    EXPECT_NE(Subnet6(in6_addr{0xff}, 26), Subnet6(in6_addr{0xff}, 27));
    EXPECT_EQ(Subnet6(in6_addr{0xff}, 32), Subnet6(in6_addr{0xff}, 32));
    EXPECT_EQ(Subnet6(in6_addr{}, 1), Subnet6(in6_addr{}, 1));
}

TEST(Subnet6, Network)
{
    EXPECT_EQ(In6Addr(), Subnet6(In6Addr(), 128).network());
    EXPECT_EQ(addr6Full, Subnet6(addr6Full, 128).network());
    EXPECT_EQ((In6Addr{255, 255, 255, 255, 224}),
              Subnet6(addr6Full, 35).network());
    EXPECT_EQ((In6Addr{255, 255, 255, 255}), Subnet6(addr6Full, 32).network());
    EXPECT_EQ((In6Addr{255, 255, 128, 0}), Subnet6(addr6Full, 17).network());
    EXPECT_EQ((In6Addr{255, 255, 0, 0}), Subnet6(addr6Full, 16).network());
    EXPECT_EQ((In6Addr{255, 254, 0, 0}), Subnet6(addr6Full, 15).network());
    EXPECT_EQ((In6Addr{}), Subnet6(addr6Full, 0).network());
    EXPECT_EQ((In6Addr{}), Subnet6(In6Addr{}, 0).network());
}

TEST(Subnet6, Contains)
{
    auto addr6NFull = addr6Full;
    addr6NFull.s6_addr[15] = 254;
    EXPECT_TRUE(Subnet6(addr6Full, 128).contains(addr6Full));
    EXPECT_FALSE(Subnet6(addr6Full, 128).contains(addr6NFull));
    EXPECT_FALSE(Subnet6(addr6Full, 128).contains(In6Addr{}));
    EXPECT_TRUE(
        Subnet6(addr6Full, 127).contains(static_cast<in6_addr>(addr6Full)));
    EXPECT_TRUE(Subnet6(addr6Full, 127).contains(addr6NFull));
    EXPECT_TRUE(
        Subnet6(addr6Full, 33).contains(In6Addr{255, 255, 255, 255, 128, 255}));
    EXPECT_FALSE(
        Subnet6(addr6Full, 33).contains(In6Addr{255, 255, 255, 255, 127}));
    EXPECT_TRUE(Subnet6(In6Addr{}, 33).contains(In6Addr{0, 0, 0, 0, 127}));
    EXPECT_TRUE(
        Subnet6(addr6Full, 14).contains(In6Addr{255, 255, 0, 0, 0, 0, 0, 145}));
    EXPECT_FALSE(Subnet6(addr6Full, 14).contains(In6Addr{255, 127, 1}));
    EXPECT_TRUE(Subnet6(addr6Full, 0).contains(addr6Full));
    EXPECT_TRUE(Subnet6(In6Addr{}, 0).contains(addr6Full));
    EXPECT_TRUE(Subnet6(addr6Full, 0).contains(In6Addr{}));
}

TEST(Subnet6, FromStr)
{
    constexpr FromStr<Subnet6> fs;
    EXPECT_THROW(fs("10"sv), std::invalid_argument);
    EXPECT_THROW(fs("/10"sv), std::invalid_argument);
    EXPECT_THROW(fs("ff::"sv), std::invalid_argument);
    EXPECT_THROW(fs("::/"sv), std::invalid_argument);
    EXPECT_THROW(fs("0.0.0.0/0"sv), std::invalid_argument);
    EXPECT_EQ((Subnet6{in6_addr{}, 80}), fs("::/80"sv));
    EXPECT_EQ((Subnet6{in6_addr{}, 80}), "::/80"_sub6);
}

TEST(Subnet6, ToStr)
{
    ToStrHandle<ToStr<Subnet6>> tsh;
    EXPECT_EQ("::/0", tsh(Subnet6({}, 0)));
    EXPECT_EQ("ff00::/128", tsh(Subnet6(In6Addr{0xff}, 128)));
    EXPECT_EQ("a 102:304::/32 b",
              fmt::format("a {} b", Subnet6(In6Addr{1, 2, 3, 4}, 32)));
    EXPECT_EQ("a 102:304::/32 b",
              std::format("a {} b", Subnet6(In6Addr{1, 2, 3, 4}, 32)));
}

TEST(SubnetAny, Basic)
{
    EXPECT_NO_THROW(SubnetAny(in_addr{0xffffffff}, 32));
    EXPECT_NO_THROW(SubnetAny(addr4Full, 0));
    EXPECT_NO_THROW(SubnetAny(InAnyAddr{addr4Full}, 0));
    EXPECT_NO_THROW(SubnetAny(in_addr{}, 10));
    EXPECT_THROW(SubnetAny(in_addr{0xffffffff}, 33), std::invalid_argument);
    EXPECT_THROW(SubnetAny(InAnyAddr{in_addr{0xffffffff}}, 33),
                 std::invalid_argument);
    EXPECT_THROW(SubnetAny(in_addr{0xffffffff}, 64), std::invalid_argument);
    EXPECT_NO_THROW(SubnetAny(in6_addr{0xff}, 128));
    EXPECT_NO_THROW(SubnetAny(addr6Full, 0));
    EXPECT_NO_THROW(SubnetAny(InAnyAddr{addr6Full}, 0));
    EXPECT_NO_THROW(SubnetAny(in6_addr{}, 65));
    EXPECT_THROW(SubnetAny(in6_addr{0xff}, 129), std::invalid_argument);
    EXPECT_THROW(SubnetAny(InAnyAddr{in6_addr{0xff}}, 129),
                 std::invalid_argument);
    EXPECT_THROW(SubnetAny(in6_addr{0xff}, 150), std::invalid_argument);

    EXPECT_NO_THROW(SubnetAny(Subnet4(in_addr{}, 32)));
    EXPECT_NO_THROW(SubnetAny(Subnet6(in6_addr{0xff}, 128)));

    EXPECT_NE(SubnetAny(in6_addr{0xff}, 32), Subnet6(in6_addr{}, 32));
    EXPECT_NE(Subnet6(in6_addr{0xff}, 26), SubnetAny(in6_addr{0xff}, 27));
    EXPECT_EQ(SubnetAny(in6_addr{0xff}, 32), Subnet6(in6_addr{0xff}, 32));
    EXPECT_EQ(SubnetAny(in6_addr{0xff}, 32), SubnetAny(in6_addr{0xff}, 32));
    EXPECT_NE(SubnetAny(in6_addr{0xff}, 32), Subnet4(in_addr{0xff}, 32));
    EXPECT_NE(SubnetAny(in_addr{0xff}, 32), Subnet4(in_addr{}, 32));
    EXPECT_NE(Subnet4(in_addr{0xff}, 26), SubnetAny(in_addr{0xff}, 27));
    EXPECT_EQ(SubnetAny(in_addr{0xff}, 32), Subnet4(in_addr{0xff}, 32));
    EXPECT_EQ(SubnetAny(in_addr{0xff}, 32), SubnetAny(in_addr{0xff}, 32));
}

TEST(SubnetAny, Network)
{
    EXPECT_EQ(In6Addr(), SubnetAny(In6Addr(), 128).network());
    EXPECT_EQ(addr6Full, SubnetAny(addr6Full, 128).network());
    EXPECT_EQ(In6Addr(), SubnetAny(addr6Full, 0).network());
    EXPECT_EQ(In4Addr(), SubnetAny(In4Addr(), 32).network());
    EXPECT_EQ(addr4Full, SubnetAny(addr4Full, 32).network());
    EXPECT_EQ(In4Addr(), SubnetAny(addr4Full, 0).network());
}

TEST(SubnetAny, Contains)
{
    EXPECT_TRUE(SubnetAny(addr6Full, 128).contains(addr6Full));
    EXPECT_TRUE(SubnetAny(addr6Full, 128).contains(InAnyAddr{addr6Full}));
    EXPECT_FALSE(SubnetAny(addr6Full, 128).contains(in6_addr{}));
    EXPECT_FALSE(SubnetAny(addr6Full, 128).contains(InAnyAddr(in6_addr{})));
    EXPECT_TRUE(SubnetAny(addr4Full, 32).contains(addr4Full));
    EXPECT_TRUE(SubnetAny(addr4Full, 32).contains(InAnyAddr{addr4Full}));
    EXPECT_FALSE(SubnetAny(addr4Full, 32).contains(in_addr{}));
    EXPECT_FALSE(SubnetAny(addr4Full, 32).contains(InAnyAddr{In4Addr{}}));
}

TEST(SubnetAny, FromStr)
{
    constexpr FromStr<SubnetAny> fs;
    EXPECT_THROW(fs("10"sv), std::invalid_argument);
    EXPECT_THROW(fs("/10"sv), std::invalid_argument);
    EXPECT_THROW(fs("0.0.0.0"sv), std::invalid_argument);
    EXPECT_THROW(fs("0.0.0.0/"sv), std::invalid_argument);
    EXPECT_EQ((SubnetAny{in_addr{}, 0}), fs("0.0.0.0/0"sv));
    EXPECT_EQ((SubnetAny{in_addr{}, 30}), fs("0.0.0.0/30"sv));
    EXPECT_EQ((SubnetAny{in_addr{}, 30}), "0.0.0.0/30"_sub);
    EXPECT_EQ((SubnetAny{in6_addr{}, 80}), fs("::/80"sv));
    EXPECT_EQ((SubnetAny{in6_addr{}, 80}), "::/80"_sub);
}

TEST(SubnetAny, ToStr)
{
    ToStrHandle<ToStr<SubnetAny>> tsh;
    EXPECT_EQ("0.0.0.0/16", tsh(SubnetAny(In4Addr{}, 16)));
    EXPECT_EQ("ff00::/128", tsh(SubnetAny(In6Addr{0xff}, 128)));
    EXPECT_EQ("a 102:304::/32 b",
              fmt::format("a {} b", SubnetAny(In6Addr{1, 2, 3, 4}, 32)));
    EXPECT_EQ("a 102:304::/32 b",
              std::format("a {} b", SubnetAny(In6Addr{1, 2, 3, 4}, 32)));
    EXPECT_EQ("a 1.2.3.4/32 b",
              fmt::format("a {} b", SubnetAny(In4Addr{1, 2, 3, 4}, 32)));
    EXPECT_EQ("a 1.2.3.4/32 b",
              std::format("a {} b", SubnetAny(In4Addr{1, 2, 3, 4}, 32)));
}

TEST(Ops, MaskToPfx)
{
    EXPECT_EQ(32, maskToPfx(In4Addr{0xff, 0xff, 0xff, 0xff}));
    EXPECT_EQ(28, maskToPfx(In4Addr{0xff, 0xff, 0xff, 0xf0}));
    EXPECT_EQ(16, maskToPfx(In4Addr{0xff, 0xff, 0, 0}));
    EXPECT_EQ(0, maskToPfx(In4Addr{}));

    EXPECT_THROW(maskToPfx(In4Addr{0, 0x8}), std::invalid_argument);
    EXPECT_THROW(maskToPfx(In4Addr{0x40}), std::invalid_argument);
}

} // namespace stdplus
