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.h

    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 *
     
    6969
    7070/*
    71  *  バイトオーダの定義
    72  */
    73 
    74 #define _NET_CFG_LITTLE_ENDIAN  1234
    75 #define _NET_CFG_BIG_ENDIAN     4321
    76 
    77 #ifdef TARGET_KERNEL_ASP
    78 
    79 #if defined(SIL_ENDIAN_LITTLE)
    80 
    81 #define _NET_CFG_BYTE_ORDER     _NET_CFG_LITTLE_ENDIAN
    82 
    83 #elif defined(SIL_ENDIAN_BIG)
    84 
    85 #define _NET_CFG_BYTE_ORDER     _NET_CFG_BIG_ENDIAN
    86 
    87 #else   /* of #if defined(SIL_ENDIAN_BIG) */
    88 
    89 #error "SIL_ENDIAN expected."
    90 
    91 #endif  /* of #if defined(SIL_ENDIAN_BIG) */
    92 
    93 #endif  /* of #ifdef TARGET_KERNEL_ASP */
    94 
    95 #ifdef TARGET_KERNEL_JSP
    96 
    97 #if SIL_ENDIAN == SIL_ENDIAN_LITTLE
    98 
    99 #define _NET_CFG_BYTE_ORDER     _NET_CFG_LITTLE_ENDIAN
    100 
    101 #elif SIL_ENDIAN == SIL_ENDIAN_BIG      /* of #if SIL_ENDIAN == SIL_ENDIAN_LITTLE */
    102 
    103 #define _NET_CFG_BYTE_ORDER     _NET_CFG_BIG_ENDIAN
    104 
    105 #else   /* of #if SIL_ENDIAN == SIL_ENDIAN_LITTLE */
    106 
    107 #error "SIL_ENDIAN expected."
    108 
    109 #endif  /* of #if SIL_ENDIAN == SIL_ENDIAN_LITTLE */
    110 
    111 #endif  /* of #ifdef TARGET_KERNEL_JSP */
    112 
    113 /*
    114  *  バイトオーダ変換の定義
    115  */
    116 
    117 #if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN
    118 
    119 #define ntohs(n)                ((uint16_t)n)
    120 #define htons(h)                ((uint16_t)h)
    121 #define ntohl(n)                ((uint32_t)n)
    122 #define htonl(h)                ((uint32_t)h)
    123 
    124 #define NTOHS(n)
    125 #define HTONS(h)
    126 #define NTOHL(n)
    127 #define HTONL(h)
    128 
    129 /*
    130  *  注意: IPヘッダ以降は、4 バイト境界にアラインされている事を
    131  *        前提としているが、4 バイト境界でアクセスする
    132  *        プロセッサで、ネットワーク側のデータが、4 バイト境界にアライン
    133  *        されていない場合は、ntoahl、ahtonl、nahcmpl を使用すること。
    134  */
    135 
    136 #define ntoahl(h,n)             memcpy((uint8_t*)&(h),(n),4)
    137 #define ahtonl(n,h)             memcpy((n),(uint8_t*)&(h),4)
    138 
    139 #define nahcmpl(n,h)            memcmp((n),(uint8_t*)&(h),4)
    140 
    141 #elif _NET_CFG_BYTE_ORDER == _NET_CFG_LITTLE_ENDIAN
    142 
    143 #ifndef NET_REV_ENDIAN_HWORD
    144 
    145 #define NET_REV_ENDIAN_HWORD(d) ((uint16_t)((((uint16_t)(d)&0xff)<<8)|(((uint16_t)(d)>>8)&0xff)))
    146 
    147 #endif  /* of #ifndef NET_REV_ENDIAN_HWORD */
    148 
    149 #ifndef NET_REV_ENDIAN_WORD
    150 
    151 #define NET_REV_ENDIAN_WORD(d)  ((uint32_t)((((uint32_t)(d)&0xff)<<24)|(((uint32_t)(d)&0xff00)<<8)| \
    152                                             (((uint32_t)(d)>>8)&0xff00)|(((uint32_t)(d)>>24)&0xff)))
    153 
    154 #endif  /* of #ifndef NET_REV_ENDIAN_WORD */
    155 
    156 #define ntohs(n)                NET_REV_ENDIAN_HWORD(n)
    157 #define htons(h)                NET_REV_ENDIAN_HWORD(h)
    158 #define ntohl(n)                NET_REV_ENDIAN_WORD(n)
    159 #define htonl(h)                NET_REV_ENDIAN_WORD(h)
    160 
    161 #define NTOHS(n)                ((n)=NET_REV_ENDIAN_HWORD(n))
    162 #define HTONS(h)                ((h)=NET_REV_ENDIAN_HWORD(h))
    163 #define NTOHL(n)                ((n)=NET_REV_ENDIAN_WORD(n))
    164 #define HTONL(h)                ((h)=NET_REV_ENDIAN_WORD(h))
    165 
    166 /*
    167  *  注意: IPヘッダ以降は、4 バイト境界にアラインされている事を
    168  *        前提としているが、4 バイト境界でアクセスする
    169  *        プロセッサで、ネットワーク側のデータが、4 バイト境界にアライン
    170  *        されていない場合は、ntoahl、ahtonl、nahcmpl を使用すること。
    171  */
    172 
    173 #ifndef _MACRO_ONLY
    174 
    175 extern void rev_memcpy_word (uint8_t *dst, uint8_t *src);
    176 extern int  rev_memcmp_word (uint8_t *data1, uint8_t *data2);
    177 
    178 #endif  /* of #ifndef _MACRO_ONLY */
    179 
    180 #define ntoahl(h,n)             rev_memcpy_word((uint8_t*)&(h),(n))
    181 #define ahtonl(n,h)             rev_memcpy_word((n),(uint8_t*)&(h))
    182 #define nahcmpl(n,h)            rev_memcmp_word((n),(uint8_t*)&(h))
    183 
    184 #else   /* #if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN */
    185 
    186 #error "_NET_CFG_BYTE_ORDER expected."
    187 
    188 #endif  /* #if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN */
    189 
    190 /*
    19171 *  プロトコルを識別するフラグに関する定義
    19272 *
     
    19979#define PROTO_FLG_PPP_LCP       ULONG_C(0x00000008)     /* ppp_lcp.c    */
    20080#define PROTO_FLG_PPP_IPCP      ULONG_C(0x00000010)     /* ppp_ipcp.c   */
    201 #define PROTO_FLG_PPP_CCP       ULONG_C(0x00000020)     /* ppp_ccp.c    */
    202 #define PROTO_FLG_PPP_PAP       ULONG_C(0x00000040)     /* ppp_upap.c   */
    203 #define PROTO_FLG_PPP_MODEM     ULONG_C(0x00000080)     /* ppp_modem.c  */
    204 #define PROTO_FLG_PPP           ULONG_C(0x00000100)     /* ppp.c        */
     81#define PROTO_FLG_PPP_IPV6CP    ULONG_C(0x00000020)     /* ppp_ipv6cp.c */
     82#define PROTO_FLG_PPP_CCP       ULONG_C(0x00000040)     /* ppp_ccp.c    */
     83#define PROTO_FLG_PPP_PAP       ULONG_C(0x00000080)     /* ppp_upap.c   */
     84#define PROTO_FLG_PPP_MODEM     ULONG_C(0x00000100)     /* ppp_modem.c  */
     85#define PROTO_FLG_PPP           ULONG_C(0x00000200)     /* ppp.c        */
    20586
    20687#define PROTO_FLG_ETHER_NIC     ULONG_C(0x00000001)     /* if_??.c      */
     
    21697#define PROTO_FLG_IP4           ULONG_C(0x00010000)     /* ip_*.c       */
    21798#define PROTO_FLG_ICMP4         ULONG_C(0x00040000)     /* ip_icmp.c    */
     99#define PROTO_FLG_IGMP          ULONG_C(0x00080000)     /* ip_igmp.c    */
    218100
    219101#define PROTO_FLG_IP6           ULONG_C(0x00100000)     /* ip6_*.c      */
     
    236118#define AT_INET6                UINT_C(0x20)            /* IPv6 アドレス    */
    237119
     120/*
     121 *  IPv4 UDPオプションの定義
     122 */
     123
     124#define IP_MULTICAST_IF    32
     125#define IP_MULTICAST_TTL   33
     126#define IP_MULTICAST_LOOP  34
     127#define IP_ADD_MEMBERSHIP  35
     128#define IP_DROP_MEMBERSHIP 36
     129#define IP_MSFILTER        41
     130
    238131#if !defined(TOPPERS_MACRO_ONLY) && !defined(_MACRO_ONLY)
    239132
Note: See TracChangeset for help on using the changeset viewer.