dhd_ip.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Header file describing the common ip parser function.
  3. *
  4. * Provides type definitions and function prototypes used to parse ip packet.
  5. *
  6. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  7. *
  8. * Copyright (C) 1999-2020, Broadcom Corporation
  9. *
  10. * Unless you and Broadcom execute a separate written software license
  11. * agreement governing use of this software, this software is licensed to you
  12. * under the terms of the GNU General Public License version 2 (the "GPL"),
  13. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  14. * following added to such license:
  15. *
  16. * As a special exception, the copyright holders of this software give you
  17. * permission to link this software with independent modules, and to copy and
  18. * distribute the resulting executable under terms of your choice, provided that
  19. * you also meet, for each linked independent module, the terms and conditions of
  20. * the license of that module. An independent module is a module which is not
  21. * derived from this software. The special exception does not apply to any
  22. * modifications of the software.
  23. *
  24. * Notwithstanding the above, under no circumstances may you combine this
  25. * software in any way with any other Broadcom software provided under a license
  26. * other than the GPL, without Broadcom's express prior written consent.
  27. *
  28. *
  29. * <<Broadcom-WL-IPTag/Open:>>
  30. *
  31. * $Id: dhd_ip.h 536854 2015-02-24 13:17:29Z $
  32. */
  33. #ifndef _dhd_ip_h_
  34. #define _dhd_ip_h_
  35. #if defined(DHDTCPACK_SUPPRESS) || defined(DHDTCPSYNC_FLOOD_BLK)
  36. #include <dngl_stats.h>
  37. #include <bcmutils.h>
  38. #include <dhd.h>
  39. #endif /* DHDTCPACK_SUPPRESS || DHDTCPSYNC_FLOOD_BLK */
  40. typedef enum pkt_frag
  41. {
  42. DHD_PKT_FRAG_NONE = 0,
  43. DHD_PKT_FRAG_FIRST,
  44. DHD_PKT_FRAG_CONT,
  45. DHD_PKT_FRAG_LAST
  46. } pkt_frag_t;
  47. extern pkt_frag_t pkt_frag_info(osl_t *osh, void *p);
  48. #ifdef DHDTCPSYNC_FLOOD_BLK
  49. typedef enum tcp_hdr_flags {
  50. FLAG_SYNC,
  51. FLAG_SYNCACK,
  52. FLAG_RST,
  53. FLAG_OTHERS
  54. } tcp_hdr_flag_t;
  55. extern tcp_hdr_flag_t dhd_tcpdata_get_flag(dhd_pub_t *dhdp, void *pkt);
  56. #endif /* DHDTCPSYNC_FLOOD_BLK */
  57. #ifdef DHDTCPACK_SUPPRESS
  58. #define TCPACKSZMIN (ETHER_HDR_LEN + IPV4_MIN_HEADER_LEN + TCP_MIN_HEADER_LEN)
  59. /* Size of MAX possible TCP ACK packet. Extra bytes for IP/TCP option fields */
  60. #define TCPACKSZMAX (TCPACKSZMIN + 100)
  61. /* Max number of TCP streams that have own src/dst IP addrs and TCP ports */
  62. #define TCPACK_INFO_MAXNUM 4
  63. #define TCPDATA_INFO_MAXNUM 4
  64. #define TCPDATA_PSH_INFO_MAXNUM (8 * TCPDATA_INFO_MAXNUM)
  65. #define TCPDATA_INFO_TIMEOUT 5000 /* Remove tcpdata_info if inactive for this time (in ms) */
  66. #define DEFAULT_TCPACK_SUPP_RATIO 3
  67. #ifndef CUSTOM_TCPACK_SUPP_RATIO
  68. #define CUSTOM_TCPACK_SUPP_RATIO DEFAULT_TCPACK_SUPP_RATIO
  69. #endif /* CUSTOM_TCPACK_SUPP_RATIO */
  70. #define DEFAULT_TCPACK_DELAY_TIME 10 /* ms */
  71. #ifndef CUSTOM_TCPACK_DELAY_TIME
  72. #define CUSTOM_TCPACK_DELAY_TIME DEFAULT_TCPACK_DELAY_TIME
  73. #endif /* CUSTOM_TCPACK_DELAY_TIME */
  74. extern int dhd_tcpack_suppress_set(dhd_pub_t *dhdp, uint8 on);
  75. extern void dhd_tcpack_info_tbl_clean(dhd_pub_t *dhdp);
  76. extern int dhd_tcpack_check_xmit(dhd_pub_t *dhdp, void *pkt);
  77. extern bool dhd_tcpack_suppress(dhd_pub_t *dhdp, void *pkt);
  78. extern bool dhd_tcpdata_info_get(dhd_pub_t *dhdp, void *pkt);
  79. extern bool dhd_tcpack_hold(dhd_pub_t *dhdp, void *pkt, int ifidx);
  80. /* #define DHDTCPACK_SUP_DBG */
  81. #if defined(DEBUG_COUNTER) && defined(DHDTCPACK_SUP_DBG)
  82. extern counter_tbl_t tack_tbl;
  83. #endif /* DEBUG_COUNTER && DHDTCPACK_SUP_DBG */
  84. #endif /* DHDTCPACK_SUPPRESS */
  85. #endif /* _dhd_ip_h_ */