legacy counters code removed

This commit is contained in:
z3APA3A committed 2014-04-14 02:14:34 +04:00
1 parent 5543b3052d
commit f4c6c9d962
16 files changed
+3 -483

No files matched your search

-42
View File
@@ -8,12 +8,10 @@
#include "proxy.h"
#ifndef NOPSTDINT
static void pr_unsigned64(struct node *node, CBFUNC cbf, void*cb){
char buf[32];
if(node->value)(*cbf)(cb, buf, sprintf(buf, "%"PRINTF_INT64_MODIFIER"u", *(uint64_t *)node->value));
}
#endif
static void pr_integer(struct node *node, CBFUNC cbf, void*cb){
char buf[16];
@@ -453,7 +451,6 @@ static void * ef_trafcounter_type(struct node * node){
return &((struct trafcount *)node->value) -> type;
}
#ifndef NOPSTDINT
static void * ef_trafcounter_traffic64(struct node * node){
return &((struct trafcount *)node->value) -> traf64;
}
@@ -476,33 +473,6 @@ static void * ef_client_bytesout64(struct node * node){
return &((struct clientparam *)node->value) -> statscli64;
}
#else
static void * ef_trafcounter_traffic(struct node * node){
return &((struct trafcount *)node->value) -> traf;
}
static void * ef_trafcounter_limit(struct node * node){
return &((struct trafcount *)node->value) -> traflim;
}
static void * ef_client_maxtrafin(struct node * node){
return &((struct clientparam *)node->value) -> maxtrafin;
}
static void * ef_client_maxtrafout(struct node * node){
return &((struct clientparam *)node->value) -> maxtrafout;
}
static void * ef_client_bytesin(struct node * node){
return &((struct clientparam *)node->value) -> statssrv;
}
static void * ef_client_bytesout(struct node * node){
return &((struct clientparam *)node->value) -> statscli;
}
#endif
static void * ef_trafcounter_cleared(struct node * node){
return &((struct trafcount *)node->value) -> cleared;
}
@@ -777,13 +747,8 @@ static struct property prop_trafcounter[] = {
{prop_trafcounter + 4, "type", ef_trafcounter_type, TYPE_ROTATION, "rotation type"},
#ifndef NOPSTDINT
{prop_trafcounter + 5, "traffic", ef_trafcounter_traffic64, TYPE_UNSIGNED64, "counter value"},
{prop_trafcounter + 6, "limit", ef_trafcounter_limit64, TYPE_UNSIGNED64, "counter limit"},
#else
{prop_trafcounter + 5, "traffic", ef_trafcounter_traffic, TYPE_TRAFFIC, "counter value"},
{prop_trafcounter + 6, "limit", ef_trafcounter_limit, TYPE_TRAFFIC, "counter limit"},
#endif
{prop_trafcounter + 7, "cleared", ef_trafcounter_cleared, TYPE_DATETIME, "last rotated"},
{prop_trafcounter + 8, "updated", ef_trafcounter_updated, TYPE_DATETIME, "last updated"},
{prop_trafcounter + 9, "comment", ef_trafcounter_comment, TYPE_STRING, "counter comment"},
@@ -835,17 +800,10 @@ static struct property prop_client[] = {
{prop_client + 15, "srvport", ef_client_srvport, TYPE_PORT, "target server port"},
{prop_client + 16, "reqip", ef_client_reqip, TYPE_IP, "requested server ip"},
{prop_client + 17, "reqport", ef_client_reqport, TYPE_PORT, "requested server port"},
#ifndef NOPSTDINT
{prop_client + 18, "bytesin", ef_client_bytesin64, TYPE_UNSIGNED64, "bytes from server to client"},
{prop_client + 19, "bytesout", ef_client_bytesout64, TYPE_UNSIGNED64, "bytes from client to server"},
{prop_client + 20, "maxtrafin", ef_client_maxtrafin64, TYPE_UNSIGNED64, "maximum traffic allowed for download"},
{prop_client + 21, "maxtrafout", ef_client_maxtrafout64, TYPE_UNSIGNED64, "maximum traffic allowed for upload"},
#else
{prop_client + 18, "bytesin", ef_client_bytesin, TYPE_UNSIGNED, "bytes from server to client"},
{prop_client + 19, "bytesout", ef_client_bytesout, TYPE_UNSIGNED, "bytes from client to server"},
{prop_client + 20, "maxtrafin", ef_client_maxtrafin, TYPE_UNSIGNED, "maximum traffic allowed for download"},
{prop_client + 21, "maxtrafout", ef_client_maxtrafout, TYPE_UNSIGNED, "maximum traffic allowed for upload"},
#endif
{prop_client + 22, "pwtype", ef_client_pwtype, TYPE_INTEGER, "type of client password"},
{NULL, "next", ef_client_next, TYPE_CLIENT, "next"}