sep_spc . store word ]
| [ sep_spc . key (/autokey|burst|iburst|noselect|preempt/ |
/prefer|true|dynamic/) ] in
- let cmd = /server|peer|broadcast|manycastclient/
+ let cmd = /pool|server|peer|broadcast|manycastclient/
| /multicastclient|manycastserver/ in
record cmd opt*
kv "broadcastdelay" Rx.decimal
| flags
| simple_setting /driftfile|leapfile|logfile|includefile/
- | simple_setting "statsdir"
+ | simple_setting "statsdir"
+ | simple_setting "ntpsigndsocket"
(* Misc commands, see miscopt.html in ntp docs *)
(* Define restrict *)
let restrict_record =
- let action = [ label "action" . sep_spc . store word ] in
- [ key "restrict" . sep_spc .
- [ label "ipv6" . Util.del_str "-6" . sep_spc ]? .
- store (word - "-6") . action* . eol ]
+ let ip6_restrict = [ label "ipv6" . sep_spc . Util.del_str "-6" ] in
+ let ip4_restrict = [ label "ipv4" . sep_spc . Util.del_str "-4" ] in
+ let action = [ label "action" . sep_spc . store /[^,# \n\t-][^,# \n\t]*/ ] in
+ [ key "restrict" . (ip6_restrict | ip4_restrict)? . sep_spc . store /[^,# \n\t-][^,# \n\t]*/ . action* . eol ]
(* Define statistics *)
let statistics_flag (kw:string) = [ sep_spc . key kw ]
(* Authentication commands, see authopt.html#cmd; incomplete *)
let auth_command =
- [ key /controlkey|keys|keysdir|requestkey/ .
+ [ key /controlkey|keys|keysdir|requestkey|authenticate/ .
sep_spc . store word . eol ]
| [ key /autokey|revoke/ . [sep_spc . store word]? . eol ]
| [ key /trustedkey/ . [ sep_spc . label "key" . store word ]+ . eol ]
let arg = [ key arg_names . sep_spc . store Rx.decimal ] in
[ key "tinker" . (sep_spc . arg)* . eol ]
+ (* tos [beacon beacon | ceiling ceiling | cohort {0 | 1} |
+ floor floor | maxclock maxclock | maxdist maxdist |
+ minclock minclock | mindist mindist | minsane minsane |
+ orphan stratum | orphanwait delay] *)
+
+ let tos =
+ let arg_names = /beacon|ceiling|cohort|floor|maxclock|maxdist|
+ minclock|mindist|minsane|orphan|orphanwait/ in
+ let arg = [ key arg_names . sep_spc . store Rx.decimal ] in
+ [ key "tos" . (sep_spc . arg)* . eol ]
+
+ let interface =
+ let action = [ label "action" . store /listen|ignore|drop/ ]
+ in let addresses = [ label "addresses" . store Rx.word ]
+ in [ key "interface" . sep_spc . action . sep_spc . addresses . eol ]
+
(* Define lens *)
let lns = ( comment | empty | command_record | fudge_record
| restrict_record | simple_settings | statistics_record
| filegen_record | broadcastclient
- | auth_command | tinker )*
+ | auth_command | tinker | tos | interface)*
let filter = (incl "/etc/ntp.conf")
- . Util.stdexcl
let xfm = transform lns filter