2011-06-21 21:42:20 +10:00
|
|
|
|
2015-04-13 16:45:56 +10:00
|
|
|
#include "ip.hpp"
|
2011-06-21 21:42:20 +10:00
|
|
|
|
2015-04-13 16:45:56 +10:00
|
|
|
#include "debug.hpp"
|
|
|
|
#include "platform.hpp"
|
|
|
|
#include "tap.hpp"
|
|
|
|
#include "types.hpp"
|
2011-06-21 21:42:20 +10:00
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2012-04-19 16:54:36 +10:00
|
|
|
main (int, char **) {
|
2011-06-21 21:42:20 +10:00
|
|
|
struct ip_test {
|
|
|
|
const char *str;
|
|
|
|
const ipv4::ip ip;
|
|
|
|
} data [] = {
|
|
|
|
{ "0.0.0.0", { 0, 0, 0, 0 } },
|
|
|
|
{ "255.255.255.255", { 255, 255, 255, 255 } },
|
|
|
|
{ "127.0.0.1", { 127, 0, 0, 1 } }
|
|
|
|
};
|
|
|
|
|
2011-06-23 22:08:31 +10:00
|
|
|
for (unsigned int i = 0; i < elems (data); ++i) {
|
|
|
|
ipv4::ip parsed (ipv4::ip::parse (data[i].str));
|
2015-01-28 14:49:34 +11:00
|
|
|
CHECK (parsed == data[i].ip);
|
2011-06-23 22:08:31 +10:00
|
|
|
}
|
2011-06-21 21:42:20 +10:00
|
|
|
|
2015-04-13 16:45:56 +10:00
|
|
|
util::TAP::logger tap;
|
|
|
|
tap.todo ("convert to TAP");
|
2011-06-21 21:42:20 +10:00
|
|
|
}
|