diff --git a/API.md b/API.md new file mode 100644 index 0000000..ea90f92 --- /dev/null +++ b/API.md @@ -0,0 +1,65 @@ +Work in progress... +``` + http.HandleFunc("/hooks/counters", counters_hook) + http.HandleFunc("/hooks/radattr", radattr_hook) + http.HandleFunc("/hooks/ping", ping_hook) + http.HandleFunc("/hooks/proc_data", proc_hook) + http.HandleFunc("/hooks/sessions", sessions_hook) + http.HandleFunc("/hooks/tcpdump", tcpdump_hook) + http.HandleFunc("/hooks/diag_counters", diag_counters_hook) + // /shaper/download - retrieve /etc/config.json + // /shaper/upload - upload /etc/config.json + http.HandleFunc("/shaper/download", shaper_download_hook) + http.HandleFunc("/shaper/upload", shaper_upload_hook) + http.HandleFunc("/accel/vlans", accel_vlans_hook) + // returns interface, ip, username + http.HandleFunc("/ppp/list", ppp_data_hook) + http.HandleFunc("/", unknown) +``` + +Availaible hooks: + +TC: + +* http://x.x.x.x/hooks/counters?iface=&source=tc&type=qdisc&format=json +* http://x.x.x.x/hooks/counters?iface=&source=tc&type=class&format=json +* http://x.x.x.x/hooks/counters?iface=&source=tc&type=filter&format=json + +IP: + +* http://x.x.x.x/hooks/counters?iface=&source=ip&type=link&format=json +* http://x.x.x.x/hooks/counters?iface=&source=ip&type=addr&format=json + +ETHTOOL: + +* http://x.x.x.x/hooks/counters?iface=&source=ethtool&type=statistics&format=json +* http://x.x.x.x/hooks/counters?iface=&source=ethtool&type=module&format=json + +RADIUS ATTRIBUTES + +* http://x.x.x.x/hooks/radattr?iface= + +TRAFFIC DUMP + +* http://x.x.x.x/hooks/traffic_dump?iface= + +PING + +* http://x.x.x.x/hooks/ping?iface=&ip= + +PROC FS DATA + +* http://x.x.x.x/hooks/proc_data?type=vlans +* http://x.x.x.x/hooks/proc_data?type=pppoe +* http://x.x.x.x/hooks/proc_data?type=vlan&iface= + +SESSIONS + +# Show all sessions +* http://x.x.x.x/hooks/sessions +# Show selected user session +* http://x.x.x.x/hooks/sessions?username= +# Show defined fields (ifname,username,inbound-if,service-name) +* http://x.x.x.x/hooks/sessions?view=optimal + +