Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/ip6_var.h
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/ip6_var.h
r321 r331 2 2 * TINET (TCP/IP Protocol Stack) 3 3 * 4 * Copyright (C) 2001-20 09by Dep. of Computer Science and Engineering4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * … … 102 102 #define _IP6_VAR_H_ 103 103 104 #ifdef SUPPORT_INET6105 106 104 /* 107 105 * IPv6 ヘッダ・ペイロードアクセスマクロ … … 114 112 #define GET_IP6_NEXT_HDR(nbuf) ((uint8_t*)((nbuf)->buf) + IF_IP6_HDR_SIZE) 115 113 116 #define GET_IP6_HDR_SIZE(iph) (get_ip6_hdr_size(iph)) 117 #define GET_IP6_SDU_SIZE(iph) (ntohs((iph)->plen)) 118 #define GET_IF_IP6_HDR_SIZE(nbuf) (IF_HDR_SIZE + (GET_IP6_HDR_SIZE(GET_IP6_HDR(nbuf)))) 119 120 #define SET_IP6_SDU_SIZE(iph,slen) ((iph)->plen=htons(slen)) 114 #define GET_IP6_HDR_SIZE(nbuf) (get_ip6_hdr_size(nbuf)) 115 #define GET_IP6_SDU_SIZE(nbuf) (ntohs(GET_IP6_HDR(nbuf)->plen)) 116 #define GET_IF_IP6_HDR_SIZE(nbuf) (IF_HDR_SIZE + (GET_IP6_HDR_SIZE(nbuf))) 117 118 #define SET_IP6_CF(nbuf,cf) (GET_IP6_HDR(nbuf)->vcf=htonl(IP6_MAKE_VCF(IP6_VCF_V(ntohl(GET_IP6_HDR(nbuf)->vcf)),cf))) 119 #define SET_IP6_SDU_SIZE(nbuf,slen) (GET_IP6_HDR(nbuf)->plen=htons(slen)) 121 120 122 121 /* ip6_output のフラグ */ … … 144 143 145 144 /* 146 * IPv4 と IPv6 をコンパイル時に選択するためのマクロ147 */148 149 #define T_TCP_IP_Q_HDR T_TCP_IP6_Q_HDR150 151 #define IF_IP_HDR_SIZE IF_IP6_HDR_SIZE152 153 #define GET_IP_HDR(nbuf) GET_IP6_HDR(nbuf)154 #define GET_IP_SDU(nbuf) GET_IP6_SDU(nbuf)155 156 #define GET_IP_HDR_SIZE(iph) GET_IP6_HDR_SIZE(iph)157 #define GET_IP_SDU_SIZE(iph) GET_IP6_SDU_SIZE(iph)158 #define GET_IF_IP_HDR_SIZE(nbuf) GET_IF_IP6_HDR_SIZE(nbuf)159 160 #define SET_IP_SDU_SIZE(iph,len) SET_IP6_SDU_SIZE(iph,len)161 162 #define IP_OUTPUT(nbuf,tmout) ip6_output(nbuf,0,tmout)163 #define IP_INIT() ip6_init()164 #define IP_REMOVE_OPTIONS(nbuf) ip6_remove_exthdrs(nbuf)165 166 /*167 145 * IPv6 の MMTU サイズのネットワークバッファ 168 146 */ 147 148 #if defined(IF_HDR_SIZE) 169 149 170 150 typedef struct t_net_buf_ipv6_mmtu { … … 181 161 /* バッファ本体 */ 182 162 } T_NET_BUF_IPV6_MMTU; 163 164 #endif /* of #if defined(IF_HDR_SIZE) */ 183 165 184 166 /* … … 258 240 */ 259 241 260 typedef struct t_ tcp_ip6_q_hdr {242 typedef struct t_ip6_tcp_q_hdr { 261 243 uint8_t vc; /* Version: 4 bit */ 262 244 uint8_t cf; /* Traffic Class: 8 bit */ … … 268 250 T_IN6_ADDR src; /* Source Address */ 269 251 T_IN6_ADDR dst; /* Destination Address */ 270 } __attribute__((packed, aligned(2))) T_TCP_IP6_Q_HDR;252 } __attribute__((packed, aligned(2))) T_IP6_TCP_Q_HDR; 271 253 272 254 #ifdef SUPPORT_MIB … … 304 286 305 287 /* 288 * 変数 289 */ 290 291 extern uint8_t ip6_defhlim; 292 293 /* 306 294 * 関数 307 295 */ … … 310 298 extern void ip6_init (void); 311 299 extern uint8_t *ip6_get_prev_hdr (T_NET_BUF *nbuf, uint_t off); 312 extern uint_t get_ip6_hdr_size (T_ IP6_HDR *iph);300 extern uint_t get_ip6_hdr_size (T_NET_BUF *nbuf); 313 301 extern ER_UINT ip6_nexthdr (T_NET_BUF *nbuf, uint_t off, uint_t proto, uint_t *nextp); 314 302 extern ER_UINT ip6_lasthdr (T_NET_BUF *nbuf, uint_t off, uint_t proto, uint_t *nextp); … … 320 308 extern ER ip6_remove_exthdrs (T_NET_BUF *nbuf); 321 309 322 #endif /* of #ifdef SUPPORT_INET6 */323 324 310 #endif /* of #ifndef _IP6_VAR_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.