]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add prototypical support for writing persistent billing classes.
authorTed Lemon <source@isc.org>
Wed, 5 Jul 2000 07:33:25 +0000 (07:33 +0000)
committerTed Lemon <source@isc.org>
Wed, 5 Jul 2000 07:33:25 +0000 (07:33 +0000)
server/db.c

index 5a203d637e5b543b8b7e0c5b5034b3842c34eca7..0b4156c7375c90138e7816907803b220ad546df7 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: db.c,v 1.52 2000/06/06 23:51:16 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: db.c,v 1.53 2000/07/05 07:33:25 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -571,6 +571,29 @@ int db_printable_len (s, len)
        return 1;
 }
 
+void write_named_billing_class (const char *name, unsigned len,
+                               struct class *class)
+{
+       /* XXX billing classes that are modified by OMAPI need
+          XXX to be detected and written out here. */
+}
+
+void write_billing_classes ()
+{
+       struct collection *lp;
+       struct class *cp;
+       struct hash_bucket *bp;
+       int i;
+
+       for (lp = collections; lp; lp = lp -> next) {
+           for (cp = lp -> classes; cp; cp = cp -> nic) {
+               if (cp -> spawning && cp -> hash) {
+                   class_hash_foreach (cp -> hash, write_named_billing_class);
+               }
+           }
+       }
+}
+
 /* Write a spawned class to the database file. */
 
 int write_billing_class (class)