1b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden/* 2b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * net/tipc/node_subscr.h: Include file for TIPC "node down" subscription handling 3c43072852649d8382b81237ce51195bcec36f24aYOSHIFUJI Hideaki * 4593a5f22d8035b1396a958b6bbde9f13c0f09549Per Liden * Copyright (c) 1995-2006, Ericsson AB 5f1379173326de4c745c4f610501486e4f3bd9248Allan Stephens * Copyright (c) 2005, 2010-2011, Wind River Systems 6b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * All rights reserved. 7b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * 89ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * Redistribution and use in source and binary forms, with or without 9b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * modification, are permitted provided that the following conditions are met: 10b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * 119ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * 1. Redistributions of source code must retain the above copyright 129ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * notice, this list of conditions and the following disclaimer. 139ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * 2. Redistributions in binary form must reproduce the above copyright 149ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * notice, this list of conditions and the following disclaimer in the 159ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * documentation and/or other materials provided with the distribution. 169ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * 3. Neither the names of the copyright holders nor the names of its 179ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * contributors may be used to endorse or promote products derived from 189ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * this software without specific prior written permission. 19b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * 209ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * Alternatively, this software may be distributed under the terms of the 219ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * GNU General Public License ("GPL") version 2 as published by the Free 229ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * Software Foundation. 239ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * 249ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 259ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 269ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 279ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 289ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 299ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 309ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 319ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 329ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 339ea1fd3c1a15c620d1e3d0aa269d34b705477003Per Liden * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * POSSIBILITY OF SUCH DAMAGE. 35b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden */ 36b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden 37b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden#ifndef _TIPC_NODE_SUBSCR_H 38b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden#define _TIPC_NODE_SUBSCR_H 39b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden 40b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden#include "addr.h" 41b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden 42b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Lidentypedef void (*net_ev_handler) (void *usr_handle); 43b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden 44b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden/** 456c00055a819ce8a6e2c3af2f65d4ea1a8559c491David S. Miller * struct tipc_node_subscr - "node down" subscription entry 46b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * @node: ptr to node structure of interest (or NULL, if none) 47b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * @handle_node_down: routine to invoke when node fails 48b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * @usr_handle: argument to pass to routine when node fails 49b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden * @nodesub_list: adjacent entries in list of subscriptions for the node 50b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden */ 516c00055a819ce8a6e2c3af2f65d4ea1a8559c491David S. Millerstruct tipc_node_subscr { 526c00055a819ce8a6e2c3af2f65d4ea1a8559c491David S. Miller struct tipc_node *node; 53b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden net_ev_handler handle_node_down; 54b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden void *usr_handle; 55b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden struct list_head nodesub_list; 56b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden}; 57b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden 586c00055a819ce8a6e2c3af2f65d4ea1a8559c491David S. Millervoid tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, 594323add67792ced172d0d93b8b2e6187023115f1Per Liden void *usr_handle, net_ev_handler handle_down); 606c00055a819ce8a6e2c3af2f65d4ea1a8559c491David S. Millervoid tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub); 619db9fdd1983eb960182d72f95d77b91b3a5173d0Ying Xuevoid tipc_nodesub_notify(struct list_head *nsub_list); 62b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden 63b97bf3fd8f6a16966d4f18983b2c40993ff937d4Per Liden#endif 64