dhd_linux_pktdump.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Header file for the Packet dump helper functions
  3. *
  4. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  5. *
  6. * Copyright (C) 1999-2020, Broadcom Corporation
  7. *
  8. * Unless you and Broadcom execute a separate written software license
  9. * agreement governing use of this software, this software is licensed to you
  10. * under the terms of the GNU General Public License version 2 (the "GPL"),
  11. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  12. * following added to such license:
  13. *
  14. * As a special exception, the copyright holders of this software give you
  15. * permission to link this software with independent modules, and to copy and
  16. * distribute the resulting executable under terms of your choice, provided that
  17. * you also meet, for each linked independent module, the terms and conditions of
  18. * the license of that module. An independent module is a module which is not
  19. * derived from this software. The special exception does not apply to any
  20. * modifications of the software.
  21. *
  22. * Notwithstanding the above, under no circumstances may you combine this
  23. * software in any way with any other Broadcom software provided under a license
  24. * other than the GPL, without Broadcom's express prior written consent.
  25. *
  26. *
  27. * <<Broadcom-WL-IPTag/Open:>>
  28. *
  29. * $Id: dhd_linux_pktdump.h 717168 2019-06-06 23:11:35Z $
  30. */
  31. #ifndef __DHD_LINUX_PKTDUMP_H_
  32. #define __DHD_LINUX_PKTDUMP_H_
  33. #include <typedefs.h>
  34. #include <dhd.h>
  35. typedef enum {
  36. EAPOL_OTHER = 0,
  37. EAPOL_4WAY_M1,
  38. EAPOL_4WAY_M2,
  39. EAPOL_4WAY_M3,
  40. EAPOL_4WAY_M4,
  41. EAPOL_GROUPKEY_M1,
  42. EAPOL_GROUPKEY_M2
  43. } msg_eapol_t;
  44. typedef enum pkt_cnt_rsn {
  45. PKT_CNT_RSN_INVALID = 0,
  46. PKT_CNT_RSN_ROAM = 1,
  47. PKT_CNT_RSN_GRPKEY_UP = 2,
  48. PKT_CNT_RSN_MAX = 3
  49. } pkt_cnt_rsn_t;
  50. extern msg_eapol_t dhd_is_4way_msg(uint8 *pktdata);
  51. extern void dhd_dump_pkt(dhd_pub_t *dhd, int ifidx, uint8 *pktdata,
  52. uint32 pktlen, bool tx, uint32 *pkthash, uint16 *pktfate);
  53. #ifdef DHD_PKTDUMP_ROAM
  54. extern void dhd_dump_mod_pkt_timer(dhd_pub_t *dhdp, uint16 rsn);
  55. extern void dhd_dump_pkt_init(dhd_pub_t *dhdp);
  56. extern void dhd_dump_pkt_deinit(dhd_pub_t *dhdp);
  57. extern void dhd_dump_pkt_clear(dhd_pub_t *dhdp);
  58. #else
  59. static INLINE void dhd_dump_mod_pkt_timer(dhd_pub_t *dhdp, uint16 rsn) { }
  60. static INLINE void dhd_dump_pkt_init(dhd_pub_t *dhdp) { }
  61. static INLINE void dhd_dump_pkt_deinit(dhd_pub_t *dhdp) { }
  62. static INLINE void dhd_dump_pkt_clear(dhd_pub_t *dhdp) { }
  63. #endif /* DHD_PKTDUMP_ROAM */
  64. /* Rx packet dump */
  65. #ifdef DHD_RX_DUMP
  66. extern void dhd_rx_pkt_dump(dhd_pub_t *dhdp, int ifidx,
  67. uint8 *pktdata, uint32 pktlen);
  68. #else
  69. static INLINE void dhd_rx_pkt_dump(dhd_pub_t *dhdp, int ifidx,
  70. uint8 *pktdata, uint32 pktlen) { }
  71. #endif /* DHD_RX_DUMP */
  72. /* DHCP packet dump */
  73. #ifdef DHD_DHCP_DUMP
  74. extern void dhd_dhcp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
  75. uint32 *pkthash, uint16 *pktfate);
  76. #else
  77. static INLINE void dhd_dhcp_dump(dhd_pub_t *dhdp, int ifidx,
  78. uint8 *pktdata, bool tx, uint32 *pkthash, uint16 *pktfate) { }
  79. #endif /* DHD_DHCP_DUMP */
  80. /* DNS packet dump */
  81. #ifdef DHD_DNS_DUMP
  82. extern void dhd_dns_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
  83. uint32 *pkthash, uint16 *pktfate);
  84. #else
  85. static INLINE void dhd_dns_dump(dhd_pub_t *dhdp, int ifidx,
  86. uint8 *pktdata, bool tx, uint32 *pkthash, uint16 *pktfate) { }
  87. #endif /* DHD_DNS_DUMP */
  88. /* ICMP packet dump */
  89. #ifdef DHD_ICMP_DUMP
  90. extern void dhd_icmp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
  91. uint32 *pkthash, uint16 *pktfate);
  92. #else
  93. static INLINE void dhd_icmp_dump(dhd_pub_t *dhdp, int ifidx,
  94. uint8 *pktdata, bool tx, uint32 *pkthash, uint16 *pktfate) { }
  95. #endif /* DHD_ICMP_DUMP */
  96. /* ARP packet dump */
  97. #ifdef DHD_ARP_DUMP
  98. extern void dhd_arp_dump(dhd_pub_t *dhdp, int ifidx, uint8 *pktdata, bool tx,
  99. uint32 *pkthash, uint16 *pktfate);
  100. #else
  101. static INLINE void dhd_arp_dump(dhd_pub_t *dhdp, int ifidx,
  102. uint8 *pktdata, bool tx, uint32 *pkthash, uint16 *pktfate) { }
  103. #endif /* DHD_ARP_DUMP */
  104. /* 802.1X packet dump */
  105. #ifdef DHD_8021X_DUMP
  106. extern void dhd_dump_eapol_message(dhd_pub_t *dhd, int ifidx,
  107. uint8 *pktdata, uint32 pktlen, bool tx, uint32 *pkthash, uint16 *pktfate);
  108. #else
  109. static INLINE void dhd_dump_eapol_message(dhd_pub_t *dhd, int ifidx,
  110. uint8 *pktdata, uint32 pktlen, bool tx, uint32 *pkthash, uint16 *pktfate) { }
  111. #endif /* DHD_8021X_DUMP */
  112. #endif /* __DHD_LINUX_PKTDUMP_H_ */