Skip to content

Commit

Permalink
ns-api: routes, add readonly flag (#451)
Browse files Browse the repository at this point in the history
The flag is set to true if the route has been generated from
an IPSec tunnel

#450
  • Loading branch information
gsanchietti authored Apr 23, 2024
1 parent 26630f0 commit d98a73d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ns-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,8 @@ IPv4 response example:
"mtu": "1500",
"onlink": "1",
"disabled": "0",
"ns_description": ""
"ns_description": "",
"readonly": true
},
"cfg09c8b4": {
"target": "192.168.4.0/24",
Expand All @@ -1917,7 +1918,8 @@ IPv4 response example:
"mtu": "1500",
"onlink": "0",
"disabled": "1",
"ns_description": ""
"ns_description": "",
"readonly": false
}
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/ns-api/files/ns.routes
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def list_routes(protocol):
route["onlink"] = r.get("onlink", "0")
route["disabled"] = r.get("disabled", "0")
route["ns_description"] = r.get("ns_description", "")
route["readonly"] = r.get("ns_link", "").startswith("ipsec/")
ret["routes"][section] = route

return ret
Expand Down

0 comments on commit d98a73d

Please sign in to comment.