Lines Matching full:if
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
41 #if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
62 #define SET_NONBLOCKING_CONNECT(conn, val) do { if (val) { \
68 #if LWIP_NETCONN_FULLDUPLEX
75 #if LWIP_TCP
76 #if LWIP_TCPIP_CORE_LOCKING
89 #if LWIP_TCPIP_CORE_LOCKING
95 #if LWIP_NETCONN_FULLDUPLEX
101 if (msg == &netconn_deleted) { in lwip_netconn_is_deallocated_msg()
108 #if LWIP_TCP
135 if (msg == &netconn_aborted) { in lwip_netconn_is_err_msg()
138 } else if (msg == &netconn_reset) { in lwip_netconn_is_err_msg()
141 } else if (msg == &netconn_closed) { in lwip_netconn_is_err_msg()
150 #if LWIP_RAW
169 if ((conn != NULL) && NETCONN_MBOX_VALID(conn, &conn->recvmbox)) { in recv_raw()
170 #if LWIP_SO_RCVBUF in recv_raw()
173 if ((recv_avail + (int)(p->tot_len)) > conn->recv_bufsize) { in recv_raw()
179 if (q != NULL) { in recv_raw()
182 if (buf == NULL) { in recv_raw()
193 if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) { in recv_raw()
197 #if LWIP_SO_RCVBUF in recv_raw()
210 #if LWIP_UDP
224 #if LWIP_SO_RCVBUF
233 if (conn == NULL) {
240 #if LWIP_SO_RCVBUF
242 if (!NETCONN_MBOX_VALID(conn, &conn->recvmbox) ||
245 if (!NETCONN_MBOX_VALID(conn, &conn->recvmbox)) {
252 if (buf == NULL) {
260 #if LWIP_NETBUF_RECVINFO
261 if (conn->flags & NETCONN_FLAG_PKTINFO) {
272 if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) {
276 #if LWIP_SO_RCVBUF
285 #if LWIP_TCP
306 if (conn == NULL) {
311 if (!NETCONN_MBOX_VALID(conn, &conn->recvmbox)) {
313 if (p != NULL) {
323 if (p != NULL) {
331 if (sys_mbox_trypost(&conn->recvmbox, msg) != ERR_OK) {
335 #if LWIP_SO_RCVBUF
352 * netconn_close waits for conn->sem if closing failed.
364 if (conn->state == NETCONN_WRITE) {
366 } else if (conn->state == NETCONN_CLOSE) {
367 #if !LWIP_SO_SNDTIMEO && !LWIP_SO_LINGER
368 if (conn->current_msg && conn->current_msg->msg.sd.polls_left) {
377 if (conn->flags & NETCONN_FLAG_CHECK_WRITESPACE) {
378 /* If the queued byte- or pbuf-count drops below the configured low-water limit,
380 if ((conn->pcb.tcp != NULL) && (tcp_sndbuf(conn->pcb.tcp) > TCP_SNDLOWAT) &&
393 * netconn_write waits for conn->sem if send buffer is low.
405 if (conn) {
406 if (conn->state == NETCONN_WRITE) {
408 } else if (conn->state == NETCONN_CLOSE) {
412 /* If the queued byte- or pbuf-count drops below the configured low-water limit,
414 if ((conn->pcb.tcp != NULL) && (tcp_sndbuf(conn->pcb.tcp) > TCP_SNDLOWAT) &&
460 They will get an error if they actually try to read or write. */
466 if (NETCONN_MBOX_VALID(conn, &conn->recvmbox)) {
471 if (NETCONN_MBOX_VALID(conn, &conn->acceptmbox)) {
476 if ((old_state == NETCONN_WRITE) || (old_state == NETCONN_CLOSE) ||
483 if (!was_nonblocking_connect) {
487 if (old_state == NETCONN_CLOSE) {
538 if (conn == NULL) {
541 if (!NETCONN_MBOX_VALID(conn, &conn->acceptmbox)) {
546 if (newpcb == NULL) {
548 if (sys_mbox_trypost(&conn->acceptmbox, lwip_netconn_err_to_msg(ERR_ABRT)) == ERR_OK) {
562 if (newconn == NULL) {
564 if (sys_mbox_trypost(&conn->acceptmbox, lwip_netconn_err_to_msg(ERR_ABRT)) == ERR_OK) {
576 if (sys_mbox_trypost(&conn->acceptmbox, newconn) != ERR_OK) {
615 #if LWIP_IPV6 && LWIP_IPV4
617 if (NETCONNTYPE_ISIPV6(netconn_type(msg->conn))) {
624 #if LWIP_RAW
627 if (msg->conn->pcb.raw != NULL) {
628 #if LWIP_IPV6
630 … if (NETCONNTYPE_ISIPV6(msg->conn->type) && msg->conn->pcb.raw->protocol == IP6_NEXTH_ICMP6) {
639 #if LWIP_UDP
642 if (msg->conn->pcb.udp != NULL) {
643 #if LWIP_UDPLITE
644 if (NETCONNTYPE_ISUDPLITE(msg->conn->type)) {
648 if (NETCONNTYPE_ISUDPNOCHKSUM(msg->conn->type)) {
655 #if LWIP_TCP
658 if (msg->conn->pcb.tcp != NULL) {
668 if (msg->conn->pcb.ip == NULL) {
685 if (msg->conn->pcb.tcp == NULL) {
712 if (conn == NULL) {
720 /* If all sizes are the same, every compiler should optimize this switch to nothing */
722 #if LWIP_RAW
727 #if LWIP_UDP
730 #if LWIP_NETBUF_RECVINFO
735 #if LWIP_TCP
745 if (sys_mbox_new(&conn->recvmbox, size) != ERR_OK) {
748 #if !LWIP_NETCONN_SEM_PER_THREAD
749 if (sys_sem_new(&conn->op_completed, 0) != ERR_OK) {
755 #if LWIP_TCP
759 #if LWIP_SOCKET
764 #if LWIP_TCP
767 #if LWIP_SO_SNDTIMEO
770 #if LWIP_SO_RCVTIMEO
773 #if LWIP_SO_RCVBUF
777 #if LWIP_SO_LINGER
798 #if LWIP_NETCONN_FULLDUPLEX
805 #if LWIP_TCP
810 #if !LWIP_NETCONN_SEM_PER_THREAD
833 #if LWIP_NETCONN_FULLDUPLEX
838 if (sys_mbox_valid(&conn->recvmbox)) {
840 #if LWIP_NETCONN_FULLDUPLEX
841 if (!lwip_netconn_is_deallocated_msg(mem))
844 #if LWIP_TCP
845 if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) {
847 if (!lwip_netconn_is_err_msg(mem, &err)) {
862 #if LWIP_TCP
863 if (sys_mbox_valid(&conn->acceptmbox)) {
865 #if LWIP_NETCONN_FULLDUPLEX
866 if (!lwip_netconn_is_deallocated_msg(mem))
870 if (!lwip_netconn_is_err_msg(mem, &err)) {
876 if (newconn->pcb.tcp != NULL) {
890 #if LWIP_NETCONN_FULLDUPLEX
902 if (sys_mbox_valid_val(conn->recvmbox)) {
911 #if LWIP_TCP
926 #if LWIP_SO_LINGER
941 (also if RD or WR side was shut down before already) */
942 if (shut == NETCONN_SHUT_RDWR) {
944 } else if (shut_rx &&
949 } else if (shut_tx && ((tpcb->flags & TF_RXCLOSED) != 0)) {
956 if (shut_close) {
959 if (tpcb->state == LISTEN) {
962 /* some callbacks have to be reset if tcp_close is not successful */
963 if (shut_rx) {
967 if (shut_tx) {
970 if (shut_close) {
976 if (shut_close) {
977 #if LWIP_SO_LINGER
981 if ((conn->linger >= 0) && (conn->pcb.tcp->unsent || conn->pcb.tcp->unacked)) {
982 if ((conn->linger == 0)) {
986 } else if (conn->linger > 0) {
988 if (netconn_is_nonblocking(conn)) {
991 } else if ((s32_t)(sys_now() - conn->current_msg->msg.sd.time_started) >=
1003 if ((err == ERR_OK) && (tpcb != NULL))
1011 if (err == ERR_OK) {
1013 #if LWIP_SO_LINGER
1014 if (linger_wait_required) {
1021 if (err == ERR_MEM) {
1027 #if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER
1029 #if LWIP_SO_SNDTIMEO
1030 if (conn->send_timeout > 0) {
1034 #if LWIP_SO_LINGER
1035 if (conn->linger >= 0) {
1040 if ((s32_t)(sys_now() - conn->current_msg->msg.sd.time_started) >= close_timeout) {
1042 if (conn->current_msg->msg.sd.polls_left == 0) {
1045 if (shut_close) {
1056 if (close_finished) {
1062 if (err == ERR_OK) {
1063 if (shut_close) {
1070 if (shut_rx) {
1073 if (shut_tx) {
1077 #if LWIP_TCPIP_CORE_LOCKING
1078 if (delayed)
1086 if (!close_finished) {
1090 if (shut_tx) {
1099 /* If closing didn't succeed, we get called again either
1120 #if LWIP_NETCONN_FULLDUPLEX
1122 if (state != NETCONN_NONE) {
1123 if ((state == NETCONN_WRITE) ||
1136 if (((state != NETCONN_NONE) &&
1149 #if LWIP_NETCONN_FULLDUPLEX
1156 if (msg->conn->pcb.tcp != NULL) {
1159 #if LWIP_RAW
1164 #if LWIP_UDP
1170 #if LWIP_TCP
1176 #if LWIP_TCPIP_CORE_LOCKING
1177 if (lwip_netconn_do_close_internal(msg->conn, 0) != ERR_OK) {
1203 if (sys_sem_valid(LWIP_API_MSG_SEM(msg))) {
1221 if (msg->conn->pcb.tcp != NULL) {
1223 #if LWIP_RAW
1228 #if LWIP_UDP
1233 #if LWIP_TCP
1264 if ((netif != NULL) && (msg->conn->pcb.tcp != NULL)) {
1267 #if LWIP_RAW
1272 #if LWIP_UDP
1277 #if LWIP_TCP
1293 #if LWIP_TCP
1295 * TCP callback function if a connection (opened by tcp_connect/lwip_netconn_do_connect) has
1311 if (conn == NULL) {
1319 if (conn->current_msg != NULL) {
1323 if ((NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) && (err == ERR_OK)) {
1335 if (was_blocking) {
1355 if (msg->conn->pcb.tcp == NULL) {
1360 #if LWIP_RAW
1365 #if LWIP_UDP
1370 #if LWIP_TCP
1373 if (msg->conn->state == NETCONN_CONNECT) {
1375 } else if (msg->conn->state != NETCONN_NONE) {
1381 if (err == ERR_OK) {
1385 if (non_blocking) {
1391 #if LWIP_TCPIP_CORE_LOCKING
1429 #if LWIP_UDP
1430 if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_UDP) {
1441 #if LWIP_TCP
1454 if (msg->conn->pcb.tcp != NULL) {
1455 if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) {
1456 if (msg->conn->state == NETCONN_NONE) {
1458 if (msg->conn->pcb.tcp->state != CLOSED) {
1463 #if TCP_LISTEN_BACKLOG
1468 #if LWIP_IPV4 && LWIP_IPV6
1469 /* "Socket API like" dual-stack support: If IP to listen to is IP6_ADDR_ANY,
1472 if (ip_addr_cmp(&msg->conn->pcb.ip->local_ip, IP6_ADDR_ANY) &&
1482 if (lpcb == NULL) {
1486 if (sys_mbox_valid(&msg->conn->recvmbox)) {
1492 if (!sys_mbox_valid(&msg->conn->acceptmbox)) {
1495 if (err == ERR_OK) {
1507 } else if (msg->conn->state == NETCONN_LISTEN) {
1537 if (err == ERR_OK) {
1538 if (msg->conn->pcb.tcp != NULL) {
1540 #if LWIP_RAW
1542 if (ip_addr_isany(&msg->msg.b->addr) || IP_IS_ANY_TYPE_VAL(msg->msg.b->addr)) {
1549 #if LWIP_UDP
1551 #if LWIP_CHECKSUM_ON_COPY
1552 if (ip_addr_isany(&msg->msg.b->addr) || IP_IS_ANY_TYPE_VAL(msg->msg.b->addr)) {
1561 if (ip_addr_isany_val(msg->msg.b->addr) || IP_IS_ANY_TYPE_VAL(msg->msg.b->addr)) {
1581 #if LWIP_TCP
1594 if (msg->conn->pcb.tcp != NULL) {
1595 if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) {
1607 #if TCP_LISTEN_BACKLOG
1619 if (msg->conn->pcb.tcp != NULL) {
1620 if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) {
1629 * See if more data needs to be written from a previous call to netconn_write.
1630 * Called initially from lwip_netconn_do_write. If the first call can't send all data
1632 * from sent_tcp() or poll_tcp() to send more data. If all data is sent, the
1637 * ERR_MEM if LWIP_TCPIP_CORE_LOCKING=1 and sending hasn't yet finished
1662 #if LWIP_SO_SNDTIMEO
1663 if ((conn->send_timeout != 0) &&
1666 if (conn->current_msg->msg.w.offset == 0) {
1679 if (diff > 0xffffUL) { /* max_u16_t */
1686 if (available < len) {
1689 if (dontblock) {
1690 if (!len) {
1705 if ((len == 0xffff && diff > 0xffffUL) ||
1713 if (err == ERR_OK) {
1716 /* check if current vector is finished */
1717 if (conn->current_msg->msg.w.vector_off == conn->current_msg->msg.w.vector->len) {
1719 /* if we have additional vectors, move on to them */
1720 if (conn->current_msg->msg.w.vector_cnt > 0) {
1727 /* if OK or memory error, check available space */
1728 if ((err == ERR_OK) || (err == ERR_MEM)) {
1730 if (dontblock && (conn->current_msg->msg.w.offset < conn->current_msg->msg.w.len)) {
1735 } else if ((tcp_sndbuf(conn->pcb.tcp) <= TCP_SNDLOWAT) ||
1743 if (err == ERR_OK) {
1745 if ((conn->current_msg->msg.w.offset == conn->current_msg->msg.w.len) || dontblock) {
1750 if (out_err == ERR_RTE) {
1751 /* If tcp_output fails because no route is found,
1757 } else if (err == ERR_MEM) {
1758 /* If ERR_MEM, we wait for sent_tcp or poll_tcp to be called.
1765 if (out_err == ERR_RTE) {
1766 /* If tcp_output fails because no route is found,
1771 } else if (dontblock) {
1783 if (write_finished) {
1790 #if LWIP_TCPIP_CORE_LOCKING
1791 if (delayed)
1797 #if LWIP_TCPIP_CORE_LOCKING
1818 if (err == ERR_OK) {
1819 if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) {
1820 #if LWIP_TCP
1821 if (msg->conn->state != NETCONN_NONE) {
1824 } else if (msg->conn->pcb.tcp != NULL) {
1830 #if LWIP_TCPIP_CORE_LOCKING
1831 if (lwip_netconn_do_writemore(msg->conn, 0) != ERR_OK) {
1841 /* for both cases: if lwip_netconn_do_writemore was called, don't ACK the APIMSG
1850 #if (LWIP_UDP || LWIP_RAW)
1871 if (msg->conn->pcb.ip != NULL) {
1872 if (msg->msg.ad.local) {
1882 #if LWIP_RAW
1884 if (msg->msg.ad.local) {
1892 #if LWIP_UDP
1894 if (msg->msg.ad.local) {
1897 if ((msg->conn->pcb.udp->flags & UDP_FLAGS_CONNECTED) == 0) {
1905 #if LWIP_TCP
1907 if ((msg->msg.ad.local == 0) &&
1938 #if LWIP_TCP
1940 /* First check if this is a TCP netconn and if it is in a correct state
1942 if ((msg->conn->pcb.tcp != NULL) &&
1945 /* Check if we are in a connected state */
1946 if (state == NETCONN_CONNECT) {
1949 } else if (state == NETCONN_WRITE) {
1950 #if LWIP_NETCONN_FULLDUPLEX
1951 if (msg->msg.sd.shut & NETCONN_SHUT_WR) {
1968 if (state == NETCONN_NONE) {
1973 if (msg->msg.sd.shut & NETCONN_SHUT_RD) {
1974 #if LWIP_NETCONN_FULLDUPLEX
1984 #if LWIP_TCPIP_CORE_LOCKING
1985 if (lwip_netconn_do_close_internal(msg->conn, 0) != ERR_OK) {
2006 #if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
2019 if (msg->conn->pcb.tcp != NULL) {
2020 if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_UDP) {
2021 #if LWIP_UDP
2022 #if LWIP_IPV6 && LWIP_IPV6_MLD
2023 if (NETCONNTYPE_ISIPV6(msg->conn->type)) {
2024 if (msg->msg.jl.join_or_leave == NETCONN_JOIN) {
2034 #if LWIP_IGMP
2035 if (msg->msg.jl.join_or_leave == NETCONN_JOIN) {
2045 #if (LWIP_TCP || LWIP_RAW)
2066 if (netif == NULL) {
2072 if (msg->conn->pcb.tcp != NULL) {
2073 if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_UDP) {
2074 #if LWIP_UDP
2075 #if LWIP_IPV6 && LWIP_IPV6_MLD
2076 if (NETCONNTYPE_ISIPV6(msg->conn->type)) {
2077 if (msg->msg.jl.join_or_leave == NETCONN_JOIN) {
2087 #if LWIP_IGMP
2088 if (msg->msg.jl.join_or_leave == NETCONN_JOIN) {
2098 #if (LWIP_TCP || LWIP_RAW)
2110 #if LWIP_DNS
2124 if (ipaddr == NULL) {
2147 #if LWIP_IPV4 && LWIP_IPV6
2155 #if LWIP_TCPIP_CORE_LOCKING
2156 /* For core locking, only block if we need to wait for answer/timeout */
2157 if (API_EXPR_DEREF(msg->err) == ERR_INPROGRESS) {
2164 if (API_EXPR_DEREF(msg->err) != ERR_INPROGRESS) {