tipc: move received discovery data evaluation inside node.c
[cascardo/linux.git] / net / tipc / node.h
index 49df0e9..9a97746 100644 (file)
 
 #define INVALID_BEARER_ID -1
 
-/* Node FSM states and events:
- */
-enum {
-       SELF_DOWN_PEER_DOWN    = 0xdd,
-       SELF_UP_PEER_UP        = 0xaa,
-       SELF_DOWN_PEER_LEAVING = 0xd1,
-       SELF_UP_PEER_COMING    = 0xac,
-       SELF_COMING_PEER_UP    = 0xca,
-       SELF_LEAVING_PEER_DOWN = 0x1d,
-};
-
-enum {
-       SELF_ESTABL_CONTACT_EVT = 0xec,
-       SELF_LOST_CONTACT_EVT   = 0x1c,
-       PEER_ESTABL_CONTACT_EVT = 0xfec,
-       PEER_LOST_CONTACT_EVT   = 0xf1c
-};
-
 /* Flags used to take different actions according to flag type
- * TIPC_WAIT_PEER_LINKS_DOWN: wait to see that peer's links are down
- * TIPC_WAIT_OWN_LINKS_DOWN: wait until peer node is declared down
  * TIPC_NOTIFY_NODE_DOWN: notify node is down
  * TIPC_NOTIFY_NODE_UP: notify node is up
  * TIPC_DISTRIBUTE_NAME: publish or withdraw link state name type
@@ -127,6 +107,8 @@ struct tipc_link_entry {
  * @links: array containing references to all links to node
  * @action_flags: bit mask of different types of node actions
  * @bclink: broadcast-related info
+ * @state: connectivity state vs peer node
+ * @sync_point: sequence number where synch/failover is finished
  * @list: links to adjacent nodes in sorted list of cluster's nodes
  * @working_links: number of working links to node (both active and standby)
  * @link_cnt: number of links to node
@@ -150,6 +132,7 @@ struct tipc_node {
        struct tipc_node_bclink bclink;
        struct list_head list;
        int state;
+       u16 sync_point;
        int link_cnt;
        u16 working_links;
        u16 capabilities;
@@ -164,18 +147,15 @@ struct tipc_node {
 
 struct tipc_node *tipc_node_find(struct net *net, u32 addr);
 void tipc_node_put(struct tipc_node *node);
-struct tipc_node *tipc_node_create(struct net *net, u32 addr);
 void tipc_node_stop(struct net *net);
-void tipc_node_check_dest(struct tipc_node *n, struct tipc_bearer *bearer,
-                         bool *link_up, bool *addr_match,
-                         struct tipc_media_addr *maddr);
-bool tipc_node_update_dest(struct tipc_node *n, struct tipc_bearer *bearer,
-                          struct tipc_media_addr *maddr);
+void tipc_node_check_dest(struct net *net, u32 onode,
+                         struct tipc_bearer *bearer,
+                         u16 capabilities, u32 signature,
+                         struct tipc_media_addr *maddr,
+                         bool *respond, bool *dupl_addr);
 void tipc_node_delete_links(struct net *net, int bearer_id);
 void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr);
 void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr);
-void tipc_node_link_down(struct tipc_node *n_ptr, int bearer_id);
-void tipc_node_link_up(struct tipc_node *n_ptr, int bearer_id);
 bool tipc_node_is_up(struct tipc_node *n);
 int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 node,
                           char *linkname, size_t len);