diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/registries.m | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
Diffstat (limited to 'module/registries.m')
| -rw-r--r-- | module/registries.m | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/module/registries.m b/module/registries.m new file mode 100644 index 00000000..5aaa53f4 --- /dev/null +++ b/module/registries.m @@ -0,0 +1,44 @@ +Registries: module { + PATH: con "/dis/lib/registries.dis"; + init: fn(); + + Attributes: adt { + attrs: list of (string, string); + + get: fn(a: self ref Attributes, attr: string): string; + set: fn(a: self ref Attributes, attr, val: string); + new: fn(attrs: list of (string, string)): ref Attributes; + }; + + Attached: adt { + fd: ref Sys->FD; + signerpkhash: string; + localuser: string; + remoteuser: string; + }; + + Service: adt { + addr: string; # dial this to connect to the service. + attrs: ref Attributes; # information about the nature of the service. + + attach: fn(s: self ref Service, user: string, keydir: string): ref Attached; + }; + + Registered: adt { + addr: string; + reg: ref Registry; + fd: ref Sys->FD; + }; + + Registry: adt { + dir: string; + indexfd: ref Sys->FD; + + new: fn(dir: string): ref Registry; + connect: fn(svc: ref Service, user: string, keydir: string): ref Registry; + services: fn(r: self ref Registry): (list of ref Service, string); + find: fn(r: self ref Registry, a: list of (string, string)): (list of ref Service, string); + register: fn(r: self ref Registry, addr: string, attrs: ref Attributes, persist: int): (ref Registered, string); + unregister: fn(r: self ref Registry, addr: string): string; + }; +}; |
