make pacf logging deal with wildcards in flows.

This commit is contained in:
Johanna Amann 2015-06-01 18:57:16 -07:00
parent ae18062761
commit 269e80b3e1

View file

@ -241,9 +241,21 @@ function entity_to_info(info: Info, e: Entity)
break; break;
case FLOW: case FLOW:
info$entity = fmt("%s/%d->%s/%d", local ffrom_ip = "*";
e$flow$src_h, e$flow$src_p, local ffrom_port = "*";
e$flow$dst_h, e$flow$dst_p); local fto_ip = "*";
local fto_port = "*";
if ( e$flow?$src_h )
ffrom_ip = cat(e$flow$src_h);
if ( e$flow?$src_p )
ffrom_port = fmt("%d", e$flow$src_p);
if ( e$flow?$dst_h )
fto_ip = cat(e$flow$dst_h);
if ( e$flow?$dst_p )
fto_port = fmt("%d", e$flow$dst_p);
info$entity = fmt("%s/%s->%s/%s",
ffrom_ip, ffrom_port,
fto_ip, fto_port);
break; break;
case MAC: case MAC: