Print this page
OS-7667 IPFilter needs to keep and report state for cloud firewall logging
Portions contributed by: Mike Gerdts <mike.gerdts@joyent.com>

*** 5,17 **** * * $Id: printfr.c,v 1.43.2.12 2005/06/12 07:18:42 darrenr Exp $ * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ ! #pragma ident "%Z%%M% %I% %E% SMI" #include "ipf.h" /* * print the filter structure in a useful way --- 5,18 ---- * * $Id: printfr.c,v 1.43.2.12 2005/06/12 07:18:42 darrenr Exp $ * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2019 Joyent, Inc. */ ! #include <uuid/uuid.h> #include "ipf.h" /* * print the filter structure in a useful way
*** 384,394 **** } if (*fp->fr_grhead != '\0') printf(" head %s", fp->fr_grhead); if (*fp->fr_group != '\0') printf(" group %s", fp->fr_group); ! if (fp->fr_logtag != FR_NOLOGTAG || *fp->fr_nattag.ipt_tag) { char *s = ""; printf(" set-tag("); if (fp->fr_logtag != FR_NOLOGTAG) { printf("log=%u", fp->fr_logtag); --- 385,396 ---- } if (*fp->fr_grhead != '\0') printf(" head %s", fp->fr_grhead); if (*fp->fr_group != '\0') printf(" group %s", fp->fr_group); ! if (fp->fr_logtag != FR_NOLOGTAG || *fp->fr_nattag.ipt_tag || ! (fp->fr_flags & FR_CFWLOG) || !uuid_is_null(fp->fr_uuid)) { char *s = ""; printf(" set-tag("); if (fp->fr_logtag != FR_NOLOGTAG) { printf("log=%u", fp->fr_logtag);
*** 395,405 **** --- 397,419 ---- s = ", "; } if (*fp->fr_nattag.ipt_tag) { printf("%snat=%-.*s", s, IPFTAG_LEN, fp->fr_nattag.ipt_tag); + s = ", "; } + if (fp->fr_flags & FR_CFWLOG) { + printf("cfwlog"); + s = ", "; + } + + if (!uuid_is_null(fp->fr_uuid)) { + char uuid[UUID_PRINTABLE_STRING_LENGTH]; + + uuid_unparse(fp->fr_uuid, uuid); + printf("%suuid=%s", s, uuid); + } printf(")"); } if (fp->fr_pps) printf(" pps %d", fp->fr_pps); (void)putchar('\n');