diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2008-05-19 16:27:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-19 16:27:31 -0400 |
commit | e15f880409c807bb589e9492263564e80f0de6e9 (patch) | |
tree | d451964bd4a58a8a5566413db15a44b79227400a /net | |
parent | 236ae64063faf7d3398b4f9a889421b0d27a69d2 (diff) |
tipc: Add support for customized subscription overlap handling
This patch enables TIPC's topology server code to do customized
overlap detection handling on a per-subscription basis. (This
capability is needed to support the upcoming introduction of
multi-cluster TIPC networks.)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/tipc/subscr.c | 4 | ||||
-rw-r--r-- | net/tipc/subscr.h | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index 8f8d0a6c1c16..81e2bd5f2413 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
@@ -157,7 +157,8 @@ void tipc_subscr_report_overlap(struct subscription *sub, | |||
157 | return; | 157 | return; |
158 | if (!must && !(sub->filter & TIPC_SUB_PORTS)) | 158 | if (!must && !(sub->filter & TIPC_SUB_PORTS)) |
159 | return; | 159 | return; |
160 | subscr_send_event(sub, found_lower, found_upper, event, port_ref, node); | 160 | |
161 | sub->event_cb(sub, found_lower, found_upper, event, port_ref, node); | ||
161 | } | 162 | } |
162 | 163 | ||
163 | /** | 164 | /** |
@@ -372,6 +373,7 @@ static void subscr_subscribe(struct tipc_subscr *s, | |||
372 | subscr_terminate(subscriber); | 373 | subscr_terminate(subscriber); |
373 | return; | 374 | return; |
374 | } | 375 | } |
376 | sub->event_cb = subscr_send_event; | ||
375 | memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr)); | 377 | memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr)); |
376 | INIT_LIST_HEAD(&sub->subscription_list); | 378 | INIT_LIST_HEAD(&sub->subscription_list); |
377 | INIT_LIST_HEAD(&sub->nameseq_list); | 379 | INIT_LIST_HEAD(&sub->nameseq_list); |
diff --git a/net/tipc/subscr.h b/net/tipc/subscr.h index 93a8e674fac1..d95536832907 100644 --- a/net/tipc/subscr.h +++ b/net/tipc/subscr.h | |||
@@ -37,11 +37,18 @@ | |||
37 | #ifndef _TIPC_SUBSCR_H | 37 | #ifndef _TIPC_SUBSCR_H |
38 | #define _TIPC_SUBSCR_H | 38 | #define _TIPC_SUBSCR_H |
39 | 39 | ||
40 | struct subscription; | ||
41 | |||
42 | typedef void (*tipc_subscr_event) (struct subscription *sub, | ||
43 | u32 found_lower, u32 found_upper, | ||
44 | u32 event, u32 port_ref, u32 node); | ||
45 | |||
40 | /** | 46 | /** |
41 | * struct subscription - TIPC network topology subscription object | 47 | * struct subscription - TIPC network topology subscription object |
42 | * @seq: name sequence associated with subscription | 48 | * @seq: name sequence associated with subscription |
43 | * @timeout: duration of subscription (in ms) | 49 | * @timeout: duration of subscription (in ms) |
44 | * @filter: event filtering to be done for subscription | 50 | * @filter: event filtering to be done for subscription |
51 | * @event_cb: routine invoked when a subscription event is detected | ||
45 | * @evt: template for events generated by subscription | 52 | * @evt: template for events generated by subscription |
46 | * @subscription_list: adjacent subscriptions in subscriber's subscription list | 53 | * @subscription_list: adjacent subscriptions in subscriber's subscription list |
47 | * @nameseq_list: adjacent subscriptions in name sequence's subscription list | 54 | * @nameseq_list: adjacent subscriptions in name sequence's subscription list |
@@ -53,6 +60,7 @@ struct subscription { | |||
53 | struct tipc_name_seq seq; | 60 | struct tipc_name_seq seq; |
54 | u32 timeout; | 61 | u32 timeout; |
55 | u32 filter; | 62 | u32 filter; |
63 | tipc_subscr_event event_cb; | ||
56 | struct tipc_event evt; | 64 | struct tipc_event evt; |
57 | struct list_head subscription_list; | 65 | struct list_head subscription_list; |
58 | struct list_head nameseq_list; | 66 | struct list_head nameseq_list; |