qeth_l3.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * 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. #ifndef __QETH_L3_H__
  9. #define __QETH_L3_H__
  10. #include "qeth_core.h"
  11. #define QETH_SNIFF_AVAIL 0x0008
  12. struct qeth_ipaddr {
  13. struct list_head entry;
  14. enum qeth_ip_types type;
  15. enum qeth_ipa_setdelip_flags set_flags;
  16. enum qeth_ipa_setdelip_flags del_flags;
  17. int is_multicast;
  18. int users;
  19. enum qeth_prot_versions proto;
  20. unsigned char mac[OSA_ADDR_LEN];
  21. union {
  22. struct {
  23. unsigned int addr;
  24. unsigned int mask;
  25. } a4;
  26. struct {
  27. struct in6_addr addr;
  28. unsigned int pfxlen;
  29. } a6;
  30. } u;
  31. };
  32. struct qeth_ipato_entry {
  33. struct list_head entry;
  34. enum qeth_prot_versions proto;
  35. char addr[16];
  36. int mask_bits;
  37. };
  38. void qeth_l3_ipaddr_to_string(enum qeth_prot_versions, const __u8 *, char *);
  39. int qeth_l3_string_to_ipaddr(const char *, enum qeth_prot_versions, __u8 *);
  40. int qeth_l3_create_device_attributes(struct device *);
  41. void qeth_l3_remove_device_attributes(struct device *);
  42. int qeth_l3_setrouting_v4(struct qeth_card *);
  43. int qeth_l3_setrouting_v6(struct qeth_card *);
  44. int qeth_l3_add_ipato_entry(struct qeth_card *, struct qeth_ipato_entry *);
  45. void qeth_l3_del_ipato_entry(struct qeth_card *, enum qeth_prot_versions,
  46. u8 *, int);
  47. int qeth_l3_add_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
  48. void qeth_l3_del_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
  49. int qeth_l3_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
  50. void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions,
  51. const u8 *);
  52. int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *, struct qeth_ipaddr *);
  53. struct qeth_ipaddr *qeth_l3_get_addr_buffer(enum qeth_prot_versions);
  54. int qeth_l3_add_ip(struct qeth_card *, struct qeth_ipaddr *);
  55. int qeth_l3_delete_ip(struct qeth_card *, struct qeth_ipaddr *);
  56. void qeth_l3_set_ip_addr_list(struct qeth_card *);
  57. #endif /* __QETH_L3_H__ */