Start sketching system protocols

This commit is contained in:
Tony Garnock-Jones 2021-11-15 16:15:24 +01:00
parent e4048cfbef
commit 1830249a67
3 changed files with 35 additions and 0 deletions

8
protocols/Makefile Normal file
View File

@ -0,0 +1,8 @@
all: schema-bundle.bin
clean:
rm -f schema-bundle.bin
schema-bundle.bin: schemas/*.prs
preserves-schemac schemas/*.prs > $@.tmp
mv $@.tmp $@

View File

@ -0,0 +1 @@
´³bundle·µ³users-and-groups„´³schema·³version³ definitions·³Spec´³orµµ± userAccount´³lit³user„„µ± systemAccount´³lit³system„„µ±id´³atom³ SignedInteger„„„„³Group´³rec´³lit³grent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³name´³named³name´³atom³String„„„„„„„³Account´³rec´³lit³pwent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³uid´³named³uid´³atom³ SignedInteger„„³home´³named³home´³atom³String„„³info´³named³info´³atom³String„„³name´³named³name´³atom³String„„³shell´³named³shell´³atom³String„„„„„„„³ EnsureGroup´³rec´³lit³ ensure-group„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„³ GroupMember´³rec´³lit³ group-member„´³tupleµ´³named³uid´³atom³ SignedInteger„„´³named³gid´³atom³ SignedInteger„„„„„³ EnsureAccount´³rec´³lit³ensure-account„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„„³ embeddedType€„„„„

View File

@ -0,0 +1,26 @@
version 1 .
Account = <pwent {
name: string,
uid: int,
gid: int,
info: string,
home: string,
shell: string,
}> .
Group = <grent {
name: string,
gid: int,
}> .
GroupMember = <group-member @uid int @gid int> .
EnsureAccount = <ensure-account @name string @spec Spec> .
EnsureGroup = <ensure-group @name string @spec Spec> .
Spec =
/ @userAccount =user
/ @systemAccount =system
/ @id int
.