blob: 29c1c00e3a0f3dcdb826e0e31c33bde2ceb88dcc [file] [log] [blame]
Frank Blaschka4a71df52008-02-15 09:19:42 +01001/*
Frank Blaschka4a71df52008-02-15 09:19:42 +01002 * Copyright IBM Corp. 2007
3 * Author(s): Utz Bacher <utz.bacher@de.ibm.com>,
4 * Frank Pavlic <fpavlic@de.ibm.com>,
5 * Thomas Spatzier <tspat@de.ibm.com>,
6 * Frank Blaschka <frank.blaschka@de.ibm.com>
7 */
8
9#ifndef __QETH_L3_H__
10#define __QETH_L3_H__
11
12#include "qeth_core.h"
13
Ursula Braun76b11f82010-01-11 02:50:50 +000014#define QETH_SNIFF_AVAIL 0x0008
15
Frank Blaschka4a71df52008-02-15 09:19:42 +010016struct qeth_ipaddr {
17 struct list_head entry;
18 enum qeth_ip_types type;
19 enum qeth_ipa_setdelip_flags set_flags;
20 enum qeth_ipa_setdelip_flags del_flags;
21 int is_multicast;
22 int users;
23 enum qeth_prot_versions proto;
24 unsigned char mac[OSA_ADDR_LEN];
25 union {
26 struct {
27 unsigned int addr;
28 unsigned int mask;
29 } a4;
30 struct {
31 struct in6_addr addr;
32 unsigned int pfxlen;
33 } a6;
34 } u;
35};
36
37struct qeth_ipato_entry {
38 struct list_head entry;
39 enum qeth_prot_versions proto;
40 char addr[16];
41 int mask_bits;
42};
43
44
45void qeth_l3_ipaddr4_to_string(const __u8 *, char *);
46int qeth_l3_string_to_ipaddr4(const char *, __u8 *);
47void qeth_l3_ipaddr6_to_string(const __u8 *, char *);
48int qeth_l3_string_to_ipaddr6(const char *, __u8 *);
49void qeth_l3_ipaddr_to_string(enum qeth_prot_versions, const __u8 *, char *);
50int qeth_l3_string_to_ipaddr(const char *, enum qeth_prot_versions, __u8 *);
51int qeth_l3_create_device_attributes(struct device *);
52void qeth_l3_remove_device_attributes(struct device *);
53int qeth_l3_setrouting_v4(struct qeth_card *);
54int qeth_l3_setrouting_v6(struct qeth_card *);
55int qeth_l3_add_ipato_entry(struct qeth_card *, struct qeth_ipato_entry *);
56void qeth_l3_del_ipato_entry(struct qeth_card *, enum qeth_prot_versions,
57 u8 *, int);
58int qeth_l3_add_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
59void qeth_l3_del_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
60int qeth_l3_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
61void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions,
62 const u8 *);
Klaus-Dieter Wacker62982632010-07-22 23:15:03 +000063int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *, struct qeth_ipaddr *);
Frank Blaschkab3332932011-08-08 01:33:59 +000064struct qeth_ipaddr *qeth_l3_get_addr_buffer(enum qeth_prot_versions);
65int qeth_l3_add_ip(struct qeth_card *, struct qeth_ipaddr *);
66int qeth_l3_delete_ip(struct qeth_card *, struct qeth_ipaddr *);
67void qeth_l3_set_ip_addr_list(struct qeth_card *);
Frank Blaschka4a71df52008-02-15 09:19:42 +010068
69#endif /* __QETH_L3_H__ */