Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/icmp6.h
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/icmp6.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 _IP_ICMP6_H_ 103 103 104 #ifdef SUPPORT_INET6105 106 104 /* 107 105 * ICMPv6 ヘッダ … … 117 115 uint8_t data8[4]; 118 116 } data; 119 } __attribute__((packed, aligned(2))) T_ICMP6_HDR;117 } __attribute__((packed, aligned(2))) T_ICMP6_HDR; 120 118 121 119 #define icmp6_data32 data.data32 … … 133 131 #define GET_ICMP6_SDU(nbuf,ihoff) ((uint8_t*)((nbuf)->buf) + ihoff + ICMP6_HDR_SIZE) 134 132 135 #define GET_IP6_ICMP6_HDR_SIZE(nbuf) (GET_IP6_HDR_SIZE( GET_IP6_HDR(nbuf)) + ICMP6_HDR_SIZE)133 #define GET_IP6_ICMP6_HDR_SIZE(nbuf) (GET_IP6_HDR_SIZE(nbuf) + ICMP6_HDR_SIZE) 136 134 #define GET_IF_IP6_ICMP6_HDR_SIZE(nbuf) (IF_HDR_SIZE + GET_IP6_ICMP6_HDR_SIZE(nbuf)) 137 135 … … 218 216 T_IN6_ADDR target; 219 217 /* この後にオプションが続く */ 220 } __attribute__((packed, aligned(2)))T_NEIGHBOR_SOLICIT_HDR;218 } T_NEIGHBOR_SOLICIT_HDR; 221 219 222 220 #define NEIGHBOR_SOLICIT_HDR_SIZE (sizeof(T_NEIGHBOR_SOLICIT_HDR)) … … 230 228 231 229 #define GET_IP6_NEIGHBOR_SOLICIT_HDR_SIZE(nbuf) \ 232 (GET_IP6_HDR_SIZE( GET_IP6_HDR(nbuf)) + NEIGHBOR_SOLICIT_HDR_SIZE)230 (GET_IP6_HDR_SIZE(nbuf) + NEIGHBOR_SOLICIT_HDR_SIZE) 233 231 #define GET_IF_IP6_NEIGHBOR_SOLICIT_HDR_SIZE(nbuf) \ 234 232 (GET_IP6_NEIGHBOR_SOLICIT_HDR_SIZE(nbuf) + IF_HDR_SIZE) … … 242 240 T_IN6_ADDR target; 243 241 /* この後にオプションが続く */ 244 } __attribute__((packed, aligned(2))) T_NEIGHBOR_ADVERT_HDR;242 } __attribute__((packed, aligned(2))) T_NEIGHBOR_ADVERT_HDR; 245 243 246 244 /* ICMP6 ヘッダのデータ部の定義 */ … … 261 259 262 260 #define GET_IP6_NEIGHBOR_ADVERT_HDR_SIZE(nbuf) \ 263 (GET_IP6_HDR_SIZE( GET_IP6_HDR(nbuf)) + NEIGHBOR_ADVERT_HDR_SIZE)261 (GET_IP6_HDR_SIZE(nbuf) + NEIGHBOR_ADVERT_HDR_SIZE) 264 262 #define GET_IF_IP6_NEIGHBOR_ADVERT_HDR_SIZE(nbuf) \ 265 263 (GET_IP6_NEIGHBOR_ADVERT_HDR_SIZE(nbuf) + IF_HDR_SIZE) … … 285 283 /* 286 284 * ルータ通知 285 * 286 * RFC4291: IP Version 6 Addressing Architecture 287 * RFC4941: Privacy Extensions for Stateless Address Autoconfiguration in IPv6 288 * RFC6106: IPv6 Router Advertisement Options for DNS Configuration 287 289 */ 288 290 … … 292 294 uint32_t retransmit; /* [ms] 近隣要請送信間隔 */ 293 295 /* この後にオプションが続く */ 294 } __attribute__((packed, aligned(2))) T_ROUTER_ADVERT_HDR;296 } __attribute__((packed, aligned(2))) T_ROUTER_ADVERT_HDR; 295 297 296 298 /* ICMP6 ヘッダのデータ部の定義 */ … … 311 313 312 314 #define GET_IP6_ROUTER_ADVERT_HDR_SIZE(nbuf) \ 313 (GET_IP6_HDR_SIZE( GET_IP6_HDR(nbuf)) + ROUTER_ADVERT_HDR_SIZE)315 (GET_IP6_HDR_SIZE(nbuf) + ROUTER_ADVERT_HDR_SIZE) 314 316 #define GET_IF_IP6_ROUTER_ADVERT_HDR_SIZE(nbuf) \ 315 317 (GET_IP6_ROUTER_ADVERT_HDR_SIZE(nbuf) + IF_HDR_SIZE) … … 324 326 325 327 /* 328 * M: RA以外の方法で自動的にアドレスを設定することを許可する。 329 * O: RA以外の方法で自動的にアドレス以外の情報を設定することをを許可する。 330 * 331 * M O 332 * ON ON アドレスとそれ以外の情報をDHCPv6で設定する(statefull) 333 * ON OFF アドレスはDHCPv6で設定するが、それ以外は手動で設定する。 334 * OFF ON アドレスは RA で設定するが、それ以外の情報をDHCPv6で設定する(stateless) 335 * OFF OFF DHCPv6 は使用しない。 336 */ 337 338 /* 326 339 * ルータ要請 327 340 */ … … 329 342 typedef struct t_router_solicit_hdr { 330 343 T_ICMP6_HDR hdr; 331 } __attribute__((packed, aligned(2))) T_ROUTER_SOLICIT_HDR;344 } __attribute__((packed, aligned(2))) T_ROUTER_SOLICIT_HDR; 332 345 333 346 /* ICMP6 ヘッダのデータ部の定義 */ … … 347 360 348 361 #define GET_IP6_ROUTER_SOLICIT_HDR_SIZE(nbuf) \ 349 (GET_IP6_HDR_SIZE( GET_IP6_HDR(nbuf)) + ROUTER_SOLICIT_HDR_SIZE)362 (GET_IP6_HDR_SIZE(nbuf) + ROUTER_SOLICIT_HDR_SIZE) 350 363 #define GET_IF_IP6_ROUTER_SOLICIT_HDR_SIZE(nbuf) \ 351 364 (GET_IP6_ROUTER_SOLICIT_HDR_SIZE(nbuf) + IF_HDR_SIZE) … … 360 373 T_ICMP6_HDR hdr; 361 374 T_IN6_ADDR target; 362 } __attribute__((packed, aligned(2))) T_NEIGHBOR_HDR;375 } __attribute__((packed, aligned(2))) T_NEIGHBOR_HDR; 363 376 364 377 /* 近隣探索オプションヘッダ */ … … 367 380 uint8_t type; /* オプションタイプ */ 368 381 uint8_t len; /* オプション長、単位は 8 バイト */ 369 } __attribute__((packed, aligned(2))) T_ND_OPT_HDR;382 } __attribute__((packed, aligned(2))) T_ND_OPT_HDR; 370 383 371 384 #define ND_OPT_HDR_SIZE (sizeof(T_ND_OPT_HDR)) … … 393 406 uint32_t reserved; 394 407 T_IN6_ADDR prefix; /* プレフィックス */ 395 } __attribute__((packed, aligned(2))) T_ND_OPT_PREFIX_INFO;408 } __attribute__((packed, aligned(2))) T_ND_OPT_PREFIX_INFO; 396 409 397 410 #define ND_OPT_PI_FLAG_ONLINK UINT_C(0x80) /* オンリンクプレフィックス */ … … 405 418 uint16_t reserved; 406 419 uint32_t mtu; /* MTU */ 407 } __attribute__((packed, aligned(2))) T_ND_OPT_MTU_HDR;420 } __attribute__((packed, aligned(2))) T_ND_OPT_MTU_HDR; 408 421 409 422 /* … … 416 429 T_IN6_ADDR dst; /* 向け直しの終点アドレス */ 417 430 /* この後にオプションが続く */ 418 } __attribute__((packed, aligned(2))) T_ND_REDIRECT_HDR;431 } __attribute__((packed, aligned(2))) T_ND_REDIRECT_HDR; 419 432 420 433 #define ND_REDIRECT_HDR_SIZE (sizeof(T_ND_REDIRECT_HDR)) … … 480 493 #endif /* of #ifdef ICMP_CFG_CALLBACK_ECHO_REPLY */ 481 494 482 #endif /* of #ifdef SUPPORT_INET6 */483 484 495 #endif /* of #ifndef _IP_ICMP6_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.