summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib/printtcpflags.c
blob: 9860780307a88eadd006b41dfd6cbd7f21404146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#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);
		}
	}
}
OpenPOWER on IntegriCloud