1254219Scy#include "ipf.h"
2254219Scy
3254219Scy
4254219Scyvoid
5254219Scyprinttcpflags(tcpf, tcpfm)
6254219Scy	u_32_t tcpf, tcpfm;
7254219Scy{
8254219Scy	u_char *t;
9254219Scy	char *s;
10254219Scy
11254219Scy	if (tcpf & ~TCPF_ALL) {
12254219Scy		PRINTF("0x%x", tcpf);
13254219Scy	} else {
14254219Scy		for (s = flagset, t = flags; *s; s++, t++) {
15254219Scy			if (tcpf & *t)
16254219Scy				(void)putchar(*s);
17254219Scy		}
18254219Scy	}
19254219Scy
20254219Scy	if (tcpfm) {
21254219Scy		(void)putchar('/');
22254219Scy		if (tcpfm & ~TCPF_ALL) {
23254219Scy			PRINTF("0x%x", tcpfm);
24254219Scy		} else {
25254219Scy			for (s = flagset, t = flags; *s; s++, t++)
26254219Scy				if (tcpfm & *t)
27254219Scy					(void)putchar(*s);
28254219Scy		}
29254219Scy	}
30254219Scy}
31