mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 13:57:50 +00:00
Add prototypical support for writing persistent billing classes.
This commit is contained in:
25
server/db.c
25
server/db.c
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -571,6 +571,29 @@ int db_printable_len (s, len)
|
|||||||
return 1;
|
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. */
|
/* Write a spawned class to the database file. */
|
||||||
|
|
||||||
int write_billing_class (class)
|
int write_billing_class (class)
|
||||||
|
Reference in New Issue
Block a user