00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef FIP_ND6_DS_H_
00045 #define FIP_ND6_DS_H_
00046
00047 #include <stddef.h>
00048 #include "fip_ds6.h"
00049
00050
00051 typedef fip_ds6_index_t fip_nd6_index_t;
00052
00053 typedef fip_ds6_searchStatus_t fip_nd6_searchStatus_t;
00054
00055
00056 typedef enum {
00057 NS_UNUSED = 0,
00058 NS_STALE,
00059 NS_DELAY,
00060 NS_INCOMPLETE,
00061 NS_PROBE,
00062 NS_REACHABLE
00063 } fip_nd6_nbrstate_t ;
00064
00065
00066
00067 typedef struct {
00068 fip_ip6addr_t ipaddr;
00069 fip_lladdr_t lladdr;
00070 fip_nd6_nbrstate_t state;
00071 unsigned char isRouter: 1;
00072 } fip_nd6_neighbourCache_t;
00073
00074
00075
00076 #define fip_nd6_neighbourCache_getState(ifnum, index) fip_neighbourCache[ifnum][index].state
00077
00078 #define fip_nd6_neighbourCache_setState(ifnum, index, newstate) \
00079 fip_neighbourCache[ifnum][index].state = newstate
00080
00081 #define fip_nd6_neighbourCache_getPtr(ifnum) fip_neighbourCache[ifnum]
00082
00083 #define fip_nd6_neighbourCache_setLLAddr(ifnum, index, thislladdr, thislen) { \
00084 fip_memcpy_ucharLen(fip_neighbourCache[ifnum][index].lladdr.addr, thislladdr, thislen); \
00085 fip_neighbourCache[ifnum][index].lladdr.len = thislen; }
00086
00087 #define fip_nd6_neighbourCache_getLLAddrPtr(ifnum, index) fip_neighbourCache[ifnum][index].lladdr.addr
00088 #define fip_nd6_neighbourCache_getLLAddrLen(ifnum, index) fip_neighbourCache[ifnum][index].lladdr.len
00089
00090 #define fip_nd6_neighbourCache_setIPAddr(iifnum, index, thisipaddr) \
00091 fip_memcpy_ucharLen(fip_neighbourCache[ifnum][index].ipaddr.addr, (thisipaddr), 16)
00092
00093 #define fip_nd6_neighbourCache_setIsRouter(ifnum, index, flag)\
00094 fip_neighbourCache[ifnum][index].isRouter = flag
00095
00096 fip_nd6_searchStatus_t fip_nd6_neighbourCache_lookupByIp(fip_ifnum_t ifnum, const fip_ip6addr_t * const address);
00097 fip_nd6_index_t fip_nd6_neighbourCache_makeRoom(fip_ifnum_t ifnum);
00098 void fip_nd6_neighbourCache_updateLL(fip_ifnum_t ifnum, fip_nd6_index_t index, fip_llptraddr_t lladdr);
00099
00100 extern fip_nd6_neighbourCache_t fip_neighbourCache[FIP_CONF_MAX_INTERFACES][FIP_CONF_ND6_MAX_NEIGHBOURS];
00101
00102
00103
00104 #define MAX_ICMPV6_OPTIONS 10
00105
00106
00107 typedef struct
00108 {
00109 unsigned char type;
00110 unsigned char length;
00111 unsigned char offset;
00112 } fip_nd6_option_t;
00113
00114
00115 typedef struct
00116 {
00117 fip_nd6_option_t options[MAX_ICMPV6_OPTIONS];
00118 unsigned char numOpts;
00119 } fip_nd6_optionStruct_t ;
00120
00121
00122 #endif
00123
00124