460-disable_ctrl_iface_mib.patch 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. --- a/hostapd/Makefile
  2. +++ b/hostapd/Makefile
  3. @@ -128,6 +128,9 @@ endif
  4. ifdef CONFIG_NO_CTRL_IFACE
  5. CFLAGS += -DCONFIG_NO_CTRL_IFACE
  6. else
  7. +ifdef CONFIG_CTRL_IFACE_MIB
  8. +CFLAGS += -DCONFIG_CTRL_IFACE_MIB
  9. +endif
  10. OBJS += ctrl_iface.o
  11. OBJS += ../src/ap/ctrl_iface_ap.o
  12. endif
  13. --- a/hostapd/ctrl_iface.c
  14. +++ b/hostapd/ctrl_iface.c
  15. @@ -743,6 +743,7 @@ static void hostapd_ctrl_iface_receive(i
  16. } else if (os_strncmp(buf, "RELOG", 5) == 0) {
  17. if (wpa_debug_reopen_file() < 0)
  18. reply_len = -1;
  19. +#ifdef CONFIG_CTRL_IFACE_MIB
  20. } else if (os_strcmp(buf, "MIB") == 0) {
  21. reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
  22. if (reply_len >= 0) {
  23. @@ -772,10 +773,12 @@ static void hostapd_ctrl_iface_receive(i
  24. reply_len += res;
  25. }
  26. #endif /* CONFIG_NO_RADIUS */
  27. +#endif
  28. } else if (os_strcmp(buf, "DOWN") == 0) {
  29. hostapd_ctrl_iface_set_down(hapd);
  30. } else if (os_strncmp(buf, "RELOAD ", 7) == 0) {
  31. hostapd_ctrl_iface_reload(hapd, buf + 7);
  32. +#ifdef CONFIG_CTRL_IFACE_MIB
  33. } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  34. reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
  35. reply_size);
  36. @@ -785,6 +788,7 @@ static void hostapd_ctrl_iface_receive(i
  37. } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  38. reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
  39. reply_size);
  40. +#endif
  41. } else if (os_strcmp(buf, "ATTACH") == 0) {
  42. if (hostapd_ctrl_iface_attach(hapd, &from, fromlen))
  43. reply_len = -1;
  44. --- a/wpa_supplicant/Makefile
  45. +++ b/wpa_supplicant/Makefile
  46. @@ -719,6 +719,9 @@ ifdef CONFIG_IEEE80211N
  47. OBJS += ../src/ap/ieee802_11_ht.o
  48. endif
  49. ifdef CONFIG_CTRL_IFACE
  50. +ifdef CONFIG_CTRL_IFACE_MIB
  51. +CFLAGS += -DCONFIG_CTRL_IFACE_MIB
  52. +endif
  53. OBJS += ../src/ap/ctrl_iface_ap.o
  54. endif
  55. --- a/wpa_supplicant/ctrl_iface.c
  56. +++ b/wpa_supplicant/ctrl_iface.c
  57. @@ -3770,6 +3770,7 @@ char * wpa_supplicant_ctrl_iface_process
  58. reply_len = -1;
  59. } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
  60. wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
  61. +#ifdef CONFIG_CTRL_IFACE_MIB
  62. } else if (os_strcmp(buf, "MIB") == 0) {
  63. reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
  64. if (reply_len >= 0) {
  65. @@ -3781,6 +3782,7 @@ char * wpa_supplicant_ctrl_iface_process
  66. else
  67. reply_len += res;
  68. }
  69. +#endif
  70. } else if (os_strncmp(buf, "STATUS", 6) == 0) {
  71. reply_len = wpa_supplicant_ctrl_iface_status(
  72. wpa_s, buf + 6, reply, reply_size);
  73. @@ -4135,6 +4137,7 @@ char * wpa_supplicant_ctrl_iface_process
  74. reply_len = wpa_supplicant_ctrl_iface_bss(
  75. wpa_s, buf + 4, reply, reply_size);
  76. #ifdef CONFIG_AP
  77. +#ifdef CONFIG_CTRL_IFACE_MIB
  78. } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  79. reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
  80. } else if (os_strncmp(buf, "STA ", 4) == 0) {
  81. @@ -4143,6 +4146,7 @@ char * wpa_supplicant_ctrl_iface_process
  82. } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  83. reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
  84. reply_size);
  85. +#endif
  86. } else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
  87. if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
  88. reply_len = -1;
  89. --- a/src/ap/ctrl_iface_ap.c
  90. +++ b/src/ap/ctrl_iface_ap.c
  91. @@ -20,6 +20,7 @@
  92. #include "ctrl_iface_ap.h"
  93. #include "ap_drv_ops.h"
  94. +#ifdef CONFIG_CTRL_IFACE_MIB
  95. static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
  96. struct sta_info *sta,
  97. @@ -103,6 +104,7 @@ int hostapd_ctrl_iface_sta_next(struct h
  98. return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
  99. }
  100. +#endif
  101. #ifdef CONFIG_P2P_MANAGER
  102. static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
  103. @@ -269,3 +271,4 @@ int hostapd_ctrl_iface_disassociate(stru
  104. return 0;
  105. }
  106. +
  107. --- a/src/ap/ieee802_1x.c
  108. +++ b/src/ap/ieee802_1x.c
  109. @@ -1922,6 +1922,7 @@ static const char * bool_txt(Boolean boo
  110. return bool ? "TRUE" : "FALSE";
  111. }
  112. +#ifdef CONFIG_CTRL_IFACE_MIB
  113. int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
  114. {
  115. @@ -2074,6 +2075,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  116. return len;
  117. }
  118. +#endif
  119. static void ieee802_1x_finished(struct hostapd_data *hapd,
  120. struct sta_info *sta, int success)
  121. --- a/src/ap/wpa_auth.c
  122. +++ b/src/ap/wpa_auth.c
  123. @@ -2638,6 +2638,7 @@ static int wpa_cipher_bits(int cipher)
  124. }
  125. }
  126. +#ifdef CONFIG_CTRL_IFACE_MIB
  127. #define RSN_SUITE "%02x-%02x-%02x-%d"
  128. #define RSN_SUITE_ARG(s) \
  129. @@ -2801,7 +2802,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  130. return len;
  131. }
  132. -
  133. +#endif
  134. void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
  135. {
  136. --- a/src/rsn_supp/wpa.c
  137. +++ b/src/rsn_supp/wpa.c
  138. @@ -1918,6 +1918,8 @@ static u32 wpa_cipher_suite(struct wpa_s
  139. }
  140. +#ifdef CONFIG_CTRL_IFACE_MIB
  141. +
  142. #define RSN_SUITE "%02x-%02x-%02x-%d"
  143. #define RSN_SUITE_ARG(s) \
  144. ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
  145. @@ -1997,6 +1999,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  146. return (int) len;
  147. }
  148. +#endif
  149. #endif /* CONFIG_CTRL_IFACE */