1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright IBM Corp. 2007
4 * Author(s): Utz Bacher <utz.bacher@de.ibm.com>,
5 * Frank Pavlic <fpavlic@de.ibm.com>,
6 * Thomas Spatzier <tspat@de.ibm.com>,
7 * Frank Blaschka <frank.blaschka@de.ibm.com>
13 #include "qeth_core.h"
14 #include <linux/hashtable.h>
16 #define QETH_SNIFF_AVAIL 0x0008
19 struct hlist_node hnode
;
20 enum qeth_ip_types type
;
21 enum qeth_ipa_setdelip_flags set_flags
;
22 enum qeth_ipa_setdelip_flags del_flags
;
27 /* is changed only for normal ip addresses
28 * for non-normal addresses it always is 1
31 enum qeth_prot_versions proto
;
32 unsigned char mac
[ETH_ALEN
];
45 static inline u64
qeth_l3_ipaddr_hash(struct qeth_ipaddr
*addr
)
50 if (addr
->proto
== QETH_PROT_IPV6
) {
51 point
= (u8
*) &addr
->u
.a6
.addr
;
52 ret
= get_unaligned((u64
*)point
) ^
53 get_unaligned((u64
*) (point
+ 8));
55 if (addr
->proto
== QETH_PROT_IPV4
) {
56 point
= (u8
*) &addr
->u
.a4
.addr
;
57 ret
= get_unaligned((u32
*) point
);
62 struct qeth_ipato_entry
{
63 struct list_head entry
;
64 enum qeth_prot_versions proto
;
69 extern const struct attribute_group
*qeth_l3_attr_groups
[];
71 void qeth_l3_ipaddr_to_string(enum qeth_prot_versions
, const __u8
*, char *);
72 int qeth_l3_create_device_attributes(struct device
*);
73 void qeth_l3_remove_device_attributes(struct device
*);
74 int qeth_l3_setrouting_v4(struct qeth_card
*);
75 int qeth_l3_setrouting_v6(struct qeth_card
*);
76 int qeth_l3_add_ipato_entry(struct qeth_card
*, struct qeth_ipato_entry
*);
77 int qeth_l3_del_ipato_entry(struct qeth_card
*card
,
78 enum qeth_prot_versions proto
, u8
*addr
,
80 int qeth_l3_add_vipa(struct qeth_card
*, enum qeth_prot_versions
, const u8
*);
81 int qeth_l3_del_vipa(struct qeth_card
*card
, enum qeth_prot_versions proto
,
83 int qeth_l3_add_rxip(struct qeth_card
*, enum qeth_prot_versions
, const u8
*);
84 int qeth_l3_del_rxip(struct qeth_card
*card
, enum qeth_prot_versions proto
,
86 void qeth_l3_update_ipato(struct qeth_card
*card
);
87 struct qeth_ipaddr
*qeth_l3_get_addr_buffer(enum qeth_prot_versions
);
88 int qeth_l3_add_ip(struct qeth_card
*, struct qeth_ipaddr
*);
89 int qeth_l3_delete_ip(struct qeth_card
*, struct qeth_ipaddr
*);
91 #endif /* __QETH_L3_H__ */