13 // Uso: ./test_ipin ip mtu proto queue_id
15 int main(int argc, char* argv[])
17 IPAddr addr("10.10.10.1");
20 key_t queue_id = DEV_DEFAULT_KEY;
22 addr = IPAddr(argv[1]);
26 proto = atoi(argv[3]);
28 queue_id = atoi(argv[4]);
29 Dev dev(addr, mtu, queue_id);
31 struct msqid_ds minfo;
32 for (msgctl(dev.que_id, IPC_STAT, &minfo); minfo.msg_qnum;
33 msgctl(dev.que_id, IPC_STAT, &minfo))
36 std::cout << "Quedan " << minfo.msg_qnum << " mensajes en la cola\n";
37 std::string s = ipin.recv(proto, src, dst);
38 std::cout << "Recibido '" << s << "' (len " << s.size() << ") de "
39 << src << " para " << dst << " (proto = " << proto << ")\n";
44 // vim: set et sw=4 sts=4 :