blob: e6c4022030ad17f74d6007d44d9fc9231ea01fac [file] [log] [blame]
Arvid Brodinf4214362013-10-30 21:10:47 +01001/* Copyright 2011-2013 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-2013 Arvid Brodin, arvid.brodin@xdin.com
10 */
11
12#ifndef _HSR_FRAMEREG_H
13#define _HSR_FRAMEREG_H
14
15#include "hsr_main.h"
16
17struct node_entry;
18
19struct node_entry *hsr_find_node(struct list_head *node_db, struct sk_buff *skb);
20
21struct node_entry *hsr_merge_node(struct hsr_priv *hsr_priv,
22 struct node_entry *node,
23 struct sk_buff *skb,
24 enum hsr_dev_idx dev_idx);
25
26void hsr_addr_subst_source(struct hsr_priv *hsr_priv, struct sk_buff *skb);
27void hsr_addr_subst_dest(struct hsr_priv *hsr_priv, struct ethhdr *ethhdr,
28 enum hsr_dev_idx dev_idx);
29
30void hsr_register_frame_in(struct node_entry *node, enum hsr_dev_idx dev_idx);
31
32int hsr_register_frame_out(struct node_entry *node, enum hsr_dev_idx dev_idx,
33 struct sk_buff *skb);
34
35void hsr_prune_nodes(struct hsr_priv *hsr_priv);
36
37int hsr_create_self_node(struct list_head *self_node_db,
38 unsigned char addr_a[ETH_ALEN],
39 unsigned char addr_b[ETH_ALEN]);
40
41void *hsr_get_next_node(struct hsr_priv *hsr_priv, void *_pos,
42 unsigned char addr[ETH_ALEN]);
43
44int hsr_get_node_data(struct hsr_priv *hsr_priv,
45 const unsigned char *addr,
46 unsigned char addr_b[ETH_ALEN],
47 unsigned int *addr_b_ifindex,
48 int *if1_age,
49 u16 *if1_seq,
50 int *if2_age,
51 u16 *if2_seq);
52
53#endif /* _HSR_FRAMEREG_H */