Commit 719e9000 authored by Jiachen,Chen's avatar Jiachen,Chen

Modified TestArgs

parent a28ad72f
......@@ -44,6 +44,7 @@ int TestArgs::configure(Vector<String>& conf, ErrorHandler* errh) {
IPAddress ip_addr;
EtherAddress src_ether_addr, dst_ether_addr;
Element *tmp_elem_p;
Timestamp interval;
if (Args(conf, this, errh)
.read_mp("INT_VAL", int_val)
......@@ -51,6 +52,7 @@ int TestArgs::configure(Vector<String>& conf, ErrorHandler* errh) {
.read_mp("IP_ADDR", ip_addr)
.read_p("SRC_ETH", src_ether_addr)
.read_p("DST_ETH", dst_ether_addr)
.read_p("INTERVAL", interval)
.read_p("ELEM", ElementArg(), tmp_elem_p)
.complete() < 0) {
return -1;
......@@ -71,6 +73,9 @@ int TestArgs::configure(Vector<String>& conf, ErrorHandler* errh) {
printf("DST_ETH=%s, ", dst_ether_addr.unparse().c_str());
printf("DST_ETH buf=");
print_buf(dst_ether_addr.data(), 6); // this is already big-endian
printf("interval=%s, double_val=%f\n", interval.unparse().c_str(), interval.doubleval());
if (tmp_elem_p != nullptr) {
printf("elem->name: %s\n", tmp_elem_p->class_name());
......
......@@ -2,7 +2,7 @@ require(package "click_for_comnet");
elem::TestArgsElemParam;
test :: TestArgs(1, "string!", 192.168.1.1, SRC_ETH 01:02:03:04:05:06, DST_ETH 16:15:14:13:12:11, ELEM elem);
test :: TestArgs(1, "string!", 192.168.1.1, SRC_ETH 01:02:03:04:05:06, DST_ETH 16:15:14:13:12:11, ELEM elem, INTERVAL 100ms);
TimedSource(INTERVAL 1, DATA "test", LIMIT 1, STOP true)
-> test;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment