mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-27 03:53:53 +08:00
NetFlow: Use tcp_flag_values[] for TCP flags.
This way there is less code duplication and more consistency.
This commit is contained in:
parent
5eb88b81d2
commit
f72772154c
1
CHANGES
1
CHANGES
@ -9,6 +9,7 @@ Monthday, Month DD, YYYY by gharris and denis
|
||||
AppleTalk: Declutter appletalk.h.
|
||||
OpenFlow 1.0: Fix indentation of PORT_MOD.
|
||||
RIP: Make a couple trivial protocol updates.
|
||||
NetFlow: Use tcp_flag_values[] for TCP flags.
|
||||
|
||||
Monthday, Month DD, YYYY by gharris
|
||||
Summary for 4.99.1 tcpdump release (so far!)
|
||||
|
30
print-cnfp.c
30
print-cnfp.c
@ -226,14 +226,8 @@ cnfp_v1_print(netdissect_options *ndo, const u_char *cp)
|
||||
if (proto == IPPROTO_TCP) {
|
||||
u_int flags;
|
||||
flags = GET_U_1(nr->tcp_flags);
|
||||
ND_PRINT("%s%s%s%s%s%s%s",
|
||||
flags & TH_FIN ? "F" : "",
|
||||
flags & TH_SYN ? "S" : "",
|
||||
flags & TH_RST ? "R" : "",
|
||||
flags & TH_PUSH ? "P" : "",
|
||||
flags & TH_ACK ? "A" : "",
|
||||
flags & TH_URG ? "U" : "",
|
||||
flags ? " " : "");
|
||||
if (flags)
|
||||
ND_PRINT("%s ", bittok2str_nosep(tcp_flag_values, "", flags));
|
||||
}
|
||||
|
||||
buf[0]='\0';
|
||||
@ -328,14 +322,8 @@ cnfp_v5_print(netdissect_options *ndo, const u_char *cp)
|
||||
if (proto == IPPROTO_TCP) {
|
||||
u_int flags;
|
||||
flags = GET_U_1(nr->tcp_flags);
|
||||
ND_PRINT("%s%s%s%s%s%s%s",
|
||||
flags & TH_FIN ? "F" : "",
|
||||
flags & TH_SYN ? "S" : "",
|
||||
flags & TH_RST ? "R" : "",
|
||||
flags & TH_PUSH ? "P" : "",
|
||||
flags & TH_ACK ? "A" : "",
|
||||
flags & TH_URG ? "U" : "",
|
||||
flags ? " " : "");
|
||||
if (flags)
|
||||
ND_PRINT("%s ", bittok2str_nosep(tcp_flag_values, "", flags));
|
||||
}
|
||||
|
||||
buf[0]='\0';
|
||||
@ -430,14 +418,8 @@ cnfp_v6_print(netdissect_options *ndo, const u_char *cp)
|
||||
if (proto == IPPROTO_TCP) {
|
||||
u_int flags;
|
||||
flags = GET_U_1(nr->tcp_flags);
|
||||
ND_PRINT("%s%s%s%s%s%s%s",
|
||||
flags & TH_FIN ? "F" : "",
|
||||
flags & TH_SYN ? "S" : "",
|
||||
flags & TH_RST ? "R" : "",
|
||||
flags & TH_PUSH ? "P" : "",
|
||||
flags & TH_ACK ? "A" : "",
|
||||
flags & TH_URG ? "U" : "",
|
||||
flags ? " " : "");
|
||||
if (flags)
|
||||
ND_PRINT("%s ", bittok2str_nosep(tcp_flag_values, "", flags));
|
||||
}
|
||||
|
||||
buf[0]='\0';
|
||||
|
@ -101,7 +101,7 @@ struct tcp_seq_hash6 {
|
||||
static struct tcp_seq_hash tcp_seq_hash4[TSEQ_HASHSIZE];
|
||||
static struct tcp_seq_hash6 tcp_seq_hash6[TSEQ_HASHSIZE];
|
||||
|
||||
static const struct tok tcp_flag_values[] = {
|
||||
const struct tok tcp_flag_values[] = {
|
||||
{ TH_FIN, "F" },
|
||||
{ TH_SYN, "S" },
|
||||
{ TH_RST, "R" },
|
||||
|
Loading…
Reference in New Issue
Block a user