From: Ted Lemon Date: Wed, 5 Jul 2000 07:33:25 +0000 (+0000) Subject: Add prototypical support for writing persistent billing classes. X-Git-Tag: V3-BETA-2-PATCH-1~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4346ff54e229f120cfc8989b7c1bb2ef40e8e45c;p=thirdparty%2Fdhcp.git Add prototypical support for writing persistent billing classes. --- diff --git a/server/db.c b/server/db.c index 5a203d637..0b4156c73 100644 --- a/server/db.c +++ b/server/db.c @@ -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)