freebsd-dev/contrib/ipfilter/lib/printtcpflags.c
Cy Schubert bfc88dcbf7 Update ipfilter 4.1.28 --> 5.1.2.
Approved by:		glebius (mentor)
BSD Licensed by:	Darren Reed <darrenr@reed.wattle.id.au> (author)
2013-09-06 23:11:19 +00:00

31 lines
451 B
C

#include "ipf.h"
void
printtcpflags(tcpf, tcpfm)
u_32_t tcpf, tcpfm;
{
u_char *t;
char *s;
if (tcpf & ~TCPF_ALL) {
PRINTF("0x%x", tcpf);
} else {
for (s = flagset, t = flags; *s; s++, t++) {
if (tcpf & *t)
(void)putchar(*s);
}
}
if (tcpfm) {
(void)putchar('/');
if (tcpfm & ~TCPF_ALL) {
PRINTF("0x%x", tcpfm);
} else {
for (s = flagset, t = flags; *s; s++, t++)
if (tcpfm & *t)
(void)putchar(*s);
}
}
}