Home
last modified time | relevance | path

Searched refs:tp (Results 1 – 14 of 14) sorted by relevance

/openthread-latest/third_party/tcplp/bsdtcp/
Dtcp_timer.c67 tcp_timer_delack(struct tcpcb* tp) in tcp_timer_delack() argument
70 KASSERT(tpistimeractive(tp, TT_DELACK), ("Delack timer running, but unmarked")); in tcp_timer_delack()
71 tpcleartimeractive(tp, TT_DELACK); in tcp_timer_delack()
82 tp->t_flags |= TF_ACKNOW; in tcp_timer_delack()
83 (void) tcp_output(tp); in tcp_timer_delack()
88 tcp_timer_keep(struct tcpcb* tp) in tcp_timer_keep() argument
94 KASSERT(tpistimeractive(tp, TT_KEEP), ("Keep timer running, but unmarked")); in tcp_timer_keep()
95 tpcleartimeractive(tp, TT_KEEP); in tcp_timer_keep()
115 if (tp->t_state < TCPS_ESTABLISHED) in tcp_timer_keep()
118 tp->t_state <= TCPS_CLOSING) { in tcp_timer_keep()
[all …]
Dtcp_input.c106 struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos,
109 void tcp_hc_get(/*struct in_conninfo *inc*/ struct tcpcb* tp, struct hc_metrics_lite *hc_metrics_li…
116 cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t type) in cc_ack_received() argument
118 tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th); in cc_ack_received()
119 if (tp->snd_cwnd <= tp->snd_wnd) in cc_ack_received()
120 tp->ccv->flags |= CCF_CWND_LIMITED; in cc_ack_received()
122 tp->ccv->flags &= ~CCF_CWND_LIMITED; in cc_ack_received()
125 if (tp->snd_cwnd > tp->snd_ssthresh) { in cc_ack_received()
126 tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, in cc_ack_received()
127 V_tcp_abc_l_var * tp->t_maxseg); in cc_ack_received()
[all …]
Dtcp_output.c52 cc_after_idle(struct tcpcb *tp) in cc_after_idle() argument
55 if (CC_ALGO(tp)->after_idle != NULL) in cc_after_idle()
56 CC_ALGO(tp)->after_idle(tp->ccv); in cc_after_idle()
78 tcp_setpersist(struct tcpcb *tp) in tcp_setpersist() argument
80 int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; in tcp_setpersist()
83 tp->t_flags &= ~TF_PREVVALID; in tcp_setpersist()
84 if (tcp_timer_active(tp, TT_REXMT)) in tcp_setpersist()
89 TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], in tcp_setpersist()
91 tcp_timer_activate(tp, TT_PERSIST, tt); in tcp_setpersist()
92 if (tp->t_rxtshift < TCP_MAXRXTSHIFT) in tcp_setpersist()
[all …]
Dtcp_usrreq.c65 static int in6_pcbconnect(struct tcpcb* tp, struct sockaddr_in6* nam) { in in6_pcbconnect() argument
67 tp->faddr = sin6->sin6_addr; in in6_pcbconnect()
68 tp->fport = sin6->sin6_port; in in6_pcbconnect()
87 tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *nam) in tcp6_connect() argument
91 int sb_max = cbuf_free_space(&tp->recvbuf); // same as sendbuf in tcp6_connect()
100 bool autobind_addr = IN6_IS_ADDR_UNSPECIFIED(&tp->laddr); in tcp6_connect()
101 bool autobind_port = (tp->lport == 0); in tcp6_connect()
110 memcpy(&local.mAddress, &tp->laddr, sizeof(local.mAddress)); in tcp6_connect()
114 local.mPort = ntohs(tp->lport); in tcp6_connect()
117 if (!tcplp_sys_autobind(tp->instance, &foreign, &local, autobind_addr, autobind_port)) { in tcp6_connect()
[all …]
Dtcp_subr.c56 tcp_seq tcp_new_isn(struct tcpcb* tp) { in tcp_new_isn() argument
77 tcp_state_change(struct tcpcb *tp, int newstate) in tcp_state_change() argument
81 int pstate = tp->t_state; in tcp_state_change()
84 tcplp_sys_log("Socket %p: %s --> %s", tp, tcpstates[tp->t_state], tcpstates[newstate]); in tcp_state_change()
85 tp->t_state = newstate; in tcp_state_change()
88 tcplp_sys_on_state_change(tp, newstate); in tcp_state_change()
90 TCP_PROBE6(state__change, NULL, tp, NULL, tp, NULL, pstate); in tcp_state_change()
95 __attribute__((used)) void initialize_tcb(struct tcpcb* tp) { in initialize_tcb() argument
99 …memset(((uint8_t*) tp) + offsetof(struct tcpcb, laddr), 0x00, sizeof(struct tcpcb) - offsetof(stru… in initialize_tcb()
100 tp->reass_fin_index = -1; in initialize_tcb()
[all …]
Dtcp_sack.c106 tcp_sack_init(struct tcpcb* tp) in tcp_sack_init() argument
108 bmp_init(tp->sackhole_bmp, SACKHOLE_BMP_SIZE); in tcp_sack_init()
111 struct sackhole* sackhole_alloc(struct tcpcb* tp) { in sackhole_alloc() argument
112 size_t freeindex = bmp_countset(tp->sackhole_bmp, SACKHOLE_BMP_SIZE, 0, SACKHOLE_BMP_SIZE); in sackhole_alloc()
116 bmp_setrange(tp->sackhole_bmp, freeindex, 1); in sackhole_alloc()
117 return &tp->sackhole_pool[freeindex]; in sackhole_alloc()
120 void sackhole_free(struct tcpcb* tp, struct sackhole* tofree) { in sackhole_free() argument
121 size_t freeindex = (size_t) (tofree - &tp->sackhole_pool[0]); in sackhole_free()
122 KASSERT(tofree == &tp->sackhole_pool[freeindex], ("sackhole pool unaligned")); in sackhole_free()
123 bmp_clrrange(tp->sackhole_bmp, freeindex, 1); in sackhole_free()
[all …]
Dtcp_timewait.c93 tcp_tw_2msl_reset(struct tcpcb* tp, int rearm) in tcp_tw_2msl_reset() argument
101 tcp_timer_activate(tp, TT_2MSL, 2 * tcp_msl); in tcp_tw_2msl_reset()
121 tcp_twrespond(struct tcpcb* tp, int flags) in tcp_twrespond() argument
134 if ((tp->t_flags & TF_RCVD_TSTMP) && flags == TH_ACK) { in tcp_twrespond()
136 to.to_tsval = tcp_ts_getticks() + tp->ts_offset; in tcp_twrespond()
137 to.to_tsecr = tp->ts_recent; in tcp_twrespond()
141 otMessage* message = tcplp_sys_new_message(tp->instance); in tcp_twrespond()
146 tcplp_sys_free_message(tp->instance, message); in tcp_twrespond()
155 memcpy(&ip6info.mSockAddr, &tp->laddr, sizeof(ip6info.mSockAddr)); in tcp_twrespond()
156 memcpy(&ip6info.mPeerAddr, &tp->faddr, sizeof(ip6info.mPeerAddr)); in tcp_twrespond()
[all …]
Dtcp_reass.c54 tcp_reass(struct tcpcb* tp, struct tcphdr* th, int* tlenp, otMessage* data, off_t data_offset, stru… in tcp_reass() argument
74 KASSERT(SEQ_GEQ(th->th_seq, tp->rcv_nxt), ("Adding past segment to the reassembly queue")); in tcp_reass()
75 offset = (size_t) (th->th_seq - tp->rcv_nxt); in tcp_reass()
77 if (cbuf_reass_count_set(&tp->recvbuf, (size_t) offset, tp->reassbmp, tlen) >= (size_t) tlen) { in tcp_reass()
81 …written = cbuf_reass_write(&tp->recvbuf, (size_t) offset, data, data_offset, tlen, tp->reassbmp, &… in tcp_reass()
83 if ((th->th_flags & TH_FIN) && (tp->reass_fin_index == -1)) { in tcp_reass()
84 tp->reass_fin_index = (int16_t) (start_index + tlen); in tcp_reass()
93 mergeable = cbuf_reass_count_set(&tp->recvbuf, 0, tp->reassbmp, (size_t) 0xFFFFFFFF); in tcp_reass()
94 usedbefore = cbuf_used_space(&tp->recvbuf); in tcp_reass()
95 if (!tpiscantrcv(tp) || usedbefore == 0) { in tcp_reass()
[all …]
Dtcp_timer.h143 int tcp_timer_active(struct tcpcb *tp, uint32_t timer_type);
144 void tcp_timer_activate(struct tcpcb *tp, uint32_t timer_type, uint32_t delta);
145 void tcp_cancel_timers(struct tcpcb* tp);
161 int tcp_timer_delack(struct tcpcb* tp);
162 int tcp_timer_keep(struct tcpcb* tp);
163 int tcp_timer_persist(struct tcpcb* tp);
164 int tcp_timer_2msl(struct tcpcb* tp);
165 int tcp_timer_rexmt(struct tcpcb *tp);
166 int tcp_timer_active(struct tcpcb *tp, uint32_t timer_type);
172 #define TP_KEEPINIT(tp) (/*(tp)->t_keepinit ? (tp)->t_keepinit :*/ tcp_keepinit) argument
[all …]
Dtcp_var.h148 #define tpcantrcvmore(tp) (tp)->miscflags |= TCB_CANTRCVMORE argument
149 #define tpcantsendmore(tp) (tp)->miscflags |= TCB_CANTSENDMORE argument
150 #define tpiscantrcv(tp) (((tp)->miscflags & TCB_CANTRCVMORE) != 0) argument
151 #define tpiscantsend(tp) (((tp)->miscflags & TCB_CANTSENDMORE) != 0) argument
152 #define tpmarktimeractive(tp, timer) (tp)->miscflags |= timer argument
153 #define tpistimeractive(tp, timer) (((tp)->miscflags & timer) != 0) argument
154 #define tpcleartimeractive(tp, timer) (tp)->miscflags &= ~timer argument
155 #define tpmarkpassiveopen(tp) (tp)->miscflags |= TCB_PASSIVE argument
156 #define tpispassiveopen(tp) (((tp)->miscflags & TCB_PASSIVE) != 0) argument
158 #define REASSBMP_SIZE(tp) BITS_TO_BYTES((tp)->recvbuf.size) argument
[all …]
Dtcp_seq.h61 #define tcp_rcvseqinit(tp) \ argument
62 (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
64 #define tcp_sendseqinit(tp) \ argument
65 (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
66 (tp)->snd_recover = (tp)->iss
Dtcp_fastopen.c646 tcp_fastopen_check_cookie(struct tcpcb* tp, uint8_t *cookie, in tcp_fastopen_check_cookie() argument
921 tcp_fastopen_connect(struct tcpcb *tp) in tcp_fastopen_connect() argument
932 tp->snd_wnd = tp->t_maxseg; in tcp_fastopen_connect()
943 inp = tp->t_inpcb; in tcp_fastopen_connect()
948 (tp->t_tfo_client_cookie_len == in tcp_fastopen_connect()
952 tp->t_tfo_cookie.client, in tcp_fastopen_connect()
955 tp->t_tfo_client_cookie_len = cce->cookie_len; in tcp_fastopen_connect()
956 memcpy(tp->t_tfo_cookie.client, cce->cookie, in tcp_fastopen_connect()
961 if (tp->t_tfo_client_cookie_len == in tcp_fastopen_connect()
963 tp->t_tfo_client_cookie_len = in tcp_fastopen_connect()
[all …]
Dcc.h158 #define CC_ALGO(tp) (&newreno_cc_algo) // samkumar: This allows the #defines in cc_newreno.c to wor… argument
161 #define CC_DATA(tp) ((tp)->ccv->cc_data) argument
/openthread-latest/src/core/net/
Dtcp6.cpp82 struct tcpcb &tp = GetTcb(); in Initialize() local
84 ClearAllBytes(tp); in Initialize()
107 lbuf_init(&tp.sendbuf); in Initialize()
108 cbuf_init(&tp.recvbuf, recvbuf, recvbuflen); in Initialize()
109 tp.reassbmp = reassbmp; in Initialize()
110 bmp_init(tp.reassbmp, BITS_TO_BYTES(recvbuflen)); in Initialize()
113 tp.accepted_from = nullptr; in Initialize()
114 initialize_tcb(&tp); in Initialize()
118 tp.instance = &aInstance; in Initialize()
128 const struct tcpcb &tp = GetTcb(); in GetLocalAddress() local
[all …]