"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dbshow.c" between
vnstat-2.7.tar.gz and vnstat-2.8.tar.gz

About: vnStat is a console-based network traffic monitor (using the /proc filesystem).

dbshow.c  (vnstat-2.7):dbshow.c  (vnstat-2.8)
skipping to change at line 167 skipping to change at line 167
printf("%s%s", fieldseparator, gettraffic rate(datalist_i->rx + datalist_i->tx, mosecs(datalist_i->timestamp, interface->u pdated), 14)); printf("%s%s", fieldseparator, gettraffic rate(datalist_i->rx + datalist_i->tx, mosecs(datalist_i->timestamp, interface->u pdated), 14));
} }
} else if (!shortmode) { } else if (!shortmode) {
printf(" | %s", gettrafficrate(datalist_i->rx + d atalist_i->tx, dmonth(d->tm_mon) * 86400, 14)); printf(" | %s", gettrafficrate(datalist_i->rx + d atalist_i->tx, dmonth(d->tm_mon) * 86400, 14));
} }
} }
printf("\n"); printf("\n");
datalist_i = datalist_i->next; datalist_i = datalist_i->next;
} }
if (!datalist) {
indent(5 + 27);
printf("no data available\n");
}
if (!shortmode) { if (!shortmode) {
indent(5); indent(5);
if (cfg.ostyle >= 2) { if (cfg.ostyle >= 2) {
printf("------------------------+-------------+---------- ---+---------------\n"); printf("------------------------+-------------+---------- ---+---------------\n");
} else { } else {
printf("------------------------+-------------+---------- --\n"); printf("------------------------+-------------+---------- --\n");
} }
indent(5); indent(5);
printf("estimated %s", getvalue(e_rx, 11, RT_Estimate)); printf("estimated %s", getvalue(e_rx, 11, RT_Estimate));
printf(" | %s", getvalue(e_tx, 11, RT_Estimate)); printf(" | %s", getvalue(e_tx, 11, RT_Estimate));
skipping to change at line 256 skipping to change at line 261
} }
} else if (!shortmode) { } else if (!shortmode) {
printf(" | %s", gettrafficrate(datalist_i->rx + d atalist_i->tx, 86400, 14)); printf(" | %s", gettrafficrate(datalist_i->rx + d atalist_i->tx, 86400, 14));
} }
} }
printf("\n"); printf("\n");
datalist_i = datalist_i->next; datalist_i = datalist_i->next;
} }
if (!shortmode) { if (!shortmode) {
if (!datalist) {
indent(5 + 27);
printf("no data available\n");
}
indent(5); indent(5);
if (cfg.ostyle >= 2) { if (cfg.ostyle >= 2) {
printf("------------------------+-------------+---------- ---+---------------\n"); printf("------------------------+-------------+---------- ---+---------------\n");
} else { } else {
printf("------------------------+-------------+---------- --\n"); printf("------------------------+-------------+---------- --\n");
} }
indent(5); indent(5);
printf("estimated %s", getvalue(e_rx, 11, RT_Estimate)); printf("estimated %s", getvalue(e_rx, 11, RT_Estimate));
printf(" | %s", getvalue(e_tx, 11, RT_Estimate)); printf(" | %s", getvalue(e_tx, 11, RT_Estimate));
printf(" | %s", getvalue(e_rx + e_tx, 11, RT_Estimate)); printf(" | %s", getvalue(e_rx + e_tx, 11, RT_Estimate));
skipping to change at line 342 skipping to change at line 351
} else { } else {
return; return;
} }
if (limit < 0) { if (limit < 0) {
limit = 0; limit = 0;
} }
daybuff[0] = '\0'; daybuff[0] = '\0';
if (!db_getdata_range(&datalist, &datainfo, interface->name, listname, (u int32_t)limit, databegin, dataend) || !datalist) { if (!db_getdata_range(&datalist, &datainfo, interface->name, listname, (u int32_t)limit, databegin, dataend)) {
printf("Error: Failed to fetch %s data.\n", titlename); printf("Error: Failed to fetch %s data.\n", titlename);
return; return;
} }
if (!datalist) {
printf("No %s data available", titlename);
if (strlen(databegin) || strlen(dataend)) {
printf(" for given date range");
}
printf(".\n");
return;
}
datalist_i = datalist; datalist_i = datalist;
if (strlen(dataend) == 0 && datainfo.count > 0 && (listtype == LT_Day || listtype == LT_Month || listtype == LT_Year)) { if (strlen(dataend) == 0 && datainfo.count > 0 && (listtype == LT_Day || listtype == LT_Month || listtype == LT_Year)) {
estimatevisible = 1; estimatevisible = 1;
getestimates(&e_rx, &e_tx, listtype, interface->updated, &datalis t); getestimates(&e_rx, &e_tx, listtype, interface->updated, &datalis t);
if (cfg.estimatebarvisible && e_rx + e_tx > datainfo.max) { if (cfg.estimatebarvisible && e_rx + e_tx > datainfo.max) {
datainfo.max = e_rx + e_tx; datainfo.max = e_rx + e_tx;
} }
} }
 End of changes. 4 change blocks. 
1 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)