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/net/net_buf.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 *
     
    5757#include <net/ethernet.h>
    5858#include <net/net.h>
     59#include <net/net_endian.h>
    5960#include <net/net_buf.h>
    6061#include <net/net_count.h>
     
    6263#include <netinet/in.h>
    6364#include <netinet/in_var.h>
    64 #include <netinet6/in6.h>
    6565#include <netinet/ip.h>
    6666#include <netinet/ip_var.h>
    67 #include <netinet/ip6.h>
    68 #include <netinet6/ip6_var.h>
    6967#include <netinet/tcp.h>
    70 #include <netinet/tcp_timer.h>
    7168#include <netinet/tcp_var.h>
    7269
     
    9895
    9996#if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0
     97
    10098        {
    10199                MPF_NET_BUF_REASSM,
     
    109107
    110108                },
    111 #endif  /* of #if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0 */
     109
     110#else   /* of #if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0 */
    112111
    113112#if defined(NUM_MPF_NET_BUF4_REASSM) && NUM_MPF_NET_BUF4_REASSM > 0
     113
    114114        {
    115115                MPF_NET_BUF_REASSM,
     
    123123
    124124                },
     125
    125126#endif  /* of #if defined(NUM_MPF_NET_BUF4_REASSM) && NUM_MPF_NET_BUF4_REASSM > 0 */
     127
     128#endif  /* of #if defined(NUM_MPF_NET_BUF6_REASSM) && NUM_MPF_NET_BUF6_REASSM > 0 */
    126129
    127130#if defined(NUM_MPF_NET_BUF_IF_PDU) && NUM_MPF_NET_BUF_IF_PDU > 0
     
    223226#endif  /* of #if defined(NUM_MPF_NET_BUF_128) && NUM_MPF_NET_BUF_128 > 0 */
    224227
    225 #if defined(SUPPORT_INET4)
     228#if defined(_IP4_CFG)
    226229
    227230#if defined(NUM_MPF_NET_BUF_64) && NUM_MPF_NET_BUF_64 > 0
     
    239242#endif  /* of #if defined(NUM_MPF_NET_BUF_64) && NUM_MPF_NET_BUF_64 > 0 */
    240243
    241 #endif  /* of #if defined(SUPPORT_INET4) */
     244#endif  /* of #if defined(_IP4_CFG) */
    242245
    243246#if defined(NUM_MPF_NET_BUF_CSEG) && NUM_MPF_NET_BUF_CSEG > 0
     
    308311                        (*buf)->len   = (uint16_t)minlen;
    309312                        (*buf)->flags = 0;
     313
     314#if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF
    310315                        NET_COUNT_NET_BUF(net_buf_table[ix].allocs, 1);
     316                        net_buf_table[ix].busies ++;
     317#endif
    311318                        return error;
    312319                        }
     
    316323                }
    317324
    318         syslog(LOG_WARNING, "[NET BUF] busy, index=%d, len=%4d.", (uint16_t)req_ix, minlen);
     325        syslog(LOG_WARNING, "[BUF] busy, up   index:%d,%d[%4d], len:%4d.",
     326                            (uint16_t)req_ix, ix, net_buf_table[req_ix].size, minlen);
    319327        *buf = NULL;
    320328        NET_COUNT_NET_BUF(net_buf_table[req_ix].errors, 1);
     
    346354                        (*buf)->len   = net_buf_table[ix].size;
    347355                        (*buf)->flags = 0;
     356
     357#if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF
    348358                        NET_COUNT_NET_BUF(net_buf_table[ix].allocs, 1);
     359                        net_buf_table[ix].busies ++;
     360#endif
    349361                        return error;
    350362                        }
     
    354366                }
    355367
    356         syslog(LOG_WARNING, "[NET BUF] busy, index=%d, len=%4d.", (uint16_t)req_ix, maxlen);
     368        syslog(LOG_WARNING, "[BUF] busy, down index:%d,%d[%4d], len:%4d.",
     369                            (uint16_t)req_ix, ix, net_buf_table[req_ix].size, minlen);
    357370        *buf = NULL;
    358371        NET_COUNT_NET_BUF(net_buf_table[req_ix].errors, 1);
     
    380393                }
    381394
     395#if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE)
     396
    382397        /* TCP で予約したネットワークバッファを取り出す。*/
    383398        if ((nbatr & NBA_RESERVE_TCP) != 0) {
     
    386401                        }
    387402                }
     403
     404#endif  /* of #if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE) */
    388405
    389406        if ((nbatr & NBA_SEARCH_DESCENT) != 0)
     
    423440        else {
    424441
     442#if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE)
     443
    425444                /* TCP で、ネットワークバッファを予約する。*/
    426445                if (TCP_PUSH_RES_NBUF(buf) == NULL)
    427446                        return E_OK;
    428447
     448#endif  /* of #if defined(SUPPORT_TCP) && defined(TCP_CFG_SWBUF_CSAVE) */
     449
    429450                /* 固定メモリプールに返す。*/
    430                 if ((error = rel_mpf((ID)net_buf_table[buf->idix].index, buf)) != E_OK)
     451
     452#if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF
     453                net_buf_table[buf->idix].busies --;
     454#endif
     455                if ((error = rel_mpf((ID)net_buf_table[buf->idix].index, buf)) != E_OK) {
    431456                        syslog(LOG_WARNING, "[NET BUF] %s, ID=%d.", itron_strerror(error), buf->idix);
     457                        }
    432458                }
    433459        return error;
Note: See TracChangeset for help on using the changeset viewer.