]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Skeleton for password handling, currently I only build structures and
authorPavel Machek <pavel@ucw.cz>
Wed, 26 May 1999 14:24:57 +0000 (14:24 +0000)
committerPavel Machek <pavel@ucw.cz>
Wed, 26 May 1999 14:24:57 +0000 (14:24 +0000)
do nothing more advanced for them

nest/Makefile
nest/config.Y
nest/password.c [new file with mode: 0644]
nest/password.h [new file with mode: 0644]

index 46bcd1791c81b45c4e62f77e533b8838dbf7485f..d7689e0f6f2ad5812b1018dbdd703ed382d83fc3 100644 (file)
@@ -1,4 +1,4 @@
-source=rt-table.c rt-fib.c rt-attr.c proto.c iface.c rt-dev.c
+source=rt-table.c rt-fib.c rt-attr.c proto.c iface.c rt-dev.c password.c
 root-rel=../
 dir-name=nest
 
index 667f435ce3a64ff1c7cd43890bdcb119e037dae1..c13a6aecc6def2fb42f4891eb144a52f807f1082 100644 (file)
@@ -11,6 +11,7 @@ CF_HDR
 static struct proto_config *this_proto;
 
 #include "nest/rt-dev.h"
+#include "nest/password.h"
 
 void rt_dev_add_iface(char *);
 
@@ -18,10 +19,12 @@ CF_DECLS
 
 CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
 CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE)
+CF_KEYWORDS(PASSWORD, FROM, TO, ID)
 
 %type <i> idval
 %type <f> imexport
 %type <r> rtable
+%type <p> password_list password_begin
 
 CF_GRAMMAR
 
@@ -129,6 +132,32 @@ dev_iface_list:
  | dev_iface_list ',' TEXT { rt_dev_add_iface($3); }
  ;
 
+password_begin: 
+   PASSWORD TEXT {
+     last_password_item = cfg_alloc(sizeof (struct password_item));
+     last_password_item->password = $2;
+     last_password_item->from = 0;
+     last_password_item->to = ~0;
+     last_password_item->id = 0;
+     last_password_item->next = NULL;
+     $$=last_password_item;
+   }
+ ;
+
+password_items:
+   /* empty */ { } 
+ | FROM datetime ';' password_items { last_password_item->from = $2; }
+ | TO datetime ';' password_items { last_password_item->to = $2; }
+ | ID NUM ';' password_items { last_password_item->id = $2; }
+ ;
+
+password_list: 
+   /* empty */ { $$ = NULL; } 
+ | '{' password_begin ';' password_items '}' password_list {
+     last_password_item->next = $6;
+   }
+ ;
+
 CF_CODE
 
 void
diff --git a/nest/password.c b/nest/password.c
new file mode 100644 (file)
index 0000000..ff084b4
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ *     BIRD -- Password handling
+ *
+ *     Copyright 1999 Pavel Machek <pavel@ucw.cz>
+ *
+ *     Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include "nest/bird.h"
+#include "nest/password.h"
+
+struct password_item *last_password_item = NULL;
diff --git a/nest/password.h b/nest/password.h
new file mode 100644 (file)
index 0000000..db2a8bf
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ *     BIRD -- Password handling
+ *
+ *     Copyright 1999 Pavel Machek <pavel@ucw.cz>
+ *
+ *     Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+struct password_item {
+  struct password_item *next;
+  char *password;
+  int id;
+  unsigned int from, to;       /* We really don't care about time before 1970 */
+};
+
+extern struct password_item *last_password_item;