Dear Elmer,
thanks for your reply. I roughly know how to deal with the port ref in
a callback. My problem is: I'd like to use the subscription service from
a kernel module and monitor the publishing of a certain set of ports.
What I tried (and didn't work) is listed below. The documentation on
subscriptions says that one needs to connect to the subscription service,
so I was looking for a way to do tipc_connect2port (meaning {1, 1}, the
local subscription service).
static int __init subscr_monitor_init(void)
{
struct tipc_name_seq seq;
struct iovec my_iov;
struct tipc_subscr sub;
struct tipc_name subsvc = { TIPC_TOP_SRV, TIPC_TOP_SRV };
u32 port_ref;
int res;
res = tipc_attach(&user_ref, NULL, NULL);
if (res)
return res;
res = tipc_createport(user_ref, NULL, TIPC_LOW_IMPORTANCE,
NULL, NULL, NULL,
msg_event_cb, named_msg_event,
c_named_msg_event_cb,
NULL, &port_ref);
if (res)
return res;
//tipc_connect2port(port_ref, ??);
sub.seq.type = 65;
sub.seq.lower = 0;
sub.seq.upper = 256;
sub.timeout = TIPC_WAIT_FOREVER;
sub.filter = TIPC_SUB_PORTS;
my_iov.iov_base = ⊂
my_iov.iov_len = sizeof(sub);
//res = tipc_send2name(port_ref, &subsvc, tipc_get_addr(), 1, &my_iov);
res = tipc_send2name(port_ref, &subsvc, 0, 1, &my_iov);
return res;
}
I never see anything spit out by the module though I publish ports in the
range that should be monitored :-(
What am I doing wrong?
Best regards,
Erich
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion