packages: sort network related packages into package/network/
[openwrt.git] / package / network / services / hostapd / patches / 460-disable_ctrl_iface_mib.patch
1 --- a/hostapd/Makefile
2 +++ b/hostapd/Makefile
3 @@ -135,6 +135,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 @@ -899,6 +899,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 @@ -928,10 +929,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, "UPDATE ", 7) == 0) {
31                 hostapd_ctrl_iface_update(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 @@ -941,6 +944,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 @@ -751,6 +751,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  
56 --- a/wpa_supplicant/ctrl_iface.c
57 +++ b/wpa_supplicant/ctrl_iface.c
58 @@ -4382,6 +4382,7 @@ char * wpa_supplicant_ctrl_iface_process
59                         reply_len = -1;
60         } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
61                 wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
62 +#ifdef CONFIG_CTRL_IFACE_MIB
63         } else if (os_strcmp(buf, "MIB") == 0) {
64                 reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
65                 if (reply_len >= 0) {
66 @@ -4393,6 +4394,7 @@ char * wpa_supplicant_ctrl_iface_process
67                         else
68                                 reply_len += res;
69                 }
70 +#endif
71         } else if (os_strncmp(buf, "STATUS", 6) == 0) {
72                 reply_len = wpa_supplicant_ctrl_iface_status(
73                         wpa_s, buf + 6, reply, reply_size);
74 @@ -4792,6 +4794,7 @@ char * wpa_supplicant_ctrl_iface_process
75                 reply_len = wpa_supplicant_ctrl_iface_bss(
76                         wpa_s, buf + 4, reply, reply_size);
77  #ifdef CONFIG_AP
78 +#ifdef CONFIG_CTRL_IFACE_MIB
79         } else if (os_strcmp(buf, "STA-FIRST") == 0) {
80                 reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
81         } else if (os_strncmp(buf, "STA ", 4) == 0) {
82 @@ -4800,6 +4803,7 @@ char * wpa_supplicant_ctrl_iface_process
83         } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
84                 reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
85                                                    reply_size);
86 +#endif
87         } else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
88                 if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
89                         reply_len = -1;
90 --- a/src/ap/ctrl_iface_ap.c
91 +++ b/src/ap/ctrl_iface_ap.c
92 @@ -20,6 +20,7 @@
93  #include "ctrl_iface_ap.h"
94  #include "ap_drv_ops.h"
95  
96 +#ifdef CONFIG_CTRL_IFACE_MIB
97  
98  static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
99                                       struct sta_info *sta,
100 @@ -103,6 +104,7 @@ int hostapd_ctrl_iface_sta_next(struct h
101         return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
102  }
103  
104 +#endif
105  
106  #ifdef CONFIG_P2P_MANAGER
107  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
108 @@ -269,3 +271,4 @@ int hostapd_ctrl_iface_disassociate(stru
109  
110         return 0;
111  }
112 +
113 --- a/src/ap/ieee802_1x.c
114 +++ b/src/ap/ieee802_1x.c
115 @@ -2034,6 +2034,7 @@ static const char * bool_txt(Boolean boo
116         return bool ? "TRUE" : "FALSE";
117  }
118  
119 +#ifdef CONFIG_CTRL_IFACE_MIB
120  
121  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
122  {
123 @@ -2186,6 +2187,7 @@ int ieee802_1x_get_mib_sta(struct hostap
124         return len;
125  }
126  
127 +#endif
128  
129  static void ieee802_1x_finished(struct hostapd_data *hapd,
130                                 struct sta_info *sta, int success)
131 --- a/src/ap/wpa_auth.c
132 +++ b/src/ap/wpa_auth.c
133 @@ -2729,6 +2729,7 @@ static const char * wpa_bool_txt(int boo
134         return bool ? "TRUE" : "FALSE";
135  }
136  
137 +#ifdef CONFIG_CTRL_IFACE_MIB
138  
139  #define RSN_SUITE "%02x-%02x-%02x-%d"
140  #define RSN_SUITE_ARG(s) \
141 @@ -2873,7 +2874,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
142  
143         return len;
144  }
145 -
146 +#endif
147  
148  void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
149  {
150 --- a/src/rsn_supp/wpa.c
151 +++ b/src/rsn_supp/wpa.c
152 @@ -1844,6 +1844,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
153  }
154  
155  
156 +#ifdef CONFIG_CTRL_IFACE_MIB
157 +
158  #define RSN_SUITE "%02x-%02x-%02x-%d"
159  #define RSN_SUITE_ARG(s) \
160  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
161 @@ -1927,6 +1929,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
162  
163         return (int) len;
164  }
165 +#endif
166  #endif /* CONFIG_CTRL_IFACE */
167  
168