head 1.10; access; symbols FSL_1_7_0:1.10 CFG_0_9_11:1.10 FSL_1_6_1:1.10 CFG_0_9_10:1.10 FSL_1_6_0:1.10 FSL_1_6b2:1.10 CFG_0_9_9:1.10 FSL_1_6b1:1.10 CFG_0_9_8:1.10 CFG_0_9_7:1.10 CFG_0_9_6:1.10 CFG_0_9_5:1.5 CFG_0_9_4:1.4 FSL_1_5_0:1.4 FSL_1_5a3:1.4 CFG_0_9_3:1.4 FSL_1_5a2:1.4 FSL_1_5a1:1.4 FSL_1_4_0:1.4 FSL_1_4b1:1.4 CFG_0_9_2:1.4 CFG_0_9_1:1.4 FSL_1_4a1:1.4 FSL_1_3_0:1.4 FSL_1_3b1:1.4 FSL_1_2_1:1.4 FSL_1_2_0:1.4 FSL_1_1_0:1.4 FSL_1_1b1:1.4 FSL_1_0_8:1.4 FSL_1_0_7:1.4 FSL_1_0_6:1.3 FSL_1_0_5:1.3 FSL_1_0_4:1.3 FSL_1_0_3:1.2 FSL_1_0_2:1.1 FSL_1_0_1:1.1 FSL_1_0_0:1.1 FSL_0_9_0:1.1 CFG_0_9_0:1.1 FSL_0_1_12:1.1 FSL_0_1_11:1.1 FSL_0_1_10:1.1; locks; strict; comment @# @; 1.10 date 2004.12.04.12.53.26; author rse; state Exp; branches; next 1.9; 1.9 date 2004.11.29.07.16.10; author rse; state Exp; branches; next 1.8; 1.8 date 2004.11.28.18.59.45; author rse; state Exp; branches; next 1.7; 1.7 date 2004.11.28.17.23.45; author rse; state Exp; branches; next 1.6; 1.6 date 2004.11.28.13.54.13; author rse; state Exp; branches; next 1.5; 1.5 date 2004.11.27.19.44.03; author rse; state Exp; branches; next 1.4; 1.4 date 2002.11.10.12.12.23; author rse; state Exp; branches; next 1.3; 1.3 date 2002.10.05.15.49.23; author rse; state Exp; branches; next 1.2; 1.2 date 2002.08.16.09.45.06; author rse; state Exp; branches; next 1.1; 1.1 date 2002.07.29.11.45.18; author thl; state Exp; branches; next ; desc @@ 1.10 log @done @ text @ _ ___ ____ ____ ____ __ |_|_ _ / _ \/ ___/ ___|| _ \ ___ / _| __ _ _|_||_| | | | \___ \___ \| |_) | / __| |_ / _` | |_||_|_| | |_| |___) |__) | __/ | (__| _| (_| | |_|_|_| \___/|____/____/|_| \___|_| \__, | |___/ OSSP cfg - Configuration Parsing TODO o set node token SRCNAME/SRCPOS for later processing o finish/fix implementation of cfg_node_select() o implement cfg_node_find() o support for prefixes of all non-static symbols to better support embedding o finish cfg.pod manual page (function description!) o add ts-based test suite o cleanup: token vs. option/argument nomenclature CANDO o Problem: \x00 oder \x{00} results in NUL-terminator, so better use ptr+len instead? o optimize internal linkage with an additional "left sibling" pointer? o add line tracking support o add pre-processor with at least includes o add config tree syntax verification! o cfg.tok: in scanner: use atomic symbol/token sub-library to allow first tokens of mostly arbitrary size and then to store the tokens redundancy-free. alternative: replace caStr/cpStr durch yyless/yymore usage?? o named parameters [--]name=value (options)?? o command line query tool (based on cfg_test.c) o optional OSSP ex support o more error checking in scanner? @ 1.9 log @remember that we are still not using the SRCNAME/SRCPOS attributes of nodes @ text @a11 1 o memory leaks due to cfg_buf and cfg_node token allocation? @ 1.8 log @we have to check for memory leaks @ text @d11 1 @ 1.7 log @Replace fixed-size token buffer in scanner by a dynamic buffer (cfg_buf_t). This eliminates the old 1024 size limit on tokens and makes the scanner more robust. @ text @d11 1 @ 1.6 log @cleanup TODO file @ text @d25 3 a27 4 o cfg.tok: in scanner: use an combination of dynamic buffer and atomic symbol/token sub-library to allow first tokens of mostly arbitrary size and then to store the tokens redundancy-free. alternative: replace caStr/cpStr durch yyless/yymore usage?? @ 1.5 log @remember some old points, too @ text @a12 1 o fix internal linkage with "left sibling" pointer d16 6 d24 1 a24 1 o add config tree verification! d28 5 a32 210 o named parameters [--]name=value (options) - token vs. argument nomenclature - arguments/options vs. just token ================================================================================== - Problem: \x00 oder \x{00} wird zu NUL-terminator -> use ptr+len instead - caStr/cpStr durch yyless/yymore?? - syntax verification - command line query tool - error checking in scanner? - OSSP ex support - wieso geht sample.cfg nicht als Arg bei "make check"? - newline in error message $ ./cfg_test sample2.cfg ERROR: quu'> - cfg_t rewrite-uri { } rewrite-uri ^/(.*) /path/$1 --redirect=permanent q{ %{SOURCE} != "x" }; Directory [--foo=A] Argument: - type: - keyword ("foo") via name - option ("--foo=BAR") via name & regex - argument ("foo") via regex - amount: - 1 - 0/1 ? - 0..n * - 1..n + - location: - by position - by name - lookup via: - name - position - regex match foo * bar foo = bar|quux|... foo (bar baz quux) foo ::= bar* ; kleene closure foo ::= bar|baz|quux ; union foo ::= bar baz quux ; concatenation foo ::= {foo;...} ; sequence of ... foo ::= (...) ; grouping foo ::= "bar" ; fixed terminal foo ::= /bar/ ; regex terminal foo ::= ; arbitrary argument foo ::= ; arbitrary option SEQ ::= "{" DIR DIR* "}" DIR ::= TOK (" " TOK)* ";" TOK ::= ... SEQ ::= DIR* SEQ(dir,dir,...) DIR ::= TOK+ DIR(tok,tok,...) TOK ::= string "..." config ::= SEQ(directory|user|rewrite|access) directory ::= DIR("directory",*,) dir_options ::= user ::= DIR("user",/^[a-z]$/) rewrite ::= access ::= "access" ("allow"|"deny"):action SEQ(access_list):acl access_list ::= m/^!?%{ID}$/ acl ::= "acl" TOK:name acl_list acl_list ::= SEQ(acl_entry) acl_entry ::= acl_action "from" net-addr:src "to" net-addr:dst acl_action ::= "allow"|"deny" net_addr ::= net_hostname | net_ipv4addr | net_ipv6addr sequence all { directive --class 1; }; directive --class 1 "foo" { option "bar" --occur=1 }; --------------------------------------------------------------------------- foo on; bar /bla { foo off; baz --fuck { b1; b2 --nase=baer; b3; b4; b5; } --fuck2; }; quux a1 a2 a3 a4; quux; --------------------------------------------------------------------------- sequence ROOT { directive foo; directive bar; directive quux --count=1:oo; }; sequence bar-seq { directive foo --count=0:1; directive baz --count=1:oo; }; directive foo { token - on|off|yes|no; }; directive bar { token path /.*; sequence bar-seq; }; directive baz { option fuck; option fuck2; sequence { directive foo { option nase (baer|hugo); option foo [0-9]; token ip-address; }; }; }; directive quux { token --count=0:oo a.*; }; token ip-address b1|b2|b3|b4|b5; ------------------------------------------------------------------------------- ::= "sequence" ? ; | "sequence" ? ? "{" * "}"; ::= "directive" ? ; | "directive" ? ? "{" ) dir_options ::= d95 1 a95 1 rewrite ::= d101 1 a101 1 acl_entry ::= acl_action "from" net-addr:src "to" net-addr:dst d127 1 a127 1 directive foo; d132 1 a132 1 directive foo --count=0:1; d135 1 a135 1 directive foo { d139 1 a139 1 token path /.*; d142 3 a144 3 directive baz { option fuck; option fuck2; d146 1 a146 1 directive foo { d148 1 a148 1 option foo [0-9]; d185 2 a186 2 opt1 { /.../ opt2=/.../ } { directive { /^token$/ }; d198 1 a198 1 B m/b/ d202 1 a202 1 D m/d/ d205 1 a205 1 } ? @ 1.2 log @we just need a single TODO file here @ text @d20 4 a26 4 - destroy haengt in Endlosschleife - in scanner: use an combination of dynamic buffer and atomic symbol/token sub-library to allow first tokens of mostly arbitrary size and then to store the tokens redundancy-free. @ 1.1 log @embedding @ text @d1 230 a231 1 - add support for prefixes of all non-static symbols to better support embedding @