43 log_fatal (
"Can't allocate check of default collection");
49 log_fatal (
"Can't allocate default check expression");
67 struct class *
class, *nc;
75#if defined (DEBUG_CLASS_MATCHING)
76 log_info (
"checking against class %s...",
class ->
name);
78 memset (&data, 0,
sizeof data);
96#if defined (DEBUG_CLASS_MATCHING)
116 if (status && data.
len) {
117 nc = (
struct class *)0;
118 classfound = class_hash_lookup (&nc,
class ->
hash,
121#ifdef LDAP_CONFIGURATION
122 if (!classfound && find_subclass_in_ldap (
class, &nc, &data))
127#if defined (DEBUG_CLASS_MATCHING)
135 class_dereference (&nc,
MDL);
143#if defined (DEBUG_CLASS_MATCHING)
147 status = class_allocate (&nc,
MDL);
158 sizeof (
struct lease *),
166 class_dereference (&nc,
MDL);
173 sizeof (
struct lease *)));
180 class_hash_add (
class ->
hash,
186 class_dereference (&nc,
MDL);
200 class_reference (&
packet -> classes [
packet -> class_count++],
206 packet -> raw -> chaddr));
212 struct class *cp, *pp;
215 for (pp = 0, cp = lp -> classes; cp; pp = cp, cp = cp ->
nic)
223 class_dereference(
class,
MDL);
228 return ISC_R_NOTFOUND;
239 for (cp = lp -> classes; cp; cp = cp ->
nic)
241 return class_reference (
class, cp,
file,
line);
244 return ISC_R_NOTFOUND;
262 struct lease* refholder = NULL;
270 for (i = 0; i <
class->lease_limit; i++) {
276 lease_reference(&refholder,
lease,
MDL);
281 log_error (
"lease %s unbilled with no billing arrangement.",
286 class->leases_consumed--;
293 lease_dereference(&refholder,
MDL);
303 log_error (
"lease billed with existing billing arrangement.");
307 if (
class -> leases_consumed ==
class -> lease_limit)
310 for (i = 0; i <
class -> lease_limit; i++)
311 if (!
class -> billed_leases [i])
314 if (i ==
class -> lease_limit) {
315 log_error (
"class billing consumption disagrees with leases.");
319 lease_reference (&
class -> billed_leases [i],
lease,
MDL);
320 class_reference (&
lease -> billing_class,
class,
MDL);
321 class -> leases_consumed++;
void classification_setup()
isc_result_t find_class(struct class **class, const char *name, const char *file, int line)
int bill_class(struct lease *lease, struct class *class)
int check_collection(struct packet *packet, struct lease *lease, struct collection *collection)
void classify(struct packet *packet, struct class *class)
isc_result_t unlink_class(struct class **class)
void unbill_class(struct lease *lease)
void classify_client(struct packet *packet)
int expression_allocate(struct expression **cptr, const char *file, int line)
int executable_statement_allocate(struct executable_statement **ptr, const char *file, int line)
struct collection default_collection
struct collection * collections
char * print_hw_addr(int htype, const int hlen, const unsigned char *data) const
void data_string_copy(struct data_string *, const struct data_string *, const char *, int)
struct executable_statement * default_classification_rules
#define PACKET_MAX_CLASSES
void data_string_forget(struct data_string *, const char *, int)
int evaluate_boolean_expression_result(int *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *)
int group_reference(struct group **, struct group *, const char *, int)
int evaluate_data_expression(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *, const char *, int)
void classify(struct packet *, struct class *)
#define print_hex_1(len, data, limit)
int execute_statements(struct binding_value **result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *out_options, struct binding_scope **scope, struct executable_statement *statements, struct on_star *on_star)
const char * piaddr(const struct iaddr addr)
void * dmalloc(size_t, const char *, int)
int log_error(const char *,...) __attribute__((__format__(__printf__
void log_fatal(const char *,...) __attribute__((__format__(__printf__
int int log_info(const char *,...) __attribute__((__format__(__printf__
struct expression * submatch
struct lease ** billed_leases
struct class * superclass
struct data_string hash_string
const unsigned char * data
enum executable_statement::statement_op op
union executable_statement::@336221350347175166011011356261373334214214051201 data
struct class * billing_class
struct option_state * options
struct binding_scope * global_scope