Lines Matching refs:proto
271 seq_printf(s, "%s ", tcp_conntrack_names[ct->proto.tcp.state]); in tcp_print_conntrack()
515 struct ip_ct_tcp *state = &ct->proto.tcp; in tcp_in_window()
753 if (ct->proto.tcp.last_dir != dir && in nf_tcp_handle_invalid()
754 (ct->proto.tcp.last_index == TCP_FIN_SET || in nf_tcp_handle_invalid()
755 ct->proto.tcp.last_index == TCP_RST_SET)) { in nf_tcp_handle_invalid()
769 index, dir, ct->proto.tcp.last_index, timeout); in nf_tcp_handle_invalid()
774 ct->proto.tcp.last_index = index; in nf_tcp_handle_invalid()
775 ct->proto.tcp.last_dir = dir; in nf_tcp_handle_invalid()
856 memset(&ct->proto.tcp, 0, sizeof(ct->proto.tcp)); in tcp_new()
858 ct->proto.tcp.seen[0].td_end = in tcp_new()
861 ct->proto.tcp.seen[0].td_maxwin = ntohs(th->window); in tcp_new()
862 if (ct->proto.tcp.seen[0].td_maxwin == 0) in tcp_new()
863 ct->proto.tcp.seen[0].td_maxwin = 1; in tcp_new()
864 ct->proto.tcp.seen[0].td_maxend = in tcp_new()
865 ct->proto.tcp.seen[0].td_end; in tcp_new()
867 tcp_options(skb, dataoff, th, &ct->proto.tcp.seen[0]); in tcp_new()
872 memset(&ct->proto.tcp, 0, sizeof(ct->proto.tcp)); in tcp_new()
878 ct->proto.tcp.seen[0].td_end = in tcp_new()
881 ct->proto.tcp.seen[0].td_maxwin = ntohs(th->window); in tcp_new()
882 if (ct->proto.tcp.seen[0].td_maxwin == 0) in tcp_new()
883 ct->proto.tcp.seen[0].td_maxwin = 1; in tcp_new()
884 ct->proto.tcp.seen[0].td_maxend = in tcp_new()
885 ct->proto.tcp.seen[0].td_end + in tcp_new()
886 ct->proto.tcp.seen[0].td_maxwin; in tcp_new()
890 ct->proto.tcp.seen[0].flags = in tcp_new()
891 ct->proto.tcp.seen[1].flags = IP_CT_TCP_FLAG_SACK_PERM | in tcp_new()
896 ct->proto.tcp.last_index = TCP_NONE_SET; in tcp_new()
902 switch (ct->proto.tcp.state) { in tcp_can_early_drop()
926 old_state = ct->proto.tcp.state; in nf_conntrack_tcp_set_closing()
927 ct->proto.tcp.state = TCP_CONNTRACK_CLOSE; in nf_conntrack_tcp_set_closing()
989 old_state = ct->proto.tcp.state; in nf_conntrack_tcp_packet()
1010 if (((ct->proto.tcp.seen[dir].flags in nf_conntrack_tcp_packet()
1011 | ct->proto.tcp.seen[!dir].flags) in nf_conntrack_tcp_packet()
1013 || (ct->proto.tcp.last_dir == dir in nf_conntrack_tcp_packet()
1014 && ct->proto.tcp.last_index == TCP_RST_SET)) { in nf_conntrack_tcp_packet()
1043 && ct->proto.tcp.last_index == TCP_SYN_SET in nf_conntrack_tcp_packet()
1044 && ct->proto.tcp.last_dir != dir in nf_conntrack_tcp_packet()
1045 && ntohl(th->ack_seq) == ct->proto.tcp.last_end) { in nf_conntrack_tcp_packet()
1054 ct->proto.tcp.seen[ct->proto.tcp.last_dir].td_end = in nf_conntrack_tcp_packet()
1055 ct->proto.tcp.last_end; in nf_conntrack_tcp_packet()
1056 ct->proto.tcp.seen[ct->proto.tcp.last_dir].td_maxend = in nf_conntrack_tcp_packet()
1057 ct->proto.tcp.last_end; in nf_conntrack_tcp_packet()
1058 ct->proto.tcp.seen[ct->proto.tcp.last_dir].td_maxwin = in nf_conntrack_tcp_packet()
1059 ct->proto.tcp.last_win == 0 ? in nf_conntrack_tcp_packet()
1060 1 : ct->proto.tcp.last_win; in nf_conntrack_tcp_packet()
1061 ct->proto.tcp.seen[ct->proto.tcp.last_dir].td_scale = in nf_conntrack_tcp_packet()
1062 ct->proto.tcp.last_wscale; in nf_conntrack_tcp_packet()
1063 ct->proto.tcp.last_flags &= ~IP_CT_EXP_CHALLENGE_ACK; in nf_conntrack_tcp_packet()
1064 ct->proto.tcp.seen[ct->proto.tcp.last_dir].flags = in nf_conntrack_tcp_packet()
1065 ct->proto.tcp.last_flags; in nf_conntrack_tcp_packet()
1066 nf_ct_tcp_state_reset(&ct->proto.tcp.seen[dir]); in nf_conntrack_tcp_packet()
1069 ct->proto.tcp.last_index = index; in nf_conntrack_tcp_packet()
1070 ct->proto.tcp.last_dir = dir; in nf_conntrack_tcp_packet()
1071 ct->proto.tcp.last_seq = ntohl(th->seq); in nf_conntrack_tcp_packet()
1072 ct->proto.tcp.last_end = in nf_conntrack_tcp_packet()
1074 ct->proto.tcp.last_win = ntohs(th->window); in nf_conntrack_tcp_packet()
1086 ct->proto.tcp.last_flags = in nf_conntrack_tcp_packet()
1087 ct->proto.tcp.last_wscale = 0; in nf_conntrack_tcp_packet()
1090 ct->proto.tcp.last_flags |= in nf_conntrack_tcp_packet()
1092 ct->proto.tcp.last_wscale = seen.td_scale; in nf_conntrack_tcp_packet()
1095 ct->proto.tcp.last_flags |= in nf_conntrack_tcp_packet()
1103 ct->proto.tcp.last_flags |= in nf_conntrack_tcp_packet()
1111 ct->proto.tcp.last_ack = ntohl(th->ack_seq); in nf_conntrack_tcp_packet()
1128 ct->proto.tcp.last_dir == IP_CT_DIR_ORIGINAL && in nf_conntrack_tcp_packet()
1129 ct->proto.tcp.seen[dir].td_end - 1 == ntohl(th->seq)) { in nf_conntrack_tcp_packet()
1149 ct->proto.tcp.last_dir != dir && in nf_conntrack_tcp_packet()
1150 ct->proto.tcp.last_index == TCP_SYN_SET && in nf_conntrack_tcp_packet()
1151 (ct->proto.tcp.last_flags & IP_CT_EXP_CHALLENGE_ACK)) { in nf_conntrack_tcp_packet()
1153 ct->proto.tcp.last_flags &= ~IP_CT_EXP_CHALLENGE_ACK; in nf_conntrack_tcp_packet()
1163 ct->proto.tcp.last_flags |= IP_CT_TCP_SIMULTANEOUS_OPEN; in nf_conntrack_tcp_packet()
1167 ct->proto.tcp.last_flags & IP_CT_TCP_SIMULTANEOUS_OPEN) in nf_conntrack_tcp_packet()
1185 if ((ct->proto.tcp.seen[!dir].flags & IP_CT_TCP_FLAG_MAXACK_SET) && in nf_conntrack_tcp_packet()
1186 ct->proto.tcp.last_index != TCP_SYN_SET) { in nf_conntrack_tcp_packet()
1196 if (before(seq, ct->proto.tcp.seen[!dir].td_maxack) && in nf_conntrack_tcp_packet()
1205 seq == ct->proto.tcp.seen[!dir].td_maxack) in nf_conntrack_tcp_packet()
1212 if (ct->proto.tcp.last_index == TCP_ACK_SET && in nf_conntrack_tcp_packet()
1213 ct->proto.tcp.last_dir == dir && in nf_conntrack_tcp_packet()
1214 seq == ct->proto.tcp.last_end) in nf_conntrack_tcp_packet()
1223 && ct->proto.tcp.last_index == TCP_SYN_SET) in nf_conntrack_tcp_packet()
1225 && ct->proto.tcp.last_index == TCP_ACK_SET)) in nf_conntrack_tcp_packet()
1226 && ntohl(th->ack_seq) == ct->proto.tcp.last_end) { in nf_conntrack_tcp_packet()
1241 ct->proto.tcp.last_index == TCP_ACK_SET && in nf_conntrack_tcp_packet()
1242 ct->proto.tcp.last_dir == IP_CT_DIR_REPLY && in nf_conntrack_tcp_packet()
1243 ntohl(th->seq) == ct->proto.tcp.last_ack) in nf_conntrack_tcp_packet()
1267 ct->proto.tcp.last_index = index; in nf_conntrack_tcp_packet()
1268 ct->proto.tcp.last_dir = dir; in nf_conntrack_tcp_packet()
1270 ct->proto.tcp.state = new_state; in nf_conntrack_tcp_packet()
1273 ct->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT; in nf_conntrack_tcp_packet()
1279 if (ct->proto.tcp.retrans >= tn->tcp_max_retrans && in nf_conntrack_tcp_packet()
1284 else if ((ct->proto.tcp.seen[0].flags | ct->proto.tcp.seen[1].flags) & in nf_conntrack_tcp_packet()
1288 else if (ct->proto.tcp.last_win == 0 && in nf_conntrack_tcp_packet()
1354 if (nla_put_u8(skb, CTA_PROTOINFO_TCP_STATE, ct->proto.tcp.state)) in tcp_to_nlattr()
1361 ct->proto.tcp.seen[0].td_scale) || in tcp_to_nlattr()
1363 ct->proto.tcp.seen[1].td_scale)) in tcp_to_nlattr()
1366 tmp.flags = ct->proto.tcp.seen[0].flags; in tcp_to_nlattr()
1371 tmp.flags = ct->proto.tcp.seen[1].flags; in tcp_to_nlattr()
1422 ct->proto.tcp.state = nla_get_u8(tb[CTA_PROTOINFO_TCP_STATE]); in nlattr_to_tcp()
1427 ct->proto.tcp.seen[0].flags &= ~attr->mask; in nlattr_to_tcp()
1428 ct->proto.tcp.seen[0].flags |= attr->flags & attr->mask; in nlattr_to_tcp()
1434 ct->proto.tcp.seen[1].flags &= ~attr->mask; in nlattr_to_tcp()
1435 ct->proto.tcp.seen[1].flags |= attr->flags & attr->mask; in nlattr_to_tcp()
1440 ct->proto.tcp.seen[0].flags & IP_CT_TCP_FLAG_WINDOW_SCALE && in nlattr_to_tcp()
1441 ct->proto.tcp.seen[1].flags & IP_CT_TCP_FLAG_WINDOW_SCALE) { in nlattr_to_tcp()
1442 ct->proto.tcp.seen[0].td_scale = in nlattr_to_tcp()
1444 ct->proto.tcp.seen[1].td_scale = in nlattr_to_tcp()