qeth_l3.h 2.2 KB

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