00001 /** 00002 * \addtogroup uip6 00003 * @{ 00004 */ 00005 00006 /** 00007 * \file 00008 * Neighbor discovery (RFC 4861) 00009 * \author Julien Abeille <jabeille@cisco.com> 00010 * \author Mathilde Durvy <mdurvy@cisco.com> 00011 */ 00012 00013 /* 00014 * Copyright (c) 2006, Swedish Institute of Computer Science. 00015 * All rights reserved. 00016 * 00017 * Redistribution and use in source and binary forms, with or without 00018 * modification, are permitted provided that the following conditions 00019 * are met: 00020 * 1. Redistributions of source code must retain the above copyright 00021 * notice, this list of conditions and the following disclaimer. 00022 * 2. Redistributions in binary form must reproduce the above copyright 00023 * notice, this list of conditions and the following disclaimer in the 00024 * documentation and/or other materials provided with the distribution. 00025 * 3. Neither the name of the Institute nor the names of its contributors 00026 * may be used to endorse or promote products derived from this software 00027 * without specific prior written permission. 00028 * 00029 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 00030 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00031 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00032 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 00033 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00034 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00035 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00036 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00037 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00038 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00039 * SUCH DAMAGE. 00040 * 00041 * This file is part of the Contiki operating system. 00042 * 00043 */ 00044 00045 #ifndef __UIP_ND6_H__ 00046 #define __UIP_ND6_H__ 00047 00048 #include "net/uip.h" 00049 #include "sys/stimer.h" 00050 /** 00051 * \name General 00052 * @{ 00053 */ 00054 /** \brief HOP LIMIT to be used when sending ND messages (255) */ 00055 #define UIP_ND6_HOP_LIMIT 255 00056 /** \brief INFINITE lifetime */ 00057 #define UIP_ND6_INFINITE_LIFETIME 0xFFFFFFFF 00058 /** @} */ 00059 00060 #define UIP_ND6_DEF_MAXDADNS 1 00061 00062 /** \name Configuration options */ 00063 /** @{ */ 00064 #ifndef UIP_CONF_ND6_MAX_NEIGHBORS 00065 /** \brief max number of entries in the neighbor cache */ 00066 #define UIP_CONF_ND6_MAX_NEIGHBORS 4 00067 #endif /*UIP_CONF_ND6_MAX_NEIGHBORS*/ 00068 #ifndef UIP_CONF_ND6_MAX_DEFROUTERS 00069 /** \brief max number of entries in the default router cache */ 00070 #define UIP_CONF_ND6_MAX_DEFROUTERS 2 00071 #endif /*UIP_CONF_ND6_MAX_DEFROUTERS*/ 00072 #ifndef UIP_CONF_ND6_MAX_PREFIXES 00073 /** \brief max number of entries in the prefix list */ 00074 #define UIP_CONF_ND6_MAX_PREFIXES 2 00075 #endif /*UIP_CONF_ND6_MAX_PREFIXES*/ 00076 /** @} */ 00077 00078 00079 /** \name RFC 4861 Host constant */ 00080 /** @{ */ 00081 #define UIP_ND6_MAX_RTR_SOLICITATION_DELAY 1 00082 #define UIP_ND6_RTR_SOLICITATION_INTERVAL 4 00083 #define UIP_ND6_MAX_RTR_SOLICITATIONS 3 00084 /** @} */ 00085 00086 /** \name RFC 4861 Router constants */ 00087 /** @{ */ 00088 #ifndef UIP_CONF_ND6_SEND_RA 00089 #define UIP_ND6_SEND_RA 1 /* enable/disable RA sending */ 00090 #else 00091 #define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA 00092 #endif 00093 #define UIP_ND6_MAX_RA_INTERVAL 600 00094 #define UIP_ND6_MIN_RA_INTERVAL (UIP_ND6_MAX_RA_INTERVAL / 3) 00095 #define UIP_ND6_M_FLAG 0 00096 #define UIP_ND6_O_FLAG 0 00097 #define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL 00098 00099 #define UIP_ND6_MAX_INITIAL_RA_INTERVAL 16 /*seconds*/ 00100 #define UIP_ND6_MAX_INITIAL_RAS 3 /*transmissions*/ 00101 #define UIP_ND6_MIN_DELAY_BETWEEN_RAS 3 /*seconds*/ 00102 //#define UIP_ND6_MAX_RA_DELAY_TIME 0.5 /*seconds*/ 00103 #define UIP_ND6_MAX_RA_DELAY_TIME_MS 500 /*milli seconds*/ 00104 /** @} */ 00105 00106 00107 /** \name RFC 4861 Node constant */ 00108 #define UIP_ND6_MAX_MULTICAST_SOLICIT 3 00109 #define UIP_ND6_MAX_UNICAST_SOLICIT 3 00110 #ifdef UIP_CONF_ND6_REACHABLE_TIME 00111 #define UIP_ND6_REACHABLE_TIME UIP_CONF_ND6_REACHABLE_TIME 00112 #else 00113 #define UIP_ND6_REACHABLE_TIME 30000 00114 #endif 00115 #ifdef UIP_CONF_ND6_RETRANS_TIMER 00116 #define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER 00117 #else 00118 #define UIP_ND6_RETRANS_TIMER 1000 00119 #endif 00120 #define UIP_ND6_DELAY_FIRST_PROBE_TIME 5 00121 #define UIP_ND6_MIN_RANDOM_FACTOR(x) (x / 2) 00122 #define UIP_ND6_MAX_RANDOM_FACTOR(x) ((x) + (x) / 2) 00123 /** @} */ 00124 00125 00126 /** \name ND6 option types */ 00127 /** @{ */ 00128 #define UIP_ND6_OPT_SLLAO 1 00129 #define UIP_ND6_OPT_TLLAO 2 00130 #define UIP_ND6_OPT_PREFIX_INFO 3 00131 #define UIP_ND6_OPT_REDIRECTED_HDR 4 00132 #define UIP_ND6_OPT_MTU 5 00133 /** @} */ 00134 00135 /** \name ND6 option types */ 00136 /** @{ */ 00137 #define UIP_ND6_OPT_TYPE_OFFSET 0 00138 #define UIP_ND6_OPT_LEN_OFFSET 1 00139 #define UIP_ND6_OPT_DATA_OFFSET 2 00140 00141 /** \name ND6 message length (excluding options) */ 00142 /** @{ */ 00143 #define UIP_ND6_NA_LEN 20 00144 #define UIP_ND6_NS_LEN 20 00145 #define UIP_ND6_RA_LEN 12 00146 #define UIP_ND6_RS_LEN 4 00147 /** @} */ 00148 00149 00150 /** \name ND6 option length in bytes */ 00151 /** @{ */ 00152 #define UIP_ND6_OPT_HDR_LEN 2 00153 #define UIP_ND6_OPT_PREFIX_INFO_LEN 32 00154 #define UIP_ND6_OPT_MTU_LEN 8 00155 00156 00157 /* Length of TLLAO and SLLAO options, it is L2 dependant */ 00158 #if UIP_CONF_LL_802154 00159 /* If the interface is 802.15.4. For now we use only long addresses */ 00160 #define UIP_ND6_OPT_SHORT_LLAO_LEN 8 00161 #define UIP_ND6_OPT_LONG_LLAO_LEN 16 00162 /** \brief length of a ND6 LLAO option for 802.15.4 */ 00163 #define UIP_ND6_OPT_LLAO_LEN UIP_ND6_OPT_LONG_LLAO_LEN 00164 #else /*UIP_CONF_LL_802154*/ 00165 #if UIP_CONF_LL_80211 00166 /* If the interface is 802.11 */ 00167 /** \brief length of a ND6 LLAO option for 802.11 */ 00168 #define UIP_ND6_OPT_LLAO_LEN 8 00169 #else /*UIP_CONF_LL_80211*/ 00170 /** \brief length of a ND6 LLAO option for default L2 type (e.g. Ethernet) */ 00171 #define UIP_ND6_OPT_LLAO_LEN 8 00172 #endif /*UIP_CONF_LL_80211*/ 00173 #endif /*UIP_CONF_LL_802154*/ 00174 /** @} */ 00175 00176 00177 /** \name Neighbor Advertisement flags masks */ 00178 /** @{ */ 00179 #define UIP_ND6_NA_FLAG_ROUTER 0x80 00180 #define UIP_ND6_NA_FLAG_SOLICITED 0x40 00181 #define UIP_ND6_NA_FLAG_OVERRIDE 0x20 00182 #define UIP_ND6_RA_FLAG_ONLINK 0x80 00183 #define UIP_ND6_RA_FLAG_AUTONOMOUS 0x40 00184 /** @} */ 00185 00186 00187 /** 00188 * \brief Possible states for the neighbor cache entries 00189 * 00190 * NO_STATE is for implementation purposes: a router entry contains a pointer 00191 * to a neighbor entry, which holds its ip address. If we do not know the LL 00192 * address of the router, we do not have to create a neighbor entry as per 00193 * RFC 4861. However, we still need to have the IP of the router stored in a 00194 * neighbor entry, hence we create an entry in the NO_STATE state 00195 */ 00196 typedef enum { 00197 INCOMPLETE = 0, 00198 REACHABLE = 1, 00199 STALE = 2, 00200 DELAY = 3, 00201 PROBE = 4, 00202 NO_STATE = 5 00203 } uip_neighbor_state; 00204 00205 /** 00206 * \name ND structures 00207 * @{ 00208 */ 00209 /** \brief An entry in the neighbor cache */ 00210 struct uip_nd6_neighbor { 00211 uip_ipaddr_t ipaddr; 00212 uip_lladdr_t lladdr; 00213 u8_t isrouter; 00214 uip_neighbor_state state; 00215 struct stimer reachable; 00216 struct stimer last_send; /**< last time a ND message was sent */ 00217 u8_t count_send; /**< how many ND message were already sent */ 00218 u8_t used; /**< brief is this neighbor currently used */ 00219 #if UIP_CONF_IPV6_QUEUE_PKT 00220 u8_t queue_buf[UIP_BUFSIZE - UIP_LLH_LEN]; 00221 /**< buffer to hold one packet during address resolution */ 00222 u8_t queue_buf_len; 00223 /**< length of the pkt in buffer, used as "boolean" as well*/ 00224 #endif /*UIP_CONF_QUEUE_PKT*/ 00225 }; 00226 00227 00228 /** \brief An entry in the default router list */ 00229 struct uip_nd6_defrouter { 00230 struct uip_nd6_neighbor *nb; 00231 struct stimer lifetime; 00232 /**< the lifetime contained in RA corresponds to the interval field 00233 * of the timer 00234 */ 00235 u8_t used; /**< Is this default router entry currently used */ 00236 }; 00237 00238 /** \brief A prefix list entry */ 00239 struct uip_nd6_prefix { 00240 uip_ipaddr_t ipaddr; 00241 u8_t length; 00242 /**< we do not use preferred lifetime, which is always smaller than 00243 * valid lifetime (for addr, preferred->deprecated) 00244 */ 00245 struct stimer vlifetime; 00246 u8_t is_infinite; /**< Is the prefix lifetime INFINITE */ 00247 u8_t used; /**< Is this prefix entry currently used */ 00248 }; 00249 /** @} */ 00250 00251 extern struct etimer uip_nd6_timer_periodic; 00252 00253 /** 00254 * \note 00255 * We do not use a destination cache, do next-hop determination each time 00256 * a packet needs to be sent. (info such as rtt, path mtu could be stored 00257 * in uip_conn) 00258 * 00259 */ 00260 00261 /** 00262 * \name ND message structures 00263 * @{ 00264 */ 00265 00266 /** 00267 * \brief A neighbor solicitation constant part 00268 * 00269 * Possible option is: SLLAO 00270 */ 00271 typedef struct uip_nd6_ns { 00272 uint32_t reserved; 00273 uip_ipaddr_t tgtipaddr; 00274 } uip_nd6_ns; 00275 00276 /** 00277 * \brief A neighbor advertisement constant part. 00278 * 00279 * Possible option is: TLLAO 00280 */ 00281 typedef struct uip_nd6_na { 00282 uint8_t flagsreserved; 00283 uint8_t reserved[3]; 00284 uip_ipaddr_t tgtipaddr; 00285 } uip_nd6_na; 00286 00287 /** 00288 * \brief A router solicitation constant part 00289 * 00290 * Possible option is: SLLAO 00291 */ 00292 typedef struct uip_nd6_rs { 00293 uint32_t reserved; 00294 } uip_nd6_rs; 00295 00296 /** 00297 * \brief A router advertisement constant part 00298 * 00299 * Possible options are: SLLAO, MTU, Prefix Information 00300 */ 00301 typedef struct uip_nd6_ra { 00302 uint8_t cur_ttl; 00303 uint8_t flags_reserved; 00304 uint16_t router_lifetime; 00305 uint32_t reachable_time; 00306 uint32_t retrans_timer; 00307 } uip_nd6_ra; 00308 00309 /** 00310 * \brief A redirect message constant part 00311 * 00312 * Possible options are: TLLAO, redirected header 00313 */ 00314 typedef struct uip_nd6_redirect { 00315 uint32_t reserved; 00316 uip_ipaddr_t tgtipaddress; 00317 uip_ipaddr_t destipaddress; 00318 } uip_nd6_redirect; 00319 /** @} */ 00320 00321 /** 00322 * \name ND Option structures 00323 * @{ 00324 */ 00325 00326 /** \brief ND option header */ 00327 typedef struct uip_nd6_opt_hdr { 00328 uint8_t type; 00329 uint8_t len; 00330 } uip_nd6_opt_hdr; 00331 00332 /** \brief ND option prefix information */ 00333 typedef struct uip_nd6_opt_prefix_info { 00334 uint8_t type; 00335 uint8_t len; 00336 uint8_t preflen; 00337 uint8_t flagsreserved1; 00338 uint32_t validlt; 00339 uint32_t preferredlt; 00340 uint32_t reserved2; 00341 uip_ipaddr_t prefix; 00342 } uip_nd6_opt_prefix_info ; 00343 00344 /** \brief ND option MTU */ 00345 typedef struct uip_nd6_opt_mtu { 00346 uint8_t type; 00347 uint8_t len; 00348 uint16_t reserved; 00349 uint32_t mtu; 00350 } uip_nd6_opt_mtu; 00351 00352 /** \struct Redirected header option */ 00353 typedef struct uip_nd6_opt_redirected_hdr { 00354 uint8_t type; 00355 uint8_t len; 00356 uint8_t reserved[6]; 00357 } uip_nd6_opt_redirected_hdr; 00358 /** @} */ 00359 00360 /** 00361 * \name ND Neighbor Cache, Router List and Prefix List handling functions 00362 * @{ 00363 */ 00364 /** 00365 * \brief Initialize Neighbor Discovery structures 00366 */ 00367 void uip_nd6_init(void); 00368 00369 /** 00370 * \brief Periodic processing of Neighbor Discovery Structures 00371 */ 00372 void uip_nd6_periodic(void); 00373 00374 /** 00375 * \brief Look for a neighbor cache entry corresponding to a specific IP 00376 * address 00377 * \param ipaddr the specific IP address 00378 * \return the corresponding neighbor cache entry 00379 */ 00380 struct uip_nd6_neighbor *uip_nd6_nbrcache_lookup(uip_ipaddr_t *ipaddr); 00381 00382 /** 00383 * \brief Add a neighbor cache entry 00384 * \param ipaddr the IP address of the entry 00385 * \param lladdr the layer 2 address of the entry 00386 * \param isrouter true is the entry is a router 00387 * \param state the state of the entry 00388 * \return the new neighbor or updated cache entry 00389 */ 00390 struct uip_nd6_neighbor * uip_nd6_nbrcache_add(uip_ipaddr_t *ipaddr, 00391 uip_lladdr_t *lladdr, 00392 u8_t isrouter, 00393 uip_neighbor_state state); 00394 /** 00395 * \brief Returns a default router 00396 */ 00397 struct uip_nd6_defrouter * uip_nd6_choose_defrouter(void); 00398 00399 /** 00400 * \brief Find a default router corresponding to a given neighbor cache entry 00401 * \param neighbor the neighbor cache entry 00402 * \return the corresponding router if any 00403 */ 00404 struct uip_nd6_defrouter * 00405 uip_nd6_defrouter_lookup(struct uip_nd6_neighbor *neighbor); 00406 00407 /** 00408 * \brief Remove a default router 00409 * \param router to be removed 00410 */ 00411 void uip_nd6_defrouter_rm(struct uip_nd6_defrouter *router); 00412 00413 /** 00414 * \brief Add a default router 00415 * \param neighbor the corresponding neighbor cache entry 00416 * \param interval the lifetime of the router 00417 * \return the new or updated defrouter entry 00418 */ 00419 struct uip_nd6_defrouter * 00420 uip_nd6_defrouter_add(struct uip_nd6_neighbor *neighbor, unsigned long interval); 00421 00422 /** 00423 * \brief Check if an IP address in on-link by looking at prefix list 00424 * \param ipaddr an IP address 00425 * \return true if on-link 00426 */ 00427 u8_t uip_nd6_is_addr_onlink(uip_ipaddr_t *ipaddr); 00428 00429 /** 00430 * \brief Find a given prefix 00431 * \param ipaddr an IP address 00432 * \return the corresponding prefix if any 00433 */ 00434 struct uip_nd6_prefix * 00435 uip_nd6_prefix_lookup(uip_ipaddr_t *ipaddr); 00436 00437 /** 00438 * \brief Add a prefix 00439 * \param ipaddr the IP address of the prefix 00440 * \param length the length of the prefix 00441 * \param interval the lifetime of the prefix 00442 * \return the new or updated prefix entry 00443 */ 00444 struct uip_nd6_prefix * 00445 uip_nd6_prefix_add(uip_ipaddr_t *ipaddr, u8_t length, unsigned long interval); 00446 00447 /** 00448 * \brief Remove a prefix from th eprefix list 00449 * \param prefix pointer to the prefix to be removed 00450 */ 00451 void 00452 uip_nd6_prefix_rm(struct uip_nd6_prefix *prefix); 00453 /** @} */ 00454 00455 00456 /** 00457 * \name ND Messages Processing and Generation 00458 * @{ 00459 */ 00460 /** 00461 * \brief Process a neighbor solicitation 00462 * 00463 * The NS can be received in 3 cases (procedures): 00464 * - sender is performing DAD (ip src = unspecified, no SLLAO option) 00465 * - sender is performing NUD (ip dst = unicast) 00466 * - sender is performing address resolution (ip dest = solicited node mcast 00467 * address) 00468 * 00469 * We do: 00470 * - if the tgt belongs to me, reply, otherwise ignore 00471 * - if i was performing DAD for the same address, two cases: 00472 * -- I already sent a NS, hence I win 00473 * -- I did not send a NS yet, hence I lose 00474 * 00475 * If we need to send a NA in response (i.e. the NS was done for NUD, or 00476 * address resolution, or DAD and there is a conflict), we do it in this 00477 * function: set src, dst, tgt address in the three cases, then for all cases 00478 * set the rest, including SLLAO 00479 * 00480 */ 00481 void 00482 uip_nd6_ns_input(void); 00483 00484 /** 00485 * \brief Send a neighbor solicitation, send a Neighbor Advertisement 00486 * \param src pointer to the src of the NS if known 00487 * \param dest pointer to ip address to send the NS, for DAD or ADDR Resol, 00488 * MUST be NULL, for NUD, must be correct unicast dest 00489 * \param tgt pointer to ip address to fill the target address field, must 00490 * not be NULL 00491 * 00492 * - RFC 4861, 7.2.2 : 00493 * "If the source address of the packet prompting the solicitation is the 00494 * same as one of the addresses assigned to the outgoing interface, that 00495 * address SHOULD be placed in the IP Source Address of the outgoing 00496 * solicitation. Otherwise, any one of the addresses assigned to the 00497 * interface should be used." 00498 * This is why we have a src ip address as argument. If NULL, we will do 00499 * src address selection, otherwise we use the argument. 00500 * 00501 * - we check if it is a NS for Address resolution or NUD, if yes we include 00502 * a SLLAO option, otherwise no. 00503 */ 00504 void 00505 uip_nd6_ns_output(uip_ipaddr_t *src, uip_ipaddr_t *dest, uip_ipaddr_t *tgt); 00506 00507 /** 00508 * \brief Process a Neighbor Advertisement 00509 * 00510 * we might have to send a pkt that had been buffered while address 00511 * resolution was performed (if we support buffering, see UIP_CONF_QUEUE_PKT) 00512 * 00513 * As per RFC 4861, on link layer that have addresses, TLLAO options MUST be 00514 * included when responding to multicast solicitations, SHOULD be included in 00515 * response to unicast (here we assume it is for now) 00516 * 00517 * NA can be received after sending NS for DAD, Address resolution or NUD. Can 00518 * be unsolicited as well. 00519 * It can trigger update of the state of the neighbor in the neighbor cache, 00520 * router in the router list. 00521 * If the NS was for DAD, it means DAD failed 00522 * 00523 */ 00524 void 00525 uip_nd6_na_input(void); 00526 00527 #if UIP_CONF_ROUTER 00528 #if UIP_ND6_SEND_RA 00529 /** 00530 * \brief Process a Router Solicitation 00531 * 00532 */ 00533 void uip_nd6_rs_input(void); 00534 00535 /** 00536 * \brief send a Router Advertisement 00537 * 00538 * Only for router, for periodic as well as sollicited RA 00539 */ 00540 void uip_nd6_ra_output(uip_ipaddr_t *dest); 00541 #endif /* UIP_ND6_SEND_RA */ 00542 #endif /*UIP_CONF_ROUTER*/ 00543 00544 /** 00545 * \brief Send a Router Solicitation 00546 * 00547 * src is chosen through the uip_netif_select_src function. If src is 00548 * unspecified (i.e. we do not have a preferred address yet), then we do not 00549 * put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do. 00550 * 00551 * RS message format, 00552 * possible option is SLLAO, MUST NOT be included if source = unspecified 00553 * SHOULD be included otherwise 00554 */ 00555 void uip_nd6_rs_output(void); 00556 00557 /** 00558 * 00559 * \brief process a Router Advertisement 00560 * 00561 * - Possible actions when receiving a RA: add router to router list, 00562 * recalculate reachable time, update link hop limit, update retrans timer. 00563 * - If MTU option: update MTU. 00564 * - If SLLAO option: update entry in neighbor cache 00565 * - If prefix option: start autoconf, add prefix to prefix list 00566 */ 00567 void 00568 uip_nd6_ra_input(void); 00569 /** @} */ 00570 00571 00572 void 00573 uip_appserver_addr_get(uip_ipaddr_t *ipaddr); 00574 /*--------------------------------------*/ 00575 /******* ANNEX - message formats ********/ 00576 /*--------------------------------------*/ 00577 00578 /* 00579 * RS format. possible option is SLLAO 00580 * 0 1 2 3 00581 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00582 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00583 * | Type | Code | Checksum | 00584 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00585 * | Reserved | 00586 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00587 * | Options ... 00588 * +-+-+-+-+-+-+-+-+-+-+-+- 00589 * 00590 * 00591 * RA format. possible options: prefix information, MTU, SLLAO 00592 * 0 1 2 3 00593 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00594 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00595 * | Type | Code | Checksum | 00596 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00597 * | Cur Hop Limit |M|O| Reserved | Router Lifetime | 00598 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00599 * | Reachable Time | 00600 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00601 * | Retrans Timer | 00602 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00603 * | Options ... 00604 * +-+-+-+-+-+-+-+-+-+-+-+- 00605 * 00606 * 00607 * NS format: options should be SLLAO 00608 * 0 1 2 3 00609 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00610 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00611 * | Type | Code | Checksum | 00612 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00613 * | Reserved | 00614 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00615 * | | 00616 * + + 00617 * | | 00618 * + Target Address + 00619 * | | 00620 * + + 00621 * | | 00622 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00623 * | Options ... 00624 * +-+-+-+-+-+-+-+-+-+-+-+- 00625 * 00626 * 00627 * NA message format. possible options is TLLAO 00628 * 00629 * 0 1 2 3 00630 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00631 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00632 * | Type | Code | Checksum | 00633 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00634 * |R|S|O| Reserved | 00635 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00636 * | | 00637 * + + 00638 * | | 00639 * + Target Address + 00640 * | | 00641 * + + 00642 * | | 00643 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00644 * | Options ... 00645 * +-+-+-+-+-+-+-+-+-+-+-+- 00646 * 00647 * 00648 * Redirect message format. Possible options are TLLAO and Redirected header 00649 * 00650 * 0 1 2 3 00651 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00652 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00653 * | Type | Code | Checksum | 00654 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00655 * | Reserved | 00656 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00657 * | | 00658 * + + 00659 * | | 00660 * + Target Address + 00661 * | | 00662 * + + 00663 * | | 00664 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00665 * | | 00666 * + + 00667 * | | 00668 * + Destination Address + 00669 * | | 00670 * + + 00671 * | | 00672 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00673 * | Options ... 00674 * +-+-+-+-+-+-+-+-+-+-+-+- 00675 * 00676 * 00677 * SLLAO/TLLAO option: 00678 * 0 1 2 3 00679 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00680 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00681 * | Type | Length | Link-Layer Address ... 00682 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00683 * 00684 * 00685 * Prefix information option 00686 * 0 1 2 3 00687 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00688 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00689 * | Type | Length | Prefix Length |L|A| Reserved1 | 00690 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00691 * | Valid Lifetime | 00692 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00693 * | Preferred Lifetime | 00694 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00695 * | Reserved2 | 00696 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00697 * | | 00698 * + + 00699 * | | 00700 * + Prefix + 00701 * | | 00702 * + + 00703 * | | 00704 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00705 * 00706 * 00707 * MTU option 00708 * 0 1 2 3 00709 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00710 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00711 * | Type | Length | Reserved | 00712 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00713 * | MTU | 00714 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00715 * 00716 * 00717 * Redirected header option 00718 * 00719 * 0 1 2 3 00720 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00721 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00722 * | Type | Length | Reserved | 00723 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00724 * | Reserved | 00725 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00726 * | | 00727 * ~ IP header + data ~ 00728 * | | 00729 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00730 * 00731 */ 00732 #endif /* __UIP_ND6_H__ */ 00733 00734 /** @} */