Ignore:
Timestamp:
Feb 1, 2019, 9:57:09 PM (5 years ago)
Author:
coas-nagasima
Message:

TINETとSocket APIなどを更新

Location:
asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/icmp6.h

    r352 r364  
    291291typedef struct t_router_advert_hdr {
    292292        T_ICMP6_HDR     hdr;
    293         uint32_t        reachable;              /* [ms] 到達可能時間  */
    294         uint32_t        retransmit;             /* [ms] 近隣要請送信間隔        */
     293        uint32_t        reachable;              /* [us] 到達可能時間  */
     294        uint32_t        retransmit;             /* [us] 近隣要請送信間隔        */
    295295        /* この後にオプションが続く */
    296296        } __attribute__((packed, aligned(2))) T_ROUTER_ADVERT_HDR;
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/in4_subr.c

    r352 r364  
    287287
    288288        /* IP ヘッダを設定する。*/
    289         if ((error = in4_set_header(*nbuf, len, dstaddr, srcaddr, proto, ttl)) != E_OK)
     289        if ((error = in4_set_header(*nbuf, len, dstaddr, srcaddr, proto, ttl)) != E_OK) {
     290                syscall(rel_net_buf(*nbuf));
     291                *nbuf = NULL;
    290292                return error;
     293                }
    291294
    292295        /* 4 オクテット境界までパディングで埋める。*/
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/in_itron.h

    r352 r364  
    6262#define TFN_TCP_ALL             (0)
    6363
    64 #define TEV_TCP_RCV_OOB         (-0x201)
     64#define TEV_TCP_RCV_OOB         (0x201)
    6565
    6666/* UDP 関係 */
     
    7575#define TFN_UDP_ALL             (0)
    7676
    77 #define TEV_UDP_RCV_DAT         (-0x221)
     77#define TEV_UDP_RCV_DAT         (0x221)
    7878
    7979/* 一般 */
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/tcp_input.c

    r352 r364  
    13641364        NTOHS(tcph->dport);
    13651365
     1366        /* SDU 長 より 緊急ポインタが大きい場合 */
     1367        if (tcph->urp > tcph->sum)
     1368                goto drop;
     1369
    13661370find_cep:
    13671371
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/tcp_output.c

    r352 r364  
    369369                tcph->flags |= TCP_FLG_URG;
    370370                }
    371         else
     371        else {
     372                tcph->urp = 0;
    372373                cep->snd_up  = cep->snd_una;
     374                }
    373375
    374376#endif  /* of #ifdef TCP_CFG_EXTENTIONS */
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/tcp_usrreq.c

    r352 r364  
    897897
    898898        /* tcp_rcv_buf の割当て長をリセットする。*/
    899         cep->rcv_buf_len = 0;
     899        cep->rcv_buf_len -= len;
    900900
    901901        /* 通信端点のロックを解除する。*/
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/udp_var.h

    r352 r364  
    101101typedef ER      (*t_udp_callback)(ID cepid, FN fncd, void *p_parblk);
    102102
     103typedef struct t_udp_rcv_dat_para {
     104        uint_t          len;
     105        T_NET_BUF       *input;
     106        uint_t          off;
     107        union {
     108                T_IPV4EP rep4;
     109                T_IPV6EP rep6;
     110        };
     111        } T_UDP_RCV_DAT_PARA;
     112
    103113/*
    104114 *  UDP 通信端点
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/udpn_input.c

    r352 r364  
    7575{
    7676        T_UDP_HDR       *udph;
    77         uint_t          len;
     77        T_UDP_RCV_DAT_PARA para;
    7878
    7979        udph = (T_UDP_HDR *)(input->buf + off);
    80         len  = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE);
     80        para.len  = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE);
    8181
    8282        if (cep->rcv_tskid != TA_NULL) {        /* 非ノンブロッキングコールでペンディング中 */
     
    9898                /* データをバッファに移す。*/
    9999                memcpy(cep->rcv_data, GET_UDP_SDU(input, off),
    100                        (size_t)(len < cep->rcv_len ? len : cep->rcv_len));
     100                       (size_t)(para.len < cep->rcv_len ? para.len : cep->rcv_len));
    101101                syscall(rel_net_buf(input));
    102102
     
    104104
    105105#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    106                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t)len);
     106                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t)para.len);
    107107#else
    108                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)&len);
     108                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)&para.len);
    109109#endif
    110110                else
     
    121121
    122122#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    123                 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t)len);
     123                (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t)para.len);
    124124#else
    125                 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)&len);
     125                para.input = input;
     126                para.off = off;
     127#if API_PROTO == API_PROTO_IPV4
     128                para.rep4.portno = ntohs(udph->sport);
     129                IN_COPY_TO_HOST(&para.rep4.ipaddr, input);
     130#else
     131                para.rep6.portno = ntohs(udph->sport);
     132                IN_COPY_TO_HOST(&para.rep6.ipaddr, input);
     133#endif
     134                (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)&para.len);
    126135#endif
    127136                /*
     
    129138                 *  データを読み出さなかったことになるので、捨てる。
    130139                 */
    131                 if (cep->cb_netbuf != NULL)
    132                         syscall(rel_net_buf(cep->cb_netbuf));
     140                if (cep->cb_netbuf != NULL) {
     141                        if ((input->flags & NB_FLG_NOREL_IFOUT) == 0)
     142                                syscall(rel_net_buf(cep->cb_netbuf));
     143                        cep->cb_netbuf = NULL;
     144                        }
    133145                }
    134146        else {
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/udpn_usrreq.c

    r352 r364  
    411411                return E_NOEXS;
    412412#if defined(SUPPORT_INET6)
    413 #endif
    414 #if defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0
     413#elif defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0
    415414        switch (optname) {
    416415        case IP_MULTICAST_LOOP:
     
    488487                return E_NOEXS;
    489488#if defined(SUPPORT_INET6)
    490 #endif
    491 #if defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0
     489#elif defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0
    492490        switch (optname) {
    493491        case IP_MULTICAST_LOOP:
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/udpn_usrreq_nblk.c

    r352 r364  
    122122
    123123#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    124                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)error);
     124                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_CAN_CEP, (void*)error);
    125125#else
    126                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)&error);
     126                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_CAN_CEP, (void*)&error);
    127127#endif
    128128                else
Note: See TracChangeset for help on using the changeset viewer.