Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_output.c

    r321 r331  
    22 *  TINET (TCP/IP Protocol Stack)
    33 *
    4  *  Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering
     4 *  Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering
    55 *                   Tomakomai National College of Technology, JAPAN
    66 *
     
    9393#include <net/ethernet.h>
    9494#include <net/net.h>
     95#include <net/net_endian.h>
     96#include <net/net_var.h>
    9597#include <net/net_buf.h>
    9698#include <net/net_timer.h>
     
    98100
    99101#include <netinet/in.h>
    100 #include <netinet6/in6.h>
    101102#include <netinet/in_var.h>
    102103#include <netinet/in_itron.h>
    103104#include <netinet/ip.h>
    104105#include <netinet/ip_var.h>
    105 #include <netinet6/in6_var.h>
    106 #include <netinet/ip6.h>
    107 #include <netinet6/ip6_var.h>
    108106#include <netinet/tcp.h>
    109 #include <netinet/tcp_timer.h>
    110107#include <netinet/tcp_var.h>
    111108#include <netinet/tcp_fsm.h>
    112109#include <netinet/tcp_seq.h>
     110#include <netinet/tcp_timer.h>
    113111
    114112#ifdef SUPPORT_TCP
     
    150148        T_NET_BUF       *output;
    151149        T_TCP_HDR       *tcph;
    152         uint_t          optlen;
     150        uint_t          optlen, hdr_offset;
    153151        ER              error;
    154152
     
    210208                 */
    211209                len = 0;
    212                 if ((error = tcp_get_segment(&output, cep, optlen,
    213                                             len, (uint_t)(net_buf_max_siz() - IF_IP_TCP_HDR_SIZE),
     210                if ((error = tcpn_get_segment(&output, cep, optlen,
     211                                            len, (uint_t)net_buf_max_siz(),
    214212                                            NBA_SEARCH_ASCENT, TMO_TCP_GET_NET_BUF)) != E_OK) {
    215213                        if (cep->timer[TCP_TIM_REXMT] == 0)
     
    222220
    223221        if (IS_PTR_DEFINED(cep->sbuf)) {
    224                 if ((error = tcp_get_segment(&output, cep, optlen,
    225                                              len, (uint_t)(net_buf_max_siz() - IF_IP_TCP_HDR_SIZE),
     222                if ((error = tcpn_get_segment(&output, cep, optlen,
     223                                             len, (uint_t)net_buf_max_siz(),
    226224                                             NBA_SEARCH_ASCENT, TMO_TCP_GET_NET_BUF)) != E_OK) {
    227225                        if (cep->timer[TCP_TIM_REXMT] == 0)
     
    247245                 */
    248246                len = 0;
    249                 if ((error = tcp_get_segment(&output, cep, optlen,
    250                                             len, (uint_t)(net_buf_max_siz() - IF_IP_TCP_HDR_SIZE),
     247                if ((error = tcpn_get_segment(&output, cep, optlen,
     248                                            len, (uint_t)net_buf_max_siz(),
    251249                                            NBA_SEARCH_ASCENT, TMO_TCP_GET_NET_BUF)) != E_OK) {
    252250                        if (cep->timer[TCP_TIM_REXMT] == 0)
     
    258256#else   /* of #if defined(TCP_CFG_SWBUF_CSAVE_ONLY) */
    259257
    260         if ((error = tcp_get_segment(&output, cep, optlen,
    261                                      len, (uint_t)(net_buf_max_siz() - IF_IP_TCP_HDR_SIZE),
     258        if ((error = tcpn_get_segment(&output, cep, optlen,
     259                                     len, (uint_t)net_buf_max_siz(),
    262260                                     NBA_SEARCH_ASCENT, TMO_TCP_GET_NET_BUF)) != E_OK) {
    263261                if (cep->timer[TCP_TIM_REXMT] == 0)
     
    272270         *  本実装では、最大セグメントサイズのみ設定する。
    273271         */
     272        hdr_offset = IF_IP_TCP_HDR_OFFSET(output);
    274273        if (flags & TCP_FLG_SYN) {
    275274                cep->snd_nxt = cep->iss;
     
    277276#ifdef TCP_CFG_OPT_MSS
    278277
    279                 optp = GET_TCP_OPT(output, IF_IP_TCP_HDR_OFFSET);
     278                optp = GET_TCP_OPT(output, hdr_offset);
    280279                *optp ++ = TCP_OPT_MAXSEG;
    281280                *optp ++ = TCP_OPT_LEN_MAXSEG;
     
    324323                }
    325324
    326         tcph = GET_TCP_HDR(output, IF_IP_TCP_HDR_OFFSET);
     325        tcph = GET_TCP_HDR(output, hdr_offset);
    327326
    328327        /*
     
    379378         */
    380379        tcph->sum = 0;
    381         tcph->sum = IN_CKSUM(output, IPPROTO_TCP, (uint_t)GET_TCP_HDR_OFFSET(output),
    382                              GET_TCP_HDR_SIZE2(output, IF_IP_TCP_HDR_OFFSET) + len);
     380        tcph->sum = IN_CKSUM(output, IPPROTO_TCP, hdr_offset, GET_TCP_HDR_SIZE(output, hdr_offset) + len);
    383381
    384382        /* ネットワークバッファ長を調整する。*/
    385         output->len = (uint16_t)(GET_IF_IP_TCP_HDR_SIZE2(output, IF_IP_TCP_HDR_OFFSET) + len);
     383        output->len = (uint16_t)(GET_IF_IP_TCP_HDR_SIZE(output, hdr_offset) + len);
    386384
    387385        /*
     
    490488         * ・動的な通信端点の生成・削除機能
    491489         */
    492         cep->flags &= (TCP_CEP_FLG_WBCS_NBUF_REQ | TCP_CEP_FLG_WBCS_MASK |
    493                        TCP_CEP_FLG_DYNAMIC       | TCP_CEP_FLG_VALID);
     490        cep->flags &= TCP_CEP_FLG_NOT_CLEAR;
    494491
    495492        return error;
     
    864861#endif  /* of #ifdef TCP_CFG_NON_BLOCKING */
    865862
    866                 if ((error = tcp_get_segment(&cep->swbufq, cep, 0,
    867                                              (uint_t) TCP_CFG_SWBUF_CSAVE_MIN_SIZE,
    868                                              (uint_t)(TCP_CFG_SWBUF_CSAVE_MAX_SIZE - IF_IP_TCP_HDR_SIZE),
     863                if ((error = tcpn_get_segment(&cep->swbufq, cep, 0,
     864                                             (uint_t)TCP_CFG_SWBUF_CSAVE_MIN_SIZE,
     865                                             (uint_t)TCP_CFG_SWBUF_CSAVE_MAX_SIZE,
    869866                                             (ATR)(NBA_SEARCH_DESCENT |
    870867                                                   NBA_RESERVE_TCP    |
     
    888885                                len = TCP_GET_SWBUF_ADDR(cep, cep->snd_p_buf);
    889886
     887                                /* コールバック関数を呼び出す。*/
    890888#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    891 
    892                                 /* コールバック関数を呼び出す。*/
    893889                                (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)(uint32_t)len);
    894 
    895 #else   /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */
    896 
    897                                 /* コールバック関数を呼び出す。*/
     890#else
    898891                                (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)&len);
    899 
    900 #endif  /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */
     892#endif
    901893
    902894
     
    924916                                /* フラグを、送信可能に設定し、強制的に送信する。*/
    925917                                cep->flags |= TCP_CEP_FLG_FORCE | TCP_CEP_FLG_FORCE_CLEAR | TCP_CEP_FLG_POST_OUTPUT;
     918
     919                                /* コールバック関数を呼び出す。*/
    926920#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    927 
    928                                 /* コールバック関数を呼び出す。*/
    929921                                (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)(uint32_t)len);
    930 
    931 #else   /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */
    932 
    933                                 /* コールバック関数を呼び出す。*/
     922#else
    934923                                (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)&len);
    935 
    936 #endif  /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */
     924#endif
    937925
    938926
     
    999987        tcp_init();
    1000988
    1001 #ifdef SUPPORT_INET6
     989#ifdef _IP6_CFG
    1002990
    1003991        /* IPv6 のステートレス・アドレス自動設定を実行する。*/
    1004992        in6_if_up(IF_GET_IFNET());
    1005993
    1006 #endif  /* of #ifdef SUPPORT_INET6 */
     994#endif  /* of #ifdef _IP6_CFG */
    1007995
    1008996        while (true) {
     
    10831071
    10841072                                                if (IS_PTR_DEFINED(cep->callback))
    1085 
    10861073#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    1087 
    10881074                                                        (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)error);
    1089 
    1090 #else   /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */
    1091 
     1075#else
    10921076                                                        (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)&error);
    1093 
    1094 #endif  /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */
    1095 
     1077#endif
    10961078                                                else
    10971079                                                        syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep));
Note: See TracChangeset for help on using the changeset viewer.