#include <fmt/format.h>

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

#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)));
}

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)));
}

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 1.2.3.4/32 b",
              fmt::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
