MCPcopy
hub / github.com/bettercap/bettercap / showWiFi

Method showWiFi

modules/api_rest/api_rest_controller.go:203–216  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

201}
202
203func (mod *RestAPI) showWiFi(w http.ResponseWriter, r *http.Request) {
204 params := mux.Vars(r)
205 mac := strings.ToLower(params["mac"])
206
207 if mac == "" {
208 mod.toJSON(w, mod.Session.WiFi)
209 } else if station, found := mod.Session.WiFi.Get(mac); found {
210 mod.toJSON(w, station)
211 } else if client, found := mod.Session.WiFi.GetClient(mac); found {
212 mod.toJSON(w, client)
213 } else {
214 http.Error(w, "Not Found", 404)
215 }
216}
217
218func (mod *RestAPI) runSessionCommand(w http.ResponseWriter, r *http.Request) {
219 var err error

Callers 1

sessionRouteMethod · 0.95

Calls 4

toJSONMethod · 0.95
GetClientMethod · 0.80
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected