MCPcopy
hub / github.com/bettercap/bettercap / showLAN

Method showLAN

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

Source from the content-addressed store, hash-verified

176}
177
178func (mod *RestAPI) showLAN(w http.ResponseWriter, r *http.Request) {
179 params := mux.Vars(r)
180 mac := strings.ToLower(params["mac"])
181
182 if mac == "" {
183 mod.toJSON(w, mod.Session.Lan)
184 } else if host, found := mod.Session.Lan.Get(mac); found {
185 mod.toJSON(w, host)
186 } else {
187 http.Error(w, "Not Found", 404)
188 }
189}
190
191func (mod *RestAPI) showOptions(w http.ResponseWriter, r *http.Request) {
192 mod.toJSON(w, mod.Session.Options)

Callers 1

sessionRouteMethod · 0.95

Calls 3

toJSONMethod · 0.95
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected