mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 05:36:24 +00:00
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>
This commit is contained in:
parent
236ae64063
commit
e15f880409
2 changed files with 11 additions and 1 deletions
|
@ -157,7 +157,8 @@ void tipc_subscr_report_overlap(struct subscription *sub,
|
||||||
return;
|
return;
|
||||||
if (!must && !(sub->filter & TIPC_SUB_PORTS))
|
if (!must && !(sub->filter & TIPC_SUB_PORTS))
|
||||||
return;
|
return;
|
||||||
subscr_send_event(sub, found_lower, found_upper, event, port_ref, node);
|
|
||||||
|
sub->event_cb(sub, found_lower, found_upper, event, port_ref, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -372,6 +373,7 @@ static void subscr_subscribe(struct tipc_subscr *s,
|
||||||
subscr_terminate(subscriber);
|
subscr_terminate(subscriber);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
sub->event_cb = subscr_send_event;
|
||||||
memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr));
|
memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr));
|
||||||
INIT_LIST_HEAD(&sub->subscription_list);
|
INIT_LIST_HEAD(&sub->subscription_list);
|
||||||
INIT_LIST_HEAD(&sub->nameseq_list);
|
INIT_LIST_HEAD(&sub->nameseq_list);
|
||||||
|
|
|
@ -37,11 +37,18 @@
|
||||||
#ifndef _TIPC_SUBSCR_H
|
#ifndef _TIPC_SUBSCR_H
|
||||||
#define _TIPC_SUBSCR_H
|
#define _TIPC_SUBSCR_H
|
||||||
|
|
||||||
|
struct subscription;
|
||||||
|
|
||||||
|
typedef void (*tipc_subscr_event) (struct subscription *sub,
|
||||||
|
u32 found_lower, u32 found_upper,
|
||||||
|
u32 event, u32 port_ref, u32 node);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct subscription - TIPC network topology subscription object
|
* struct subscription - TIPC network topology subscription object
|
||||||
* @seq: name sequence associated with subscription
|
* @seq: name sequence associated with subscription
|
||||||
* @timeout: duration of subscription (in ms)
|
* @timeout: duration of subscription (in ms)
|
||||||
* @filter: event filtering to be done for subscription
|
* @filter: event filtering to be done for subscription
|
||||||
|
* @event_cb: routine invoked when a subscription event is detected
|
||||||
* @evt: template for events generated by subscription
|
* @evt: template for events generated by subscription
|
||||||
* @subscription_list: adjacent subscriptions in subscriber's subscription list
|
* @subscription_list: adjacent subscriptions in subscriber's subscription list
|
||||||
* @nameseq_list: adjacent subscriptions in name sequence's subscription list
|
* @nameseq_list: adjacent subscriptions in name sequence's subscription list
|
||||||
|
@ -53,6 +60,7 @@ struct subscription {
|
||||||
struct tipc_name_seq seq;
|
struct tipc_name_seq seq;
|
||||||
u32 timeout;
|
u32 timeout;
|
||||||
u32 filter;
|
u32 filter;
|
||||||
|
tipc_subscr_event event_cb;
|
||||||
struct tipc_event evt;
|
struct tipc_event evt;
|
||||||
struct list_head subscription_list;
|
struct list_head subscription_list;
|
||||||
struct list_head nameseq_list;
|
struct list_head nameseq_list;
|
||||||
|
|
Loading…
Reference in a new issue