Author: Andres Miller <a1kmm@mware.virtualave.net>
[ircu2.10.12-pk.git] / include / class.h
index fa764953a54f3027b3722b079700f13caea6720d..93ba2bdc424f548bb3ed353466d768b4c7be12b8 100644 (file)
@@ -33,32 +33,33 @@ struct ConfItem;
  * Structures
  */
 struct ConnectionClass {
-  unsigned int conClass;
-  unsigned int conFreq;
-  unsigned int pingFreq;
-  unsigned int maxLinks;
-  unsigned int maxSendq;
-  unsigned int links;
-  struct ConnectionClass *next;
+  struct ConnectionClass* next;
+  char                    *cc_name;
+  unsigned int            max_sendq;
+  short                   ping_freq;
+  short                   conn_freq;
+  short                   max_links;
+  unsigned char           valid;
+  int                     ref_count;
 };
 
 /*
  * Macro's
  */
 
-#define ConClass(x)     ((x)->conClass)
-#define ConFreq(x)      ((x)->conFreq)
-#define PingFreq(x)     ((x)->pingFreq)
-#define MaxLinks(x)     ((x)->maxLinks)
-#define MaxSendq(x)     ((x)->maxSendq)
-#define Links(x)        ((x)->links)
+#define ConClass(x)     ((x)->cc_name)
+#define PingFreq(x)     ((x)->ping_freq)
+#define ConFreq(x)      ((x)->conn_freq)
+#define MaxLinks(x)     ((x)->max_links)
+#define MaxSendq(x)     ((x)->max_sendq)
+#define Links(x)        ((x)->ref_count)
 
-#define ConfLinks(x)    ((x)->confClass->links)
-#define ConfMaxLinks(x) ((x)->confClass->maxLinks)
-#define ConfClass(x)    ((x)->confClass->conClass)
-#define ConfConFreq(x)  ((x)->confClass->conFreq)
-#define ConfPingFreq(x) ((x)->confClass->pingFreq)
-#define ConfSendq(x)    ((x)->confClass->maxSendq)
+#define ConfClass(x)    ((x)->conn_class->cc_name)
+#define ConfPingFreq(x) ((x)->conn_class->ping_freq)
+#define ConfConFreq(x)  ((x)->conn_class->conn_freq)
+#define ConfMaxLinks(x) ((x)->conn_class->max_links)
+#define ConfSendq(x)    ((x)->conn_class->max_sendq)
+#define ConfLinks(x)    ((x)->conn_class->ref_count)
 
 /*
  * Proto types
@@ -70,15 +71,15 @@ extern const struct ConnectionClass* get_class_list(void);
 extern void class_mark_delete(void);
 extern void class_delete_marked(void);
 
-extern struct ConnectionClass *find_class(unsigned int cclass);
+extern struct ConnectionClass *find_class(const char *name);
 extern struct ConnectionClass *make_class(void);
 extern void free_class(struct ConnectionClass * tmp);
 extern unsigned int get_con_freq(struct ConnectionClass * clptr);
 extern unsigned int get_client_ping(struct Client *acptr);
-extern unsigned int get_conf_class(const struct ConfItem *aconf);
-extern unsigned int get_conf_ping(const struct ConfItem *aconf);
-extern unsigned int get_client_class(struct Client *acptr);
-extern void add_class(unsigned int conclass, unsigned int ping,
+extern char *get_conf_class(const struct ConfItem *aconf);
+extern int get_conf_ping(const struct ConfItem *aconf);
+extern char *get_client_class(struct Client *acptr);
+extern void add_class(char *name, unsigned int ping,
                       unsigned int confreq, unsigned int maxli, unsigned int sendq);
 extern void check_class(void);
 extern void report_classes(struct Client *sptr);