Skip to content

Commit

Permalink
Merge pull request #2009 from pi-hole/tweak/api_network_info
Browse files Browse the repository at this point in the history
Add netlink implementation
  • Loading branch information
DL6ER authored Jul 23, 2024
2 parents 3b85e10 + f07d902 commit 1381fd0
Show file tree
Hide file tree
Showing 15 changed files with 2,400 additions and 339 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"jetmartin.bats",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"eamodio.gitlens"
"eamodio.gitlens",
"github.copilot",
"ms-python.python"
]
}
},
Expand Down
2 changes: 2 additions & 0 deletions .github/.codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ punycode
bitap
mmapped
dnsmasq
iif
prefered
1 change: 1 addition & 0 deletions src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static struct {
{ "/api/config", "/{element}", api_config, { API_PARSE_JSON, 0 }, true, HTTP_GET },
{ "/api/config", "/{element}/{value}", api_config, { API_PARSE_JSON, 0 }, true, HTTP_DELETE | HTTP_PUT },
{ "/api/network/gateway", "", api_network_gateway, { API_PARSE_JSON, 0 }, true, HTTP_GET },
{ "/api/network/routes", "", api_network_routes, { API_PARSE_JSON, 0 }, true, HTTP_GET },
{ "/api/network/interfaces", "", api_network_interfaces, { API_PARSE_JSON, 0 }, true, HTTP_GET },
{ "/api/network/devices", "", api_network_devices, { API_PARSE_JSON, 0 }, true, HTTP_GET },
{ "/api/network/devices", "/{device_id}", api_network_devices, { API_PARSE_JSON, 0 }, true, HTTP_DELETE },
Expand Down
1 change: 1 addition & 0 deletions src/api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ int api_logs(struct ftl_conn *api);

// Network methods
int api_network_gateway(struct ftl_conn *api);
int api_network_routes(struct ftl_conn *api);
int api_network_interfaces(struct ftl_conn *api);
int api_network_devices(struct ftl_conn *api);
int api_client_suggestions(struct ftl_conn *api);
Expand Down
3 changes: 3 additions & 0 deletions src/api/docs/content/specs/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ paths:
/network/gateway:
$ref: 'network.yaml#/components/paths/gateway'

/network/routes:
$ref: 'network.yaml#/components/paths/routes'

/network/interfaces:
$ref: 'network.yaml#/components/paths/interfaces'

Expand Down
Loading

0 comments on commit 1381fd0

Please sign in to comment.