hsr_prp_framereg.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright 2011-2014 Autronica Fire and Security AS
  2. *
  3. * This program is free software; you can redistribute it and/or modify it
  4. * under the terms of the GNU General Public License as published by the Free
  5. * Software Foundation; either version 2 of the License, or (at your option)
  6. * any later version.
  7. *
  8. * Author(s):
  9. * 2011-2014 Arvid Brodin, arvid.brodin@alten.se
  10. */
  11. #ifndef __HSR_PRP_FRAMEREG_H
  12. #define __HSR_PRP_FRAMEREG_H
  13. #include "hsr_prp_main.h"
  14. struct hsr_prp_node;
  15. struct hsr_prp_node *hsr_prp_add_node(struct list_head *node_db,
  16. unsigned char addr[], u16 seq_out,
  17. bool san,
  18. enum hsr_prp_port_type rx_port);
  19. struct hsr_prp_node *hsr_prp_get_node(struct list_head *node_db,
  20. struct sk_buff *skb, bool is_sup,
  21. enum hsr_prp_port_type rx_port);
  22. void hsr_prp_handle_sup_frame(struct sk_buff *skb,
  23. struct hsr_prp_node *node_curr,
  24. struct hsr_prp_port *port);
  25. bool hsr_prp_addr_is_self(struct hsr_prp_priv *priv, unsigned char *addr);
  26. void hsr_addr_subst_source(struct hsr_prp_node *node, struct sk_buff *skb);
  27. void hsr_addr_subst_dest(struct hsr_prp_node *node_src, struct sk_buff *skb,
  28. struct hsr_prp_port *port);
  29. void hsr_register_frame_in(struct hsr_prp_node *node,
  30. struct hsr_prp_port *port, u16 sequence_nr);
  31. int hsr_register_frame_out(struct hsr_prp_port *port,
  32. struct hsr_prp_node *node,
  33. u16 sequence_nr);
  34. void hsr_prp_prune_nodes(unsigned long data);
  35. int hsr_prp_create_self_node(struct list_head *self_node_db,
  36. unsigned char addr_a[ETH_ALEN],
  37. unsigned char addr_b[ETH_ALEN]);
  38. void *hsr_prp_get_next_node(struct hsr_prp_priv *priv, void *_pos,
  39. unsigned char addr[ETH_ALEN]);
  40. int hsr_prp_get_node_data(struct hsr_prp_priv *priv,
  41. const unsigned char *addr,
  42. unsigned char addr_b[ETH_ALEN],
  43. unsigned int *addr_b_ifindex,
  44. int *if1_age, u16 *if1_seq,
  45. int *if2_age, u16 *if2_seq);
  46. struct hsr_prp_node {
  47. struct list_head mac_list;
  48. unsigned char mac_address_a[ETH_ALEN];
  49. unsigned char mac_address_b[ETH_ALEN];
  50. /* Local slave through which AddrB frames are received from this node */
  51. enum hsr_prp_port_type addr_b_port;
  52. u32 cnt_received_a;
  53. u32 cnt_received_b;
  54. u32 cnt_err_wrong_lan_a;
  55. u32 cnt_err_wrong_lan_b;
  56. unsigned long time_in[HSR_PRP_PT_PORTS];
  57. bool time_in_stale[HSR_PRP_PT_PORTS];
  58. /* if the node is a SAN */
  59. bool san_a;
  60. bool san_b;
  61. u16 seq_out[HSR_PRP_PT_PORTS];
  62. struct rcu_head rcu_head;
  63. };
  64. #endif /* __HSR_PRP_FRAMEREG_H */