if(oformat) {
snprintf(buf, sizeof(buf), "#%u,%s,%u,%u,%jd", th->group->id, trusts_cidr2str(th->ip, th->mask), th->count, th->maxusage, (intmax_t)th->lastseen);
} else {
- snprintf(buf, sizeof(buf), "%u,%s,%u,%u,%jd,%jd", th->group->id, trusts_cidr2str(th->ip, th->mask), th->id, th->maxusage, (intmax_t)th->lastseen, (intmax_t)th->created);
+ snprintf(buf, sizeof(buf), "%u,%s,%u,%u,%jd,%jd,%u,%u", th->group->id, trusts_cidr2str(th->ip, th->mask), th->id, th->maxusage, (intmax_t)th->lastseen, (intmax_t)th->created, th->maxpernode, th->nodebits);
}
return buf;
int parseth(char *line, trusthost *th, unsigned int *tgid, int oformat) {
unsigned long lastseen, created;
+ int maxpernode, nodebits;
char *ip, xbuf[1024], *id;
/* #id,213.230.192.128/26,20,23,1222732944
return 0;
created = time(NULL);
} else {
- if(sscanf(line, "%u,%u,%lu,%lu", &th->id, &th->maxusage, &lastseen, &created) != 4)
+ if(sscanf(line, "%u,%u,%lu,%lu,%d,%d", &th->id, &th->maxusage, &lastseen, &created, &maxpernode, &nodebits) != 6)
return 0;
}
th->lastseen = (time_t)lastseen;
th->created = (time_t)created;
+ th->maxpernode = maxpernode;
+ th->nodebits = nodebits;
return 1;
}