Lines Matching refs:tcph

310 	struct tcphdr *tcph;  in irdma_form_ah_cm_frame()  local
338 pktsize = sizeof(*tcph) + opts_len + hdr_len + pd_len; in irdma_form_ah_cm_frame()
343 sqbuf->tcphlen = sizeof(*tcph) + opts_len; in irdma_form_ah_cm_frame()
346 tcph = (struct tcphdr *)buf; in irdma_form_ah_cm_frame()
347 buf += sizeof(*tcph); in irdma_form_ah_cm_frame()
349 tcph->source = htons(cm_node->loc_port); in irdma_form_ah_cm_frame()
350 tcph->dest = htons(cm_node->rem_port); in irdma_form_ah_cm_frame()
351 tcph->seq = htonl(cm_node->tcp_cntxt.loc_seq_num); in irdma_form_ah_cm_frame()
355 tcph->ack_seq = htonl(cm_node->tcp_cntxt.loc_ack_num); in irdma_form_ah_cm_frame()
356 tcph->ack = 1; in irdma_form_ah_cm_frame()
358 tcph->ack_seq = 0; in irdma_form_ah_cm_frame()
363 tcph->syn = 1; in irdma_form_ah_cm_frame()
370 tcph->fin = 1; in irdma_form_ah_cm_frame()
374 tcph->rst = 1; in irdma_form_ah_cm_frame()
376 tcph->doff = (u16)((sizeof(*tcph) + opts_len + 3) >> 2); in irdma_form_ah_cm_frame()
377 sqbuf->tcphlen = tcph->doff << 2; in irdma_form_ah_cm_frame()
378 tcph->window = htons(cm_node->tcp_cntxt.rcv_wnd); in irdma_form_ah_cm_frame()
379 tcph->urg_ptr = 0; in irdma_form_ah_cm_frame()
420 struct tcphdr *tcph; in irdma_form_uda_cm_frame() local
451 pktsize = sizeof(*iph) + sizeof(*tcph); in irdma_form_uda_cm_frame()
453 pktsize = sizeof(*ip6h) + sizeof(*tcph); in irdma_form_uda_cm_frame()
460 sqbuf->tcphlen = sizeof(*tcph) + opts_len; in irdma_form_uda_cm_frame()
474 tcph = (struct tcphdr *)buf; in irdma_form_uda_cm_frame()
475 buf += sizeof(*tcph); in irdma_form_uda_cm_frame()
507 tcph = (struct tcphdr *)buf; in irdma_form_uda_cm_frame()
508 buf += sizeof(*tcph); in irdma_form_uda_cm_frame()
537 tcph->source = htons(cm_node->loc_port); in irdma_form_uda_cm_frame()
538 tcph->dest = htons(cm_node->rem_port); in irdma_form_uda_cm_frame()
539 tcph->seq = htonl(cm_node->tcp_cntxt.loc_seq_num); in irdma_form_uda_cm_frame()
543 tcph->ack_seq = htonl(cm_node->tcp_cntxt.loc_ack_num); in irdma_form_uda_cm_frame()
544 tcph->ack = 1; in irdma_form_uda_cm_frame()
546 tcph->ack_seq = 0; in irdma_form_uda_cm_frame()
551 tcph->syn = 1; in irdma_form_uda_cm_frame()
558 tcph->fin = 1; in irdma_form_uda_cm_frame()
562 tcph->rst = 1; in irdma_form_uda_cm_frame()
564 tcph->doff = (u16)((sizeof(*tcph) + opts_len + 3) >> 2); in irdma_form_uda_cm_frame()
565 sqbuf->tcphlen = tcph->doff << 2; in irdma_form_uda_cm_frame()
566 tcph->window = htons(cm_node->tcp_cntxt.rcv_wnd); in irdma_form_uda_cm_frame()
567 tcph->urg_ptr = 0; in irdma_form_uda_cm_frame()
748 struct tcphdr *tcph, int optionsize, in irdma_handle_tcp_options() argument
751 u8 *optionsloc = (u8 *)&tcph[1]; in irdma_handle_tcp_options()
756 (u32)tcph->syn); in irdma_handle_tcp_options()
768 cm_node->tcp_cntxt.snd_wnd = ntohs(tcph->window) in irdma_handle_tcp_options()
2570 static int irdma_check_syn(struct irdma_cm_node *cm_node, struct tcphdr *tcph) in irdma_check_syn() argument
2572 if (ntohl(tcph->ack_seq) != cm_node->tcp_cntxt.loc_seq_num) { in irdma_check_syn()
2585 static int irdma_check_seq(struct irdma_cm_node *cm_node, struct tcphdr *tcph) in irdma_check_seq() argument
2594 seq = ntohl(tcph->seq); in irdma_check_seq()
2595 ack_seq = ntohl(tcph->ack_seq); in irdma_check_seq()
2628 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_syn_pkt() local
2633 optionsize = (tcph->doff << 2) - sizeof(struct tcphdr); in irdma_handle_syn_pkt()
2634 inc_sequence = ntohl(tcph->seq); in irdma_handle_syn_pkt()
2650 err = irdma_handle_tcp_options(cm_node, tcph, optionsize, 1); in irdma_handle_syn_pkt()
2694 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_synack_pkt() local
2699 optionsize = (tcph->doff << 2) - sizeof(struct tcphdr); in irdma_handle_synack_pkt()
2700 inc_sequence = ntohl(tcph->seq); in irdma_handle_synack_pkt()
2705 if (irdma_check_syn(cm_node, tcph)) { in irdma_handle_synack_pkt()
2710 cm_node->tcp_cntxt.rem_ack_num = ntohl(tcph->ack_seq); in irdma_handle_synack_pkt()
2712 err = irdma_handle_tcp_options(cm_node, tcph, optionsize, 0); in irdma_handle_synack_pkt()
2735 cm_node->tcp_cntxt.loc_seq_num = ntohl(tcph->ack_seq); in irdma_handle_synack_pkt()
2741 cm_node->tcp_cntxt.loc_seq_num = ntohl(tcph->ack_seq); in irdma_handle_synack_pkt()
2767 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_ack_pkt() local
2773 optionsize = (tcph->doff << 2) - sizeof(struct tcphdr); in irdma_handle_ack_pkt()
2775 if (irdma_check_seq(cm_node, tcph)) in irdma_handle_ack_pkt()
2778 inc_sequence = ntohl(tcph->seq); in irdma_handle_ack_pkt()
2782 ret = irdma_handle_tcp_options(cm_node, tcph, optionsize, 1); in irdma_handle_ack_pkt()
2785 cm_node->tcp_cntxt.rem_ack_num = ntohl(tcph->ack_seq); in irdma_handle_ack_pkt()
2800 cm_node->tcp_cntxt.rem_ack_num = ntohl(tcph->ack_seq); in irdma_handle_ack_pkt()
2851 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_process_pkt() local
2855 if (tcph->rst) { in irdma_process_pkt()
2857 } else if (tcph->syn) { in irdma_process_pkt()
2859 if (tcph->ack) in irdma_process_pkt()
2861 } else if (tcph->ack) { in irdma_process_pkt()
2864 if (tcph->fin) in irdma_process_pkt()
2884 (!irdma_check_seq(cm_node, (struct tcphdr *)rbuf->tcph))) in irdma_process_pkt()
3092 struct tcphdr *tcph; in irdma_receive_ilq() local
3126 tcph = (struct tcphdr *)rbuf->tcph; in irdma_receive_ilq()
3142 cm_info.loc_port = ntohs(tcph->dest); in irdma_receive_ilq()
3143 cm_info.rem_port = ntohs(tcph->source); in irdma_receive_ilq()
3151 if (!tcph->syn || tcph->ack) in irdma_receive_ilq()
3176 if (!tcph->rst && !tcph->fin) { in irdma_receive_ilq()