- putchar(' ');
- if (rec->tcp_flags & TCP_SYN) {
- putchar('S');
- }
- if (rec->tcp_flags & TCP_FIN) {
- putchar('F');
- }
- if (rec->tcp_flags & TCP_PSH) {
- putchar('P');
- }
- if (rec->tcp_flags & TCP_RST) {
- putchar('R');
- }
- if (rec->tcp_flags & TCP_URG) {
- putchar('U');
- }
- if (rec->tcp_flags & TCP_ACK) {
- putchar('.');
- }
- if (rec->tcp_flags & 0x40) {
- printf("[40]");
- }
- if (rec->tcp_flags & 0x80) {
- printf("[80]");
- }
+ struct ds s = DS_EMPTY_INITIALIZER;
+ packet_format_tcp_flags(&s, rec->tcp_flags);
+ printf(" %s", ds_cstr(&s));
+ ds_destroy(&s);