-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1720 from jrha/nmstate_schema
ncm-network: Move nmstate options to new schema
- Loading branch information
Showing
9 changed files
with
74 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
ncm-network/src/main/pan/components/network/types/network/backend/initscripts.pan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
declaration template components/network/types/network/backend/initscripts; | ||
|
||
@{implement types specific for initscripts / network.pm} | ||
|
||
type structure_network_backend_specific = { | ||
}; | ||
|
||
function network_valid_route = { | ||
if (exists(SELF['prefix']) && exists(SELF['netmask'])) { | ||
error("Use either prefix or netmask as route"); | ||
}; | ||
|
||
if (exists(SELF['prefix'])) { | ||
network_valid_prefix(SELF); | ||
}; | ||
|
||
true; | ||
}; |
24 changes: 24 additions & 0 deletions
24
ncm-network/src/main/pan/components/network/types/network/backend/nmstate.pan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
declaration template components/network/types/network/backend/nmstate; | ||
|
||
@{implement types specific for nmstate / nmstate.pm} | ||
|
||
type structure_network_backend_specific = { | ||
@{let NetworkManager manage the dns} | ||
"manage_dns" : boolean = false | ||
@{let ncm-network cleanup inactive connections} | ||
"clean_inactive_conn" : boolean = true | ||
}; | ||
|
||
function network_valid_route = { | ||
if (exists(SELF['command'])) { | ||
if (length(SELF) != 1) error("Cannot use command and any of the other attributes as route"); | ||
} else { | ||
if (!exists(SELF['address'])) | ||
error("Address is mandatory for route (in absence of command)"); | ||
if (exists(SELF['prefix']) && exists(SELF['netmask'])) | ||
error("Use either prefix or netmask as route"); | ||
}; | ||
|
||
if (exists(SELF['prefix'])) { | ||
network_valid_prefix(SELF); | ||
}; | ||
|
||
true; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters