Core
~~~~
* right usage of DBG vs. debug
+* cleanup debugging calls!
- TOS not supported by kernel -> automatically drop routes with TOS<>0
- use -freg-struct-return ?
- fake multipath?
+- replace all NUM's by expr's
- config file: symbolic constants?
- counters (according to SNMP MIB?)
- generation of subnet mask ICMP's for v6?
- ifdef out some debugging code?
- better memory allocators
- default preferences of protocols: prefer BGP over OSPF/RIP external routes?
-- all internal tables are in host order
- secondary addresses -> subinterfaces
- check if all protocols set proper packet priorities and TTL's.
- Check incoming packets and log errors!!
-- implement snprintf etc. and clean up debugging and logging functions
-
RIP
~~~
OSPF
~~~~
- - Dijkstra: use Fibonacci heaps?
- point-to-point interface with address: advertise as stub network
- static routes: stub networks?
- modes: PtP, PtP-unnumbered, Broadcast, NBMA, point-to-multipoint
%token <s> SYM
%token <t> TEXT
+%type <i> expr
+
+%left '+' '-'
+%left '*' '/' '%'
+
+CF_KEYWORDS(DEFINE)
+
CF_GRAMMAR
+/* Basic config file structure */
+
config: conf_entries END {
return 0;
}
CF_ADDTO(conf, /* EMPTY */)
+/* Expressions */
+
+expr:
+ NUM
+ | expr '+' expr { $$ = $1 + $3; }
+ | expr '-' expr { $$ = $1 - $3; }
+ | expr '*' expr { $$ = $1 * $3; }
+ | expr '/' expr { if ($3) $$ = $1 / $3; else cf_error("Division by zero"); }
+ | expr '%' expr { if ($3) $$ = $1 % $3; else cf_error("Division by zero"); }
+ | '(' expr ')' { $$ = $2; }
+ | SYM { if ($1->class != SYM_NUMBER) cf_error("Number expected"); else $$ = $1->aux; }
+ ;
+
+CF_ADDTO(conf, definition)
+definition:
+ DEFINE SYM '=' expr {
+ if ($2->class != SYM_VOID) cf_error("Symbol already defined");
+ $2->class = SYM_NUMBER;
+ $2->aux = $4;
+ }
+ ;
+
CF_CODE
CF_END