Enable aggregate support with '-F' (user-defined).

This commit is contained in:
Chris Caputo
2020-03-09 02:08:36 +00:00
parent e4d72f0505
commit 1d5b375cc3
6 changed files with 36 additions and 18 deletions

View File

@@ -401,7 +401,8 @@ sx_prefix_snprintf(struct sx_prefix* p, char* rbuffer, int srb)
void
sx_prefix_snprintf_fmt(struct sx_prefix* p, FILE* f,
const char* name, const char* format)
const char* name, const char* format,
unsigned int aggregateLow, unsigned int aggregateHi)
{
unsigned off = 0;
const char* c = format;
@@ -423,6 +424,12 @@ sx_prefix_snprintf_fmt(struct sx_prefix* p, FILE* f,
case 'l':
fprintf(f, "%i", p->masklen);
break;
case 'a':
fprintf(f, "%u", aggregateLow);
break;
case 'A':
fprintf(f, "%u", aggregateHi);
break;
case '%':
fprintf(f, "%%");
break;