INET Framework for OMNeT++/OMNEST
inet::BindingUpdateList Class Reference

#include <BindingUpdateList.h>

Inheritance diagram for inet::BindingUpdateList:

Classes

class  BindingUpdateListEntry
 

Public Types

enum  MobilityState {
  NONE = 0, RR, RR_COMPLETE, REGISTER,
  REGISTERED, DEREGISTER
}
 
typedef std::map< IPv6Address, BindingUpdateListEntryBindingUpdateList6
 

Public Member Functions

 BindingUpdateList ()
 
virtual ~BindingUpdateList ()
 
virtual void addOrUpdateBUL (const IPv6Address &dest, const IPv6Address &hoa, const IPv6Address &coa, const uint lifetime, const uint seq, const simtime_t buSentTime)
 Sets entry in the Binding Update List with provided values. More...
 
virtual BindingUpdateList::BindingUpdateListEntrycreateBULEntry (const IPv6Address &dest)
 Creates a new entry in the BUL for the provided address. More...
 
virtual void initializeBUValues (BindingUpdateListEntry &entry)
 Initializes the values of a BUL entry to initial values. More...
 
virtual void addOrUpdateBUL (const IPv6Address &dest, const IPv6Address &hoa, simtime_t sentTime, int cookie, bool isHoTI)
 Sets HoTI and/or CoTI values (transmission time, etc.) for the BUL entry. More...
 
virtual BindingUpdateList::BindingUpdateListEntrylookup (const IPv6Address &dest)
 Returns the BUL entry for a certain destination address. More...
 
virtual BindingUpdateList::BindingUpdateListEntryfetch (const IPv6Address &dest)
 Similiar to lookup(), but with the difference that this method always returns a valid BUL entry. More...
 
virtual MobilityState getMobilityState (const IPv6Address &dest) const
 Returns the current mobility state for the CN identified by the provided IP address. More...
 
virtual void setMobilityState (const IPv6Address &dest, BindingUpdateList::MobilityState state)
 Sets the mobility state to provided state for the CN identified by the provided IP address. More...
 
virtual int generateBAuthData (const IPv6Address &dest, const IPv6Address &CoA)
 Generates the Binding Authorization Data based on a certain destination address and CoA. More...
 
virtual int generateKey (int homeToken, int careOfToken, const IPv6Address &CoA)
 Generates the key Kbm from home and care-of keygen token. More...
 
virtual int generateHomeToken (const IPv6Address &HoA, int nonce)
 Generates a home token from the provided parameters. More...
 
virtual int generateCareOfToken (const IPv6Address &CoA, int nonce)
 Generates a care-of token from the provided parameters. More...
 
virtual void resetHomeToken (const IPv6Address &dest, const IPv6Address &hoa)
 Resets the token to UNDEFINED. More...
 
virtual void resetCareOfToken (const IPv6Address &dest, const IPv6Address &hoa)
 Resets the token to UNDEFINED. More...
 
virtual bool isHomeTokenAvailable (const IPv6Address &dest, InterfaceEntry *ie)
 Returns true if a home keygen token is available. More...
 
virtual bool isCareOfTokenAvailable (const IPv6Address &dest, InterfaceEntry *ie)
 Returns true if a care-of keygen token is available. More...
 
virtual bool isInBindingUpdateList (const IPv6Address &dest) const
 Checks whether there exists an entry in the BUL for the given destination address. More...
 
virtual uint getSequenceNumber (const IPv6Address &dest)
 Returns the last used sequence number for the given dest. More...
 
virtual const IPv6AddressgetCoA (const IPv6Address &dest)
 Returns the CoA that was registered for the provided dest. More...
 
virtual bool isInBindingUpdateList (const IPv6Address &dest, const IPv6Address &HoA)
 Checks whether there exists an entry in the BUL for the given destination address and home address. More...
 
virtual bool isValidBinding (const IPv6Address &dest)
 Returns true if a binding has been acknowledged and it's lifetime has not yet expired. More...
 
virtual bool isBindingAboutToExpire (const IPv6Address &dest)
 Returns true if a binding is about to expire. More...
 
virtual bool sentBindingUpdate (const IPv6Address &dest)
 Returns true if a binding update has been sent to and acknowledged by the provided destination address and the lifetime has not yet expired. More...
 
virtual void removeBinding (const IPv6Address &dest)
 Deletes an entry from the binding update list for the provided destination address. More...
 
virtual void suspendBinding (const IPv6Address &dest)
 Sets the state of the binding cache entry to "not usable". More...
 
virtual bool recentlySentCOTI (const IPv6Address &dest, InterfaceEntry *ie)
 These two methods indicate whether a CoTI or HoTI message has been recently sent to the CN identified by parameter dest. More...
 
virtual bool recentlySentHOTI (const IPv6Address &dest, InterfaceEntry *ie)
 

Public Attributes

BindingUpdateList6 bindingUpdateList
 

Protected Member Functions

virtual void initialize () override
 
virtual void handleMessage (cMessage *) override
 Raises an error. More...
 
virtual void resetBindingCacheEntry (BindingUpdateListEntry &entry)
 Resets binding lifetime, tokens, etc. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const BindingUpdateListEntry &bul)
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
NONE 
RR 
RR_COMPLETE 
REGISTER 
REGISTERED 
DEREGISTER 
52  {
53  NONE = 0,
54  RR,
56  REGISTER,
57  REGISTERED,
59  };
Definition: BindingUpdateList.h:56
Definition: BindingUpdateList.h:55
Definition: BindingUpdateList.h:57
Definition: BindingUpdateList.h:58
Definition: BindingUpdateList.h:53
Definition: BindingUpdateList.h:54

Constructor & Destructor Documentation

inet::BindingUpdateList::BindingUpdateList ( )
90 {
91 }
inet::BindingUpdateList::~BindingUpdateList ( )
virtual
94 {
95 // for (unsigned int i = 0; i < bindingUpdateList.size(); i++)
96 // delete bindingUpdateList[i];
97 }

Member Function Documentation

void inet::BindingUpdateList::addOrUpdateBUL ( const IPv6Address dest,
const IPv6Address hoa,
const IPv6Address coa,
const uint  lifetime,
const uint  seq,
const simtime_t  buSentTime 
)
virtual

Sets entry in the Binding Update List with provided values.

If entry does not yet exist, a new one is created.

Referenced by inet::xMIPv6::sendTestInit(), and inet::xMIPv6::updateBUL().

110 {
111  // modified structure - CB
112 
113  // search for entry
114  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
115 
116  // if it is not yet existing, create it
117  if (entry == nullptr) {
118  /*bindingUpdateList[dest].destAddress = dest;
119  entry = & bindingUpdateList[dest];
120  initializeBUValues(*entry);*/
121  entry = createBULEntry(dest);
122  }
123 
124  EV_INFO << "\n++++++++++++++++++++Binding Update List Being Updated in Routing Table6 ++++++++++++++\n";
125 
126  entry->homeAddress = hoa;
127  entry->careOfAddress = coa;
128  // update lifetime 11.06.08 - CB
129  entry->bindingLifetime = lifetime; // for the moment a constant but then it is supposed to decrement with time.
130  entry->bindingExpiry = simTime() + lifetime; // binding expires at this point in time
131  //TODO bindingUpdateList[dest].remainingLifetime = ;
132  entry->sentTime = buSentTime; //the time at which the BU, whose ack is awaited is sent
133  //entry->nextBUTx = nextBUSentTime; //the nextScgheduledTime at which the BU will be sent in case of timeout.
134  entry->sequenceNumber = seq; //seq number of the last BU sent.
135  entry->BAck = false;
136 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
virtual BindingUpdateList::BindingUpdateListEntry * createBULEntry(const IPv6Address &dest)
Creates a new entry in the BUL for the provided address.
Definition: BindingUpdateList.cc:138
void inet::BindingUpdateList::addOrUpdateBUL ( const IPv6Address dest,
const IPv6Address hoa,
simtime_t  sentTime,
int  cookie,
bool  isHoTI = false 
)
virtual

Sets HoTI and/or CoTI values (transmission time, etc.) for the BUL entry.

174 {
175  EV_INFO << "\n++++++++++++++++++++Binding Update List for HoTI/CoTI Being Updated in Routing Table6 ++++++++++++++\n";
176  // search for entry
177  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
178 
179  // if it is not yet existing, create it
180  if (entry == nullptr) {
181  bindingUpdateList[dest].destAddress = dest;
182  entry = &bindingUpdateList[dest];
183  initializeBUValues(*entry);
184  }
185 
186  if (HoTI) { // those values are from the HoTI message
187  entry->homeAddress = addr;
188  entry->sentHoTI = sentTime;
189  entry->cookieHoTI = cookie;
190  }
191  else { // and those from the CoTI
192  entry->careOfAddress = addr;
193  entry->sentCoTI = sentTime;
194  entry->cookieCoTI = cookie;
195  }
196 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
virtual void initializeBUValues(BindingUpdateListEntry &entry)
Initializes the values of a BUL entry to initial values.
Definition: BindingUpdateList.cc:149
BindingUpdateList::BindingUpdateListEntry * inet::BindingUpdateList::createBULEntry ( const IPv6Address dest)
virtual

Creates a new entry in the BUL for the provided address.

Referenced by addOrUpdateBUL(), and fetch().

139 {
140  bindingUpdateList[dest].destAddress = dest;
141 
142  BindingUpdateListEntry& entry = bindingUpdateList[dest];
143  //BindingUpdateList::BindingUpdateListEntry* entry = & bindingUpdateList[dest];
144  initializeBUValues(entry);
145 
146  return &entry;
147 }
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
virtual void initializeBUValues(BindingUpdateListEntry &entry)
Initializes the values of a BUL entry to initial values.
Definition: BindingUpdateList.cc:149
BindingUpdateList::BindingUpdateListEntry * inet::BindingUpdateList::fetch ( const IPv6Address dest)
virtual

Similiar to lookup(), but with the difference that this method always returns a valid BUL entry.

If none existed prior to the call, a new entry is created.

Referenced by inet::xMIPv6::createBUTimer(), inet::xMIPv6::initiateMIPv6Protocol(), and inet::xMIPv6::initReturnRoutability().

206 {
207  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
208 
209  if (entry == nullptr)
210  return createBULEntry(dest);
211  else
212  return entry;
213 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
virtual BindingUpdateList::BindingUpdateListEntry * createBULEntry(const IPv6Address &dest)
Creates a new entry in the BUL for the provided address.
Definition: BindingUpdateList.cc:138
int inet::BindingUpdateList::generateBAuthData ( const IPv6Address dest,
const IPv6Address CoA 
)
virtual

Generates the Binding Authorization Data based on a certain destination address and CoA.

Referenced by inet::xMIPv6::sendPeriodicBU().

234 {
235  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
236 
237  if (entry == nullptr) {
238  EV_WARN << "Impossible to generate Binding Authorization Data as CN is not existing in BUL!\n";
239  return 0;
240  }
241 
242  // generate the key
243  return BindingUpdateList::generateKey(entry->tokenH, entry->tokenC, CoA);
244 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
virtual int generateKey(int homeToken, int careOfToken, const IPv6Address &CoA)
Generates the key Kbm from home and care-of keygen token.
Definition: BindingUpdateList.cc:246
int inet::BindingUpdateList::generateCareOfToken ( const IPv6Address CoA,
int  nonce 
)
virtual

Generates a care-of token from the provided parameters.

Returns a static value for now.

258 {
259  return CO_TOKEN;
260 }
#define CO_TOKEN
Definition: BindingCache.h:34
int inet::BindingUpdateList::generateHomeToken ( const IPv6Address HoA,
int  nonce 
)
virtual

Generates a home token from the provided parameters.

Returns a static value for now.

253 {
254  return HO_TOKEN;
255 }
#define HO_TOKEN
Definition: BindingCache.h:33
int inet::BindingUpdateList::generateKey ( int  homeToken,
int  careOfToken,
const IPv6Address CoA 
)
virtual

Generates the key Kbm from home and care-of keygen token.

For now, this return the sum of both tokens.

Referenced by generateBAuthData().

247 {
248  // use a dummy value
249  return homeToken + careOfToken;
250 }
const IPv6Address & inet::BindingUpdateList::getCoA ( const IPv6Address dest)
virtual

Returns the CoA that was registered for the provided dest.

address.

Referenced by inet::xMIPv6::sendPeriodicBU(), and inet::xMIPv6::triggerRouteOptimization().

315 {
316  // search for entry
317  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
318 
319  ASSERT(entry != nullptr);
320 
321  return entry->careOfAddress;
322 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
BindingUpdateList::MobilityState inet::BindingUpdateList::getMobilityState ( const IPv6Address dest) const
virtual

Returns the current mobility state for the CN identified by the provided IP address.

Referenced by inet::xMIPv6::handleTokenExpiry(), and inet::xMIPv6::triggerRouteOptimization().

216 {
217  BindingUpdateList6::const_iterator i = bindingUpdateList.find(dest);
218 
219  if (i == bindingUpdateList.end())
220  return NONE;
221  else
222  return i->second.state;
223 }
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
Definition: BindingUpdateList.h:53
uint inet::BindingUpdateList::getSequenceNumber ( const IPv6Address dest)
virtual

Returns the last used sequence number for the given dest.

address.

Referenced by inet::xMIPv6::createBUTimer(), and inet::xMIPv6::validateBAck().

304 {
305  // search for entry
306  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
307 
308  if (entry == nullptr)
309  return 0;
310 
311  return entry->sequenceNumber;
312 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
void inet::BindingUpdateList::handleMessage ( cMessage *  msg)
overrideprotectedvirtual

Raises an error.

105 {
106  throw cRuntimeError("This module doesn't process messages");
107 }
void inet::BindingUpdateList::initialize ( )
overrideprotectedvirtual
100 {
101  WATCH_MAP(bindingUpdateList); //added by Zarrar Yousaf
102 }
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
void inet::BindingUpdateList::initializeBUValues ( BindingUpdateListEntry entry)
virtual

Initializes the values of a BUL entry to initial values.

Called by addOrUpdateBUL() if new entry is created.

Referenced by addOrUpdateBUL(), and createBULEntry().

150 {
151  // normal BU values
152  entry.bindingLifetime = 0;
153  entry.bindingExpiry = 0;
154  //TODO bindingUpdateList[dest].remainingLifetime = ;
155  entry.sentTime = 0;
156  //entry.nextBUTx = 0;
157  entry.sequenceNumber = 0;
158  entry.BAck = false;
159 
160  // RR specific values
161  entry.sentHoTI = 0;
162  entry.sentCoTI = 0;
163  entry.cookieHoTI = UNDEFINED_COOKIE;
164  entry.cookieCoTI = UNDEFINED_COOKIE;
165  //entry.sendNext = 0;
166  entry.tokenH = UNDEFINED_TOKEN;
167  entry.tokenC = UNDEFINED_TOKEN;
168  // 21.07.08 - CB
169  entry.state = NONE;
170 }
#define UNDEFINED_TOKEN
Definition: BindingUpdateList.h:36
Definition: BindingUpdateList.h:53
#define UNDEFINED_COOKIE
Definition: BindingUpdateList.h:37
bool inet::BindingUpdateList::isBindingAboutToExpire ( const IPv6Address dest)
virtual

Returns true if a binding is about to expire.

Referenced by inet::xMIPv6::checkForBUtoCN().

345 {
346  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
347 
348  if (entry == nullptr)
349  return true;
350 
351  return entry->bindingLifetime < SIMTIME_DBL(simTime()) - PRE_BINDING_EXPIRY;
352 }
#define PRE_BINDING_EXPIRY
Definition: BindingUpdateList.h:44
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
bool inet::BindingUpdateList::isCareOfTokenAvailable ( const IPv6Address dest,
InterfaceEntry ie 
)
virtual

Returns true if a care-of keygen token is available.

Referenced by inet::xMIPv6::checkForBUtoCN(), and inet::xMIPv6::initReturnRoutability().

290 {
291  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
292  ASSERT(entry != nullptr);
293 
294  return entry->tokenC != UNDEFINED_TOKEN &&
295  (entry->sentCoTI + ie->ipv6Data()->_getMaxTokenLifeTime()) > simTime();
296 }
#define UNDEFINED_TOKEN
Definition: BindingUpdateList.h:36
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
bool inet::BindingUpdateList::isHomeTokenAvailable ( const IPv6Address dest,
InterfaceEntry ie 
)
virtual

Returns true if a home keygen token is available.

Referenced by inet::xMIPv6::checkForBUtoCN(), and inet::xMIPv6::initReturnRoutability().

281 {
282  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
283  ASSERT(entry != nullptr);
284 
285  return entry->tokenH != UNDEFINED_TOKEN &&
286  (entry->sentHoTI + ie->ipv6Data()->_getMaxTokenLifeTime()) > simTime();
287 }
#define UNDEFINED_TOKEN
Definition: BindingUpdateList.h:36
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
bool inet::BindingUpdateList::isInBindingUpdateList ( const IPv6Address dest) const
virtual

Checks whether there exists an entry in the BUL for the given destination address.

Referenced by inet::xMIPv6::createBUTimer(), inet::xMIPv6::processBRRMessage(), and inet::xMIPv6::triggerRouteOptimization().

299 {
300  return bindingUpdateList.find(dest) != bindingUpdateList.end();
301 }
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
bool inet::BindingUpdateList::isInBindingUpdateList ( const IPv6Address dest,
const IPv6Address HoA 
)
virtual

Checks whether there exists an entry in the BUL for the given destination address and home address.

325 {
326  auto pos = bindingUpdateList.find(dest);
327 
328  if (pos == bindingUpdateList.end())
329  return false;
330 
331  return pos->second.homeAddress == HoA;
332 }
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
bool inet::BindingUpdateList::isValidBinding ( const IPv6Address dest)
virtual

Returns true if a binding has been acknowledged and it's lifetime has not yet expired.

Referenced by inet::xMIPv6::checkForBUtoCN(), and inet::xMIPv6::returningHome().

335 {
336  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
337 
338  if (entry == nullptr)
339  return false;
340 
341  return entry->BAck && (entry->bindingLifetime < SIMTIME_DBL(simTime()));
342 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
bool inet::BindingUpdateList::recentlySentCOTI ( const IPv6Address dest,
InterfaceEntry ie 
)
virtual

These two methods indicate whether a CoTI or HoTI message has been recently sent to the CN identified by parameter dest.

Referenced by inet::xMIPv6::checkForBUtoCN(), and inet::xMIPv6::initReturnRoutability().

389 {
390  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
391 
392  ASSERT(entry != nullptr);
393 
394  return entry->sentCoTI + ie->ipv6Data()->_getMaxTokenLifeTime() / 3 > simTime();
395 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
bool inet::BindingUpdateList::recentlySentHOTI ( const IPv6Address dest,
InterfaceEntry ie 
)
virtual

Referenced by inet::xMIPv6::checkForBUtoCN(), and inet::xMIPv6::initReturnRoutability().

398 {
399  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
400 
401  ASSERT(entry != nullptr);
402 
403  return entry->sentHoTI + ie->ipv6Data()->_getMaxTokenLifeTime() / 3 > simTime();
404 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
void inet::BindingUpdateList::removeBinding ( const IPv6Address dest)
virtual

Deletes an entry from the binding update list for the provided destination address.

Referenced by inet::xMIPv6::handleBULExpiry(), inet::xMIPv6::initiateMIPv6Protocol(), and inet::xMIPv6::processBAMessage().

366 {
367  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
368 
369  ASSERT(entry != nullptr);
370 
371  if ((entry->tokenH != UNDEFINED_TOKEN) || (entry->tokenC != UNDEFINED_TOKEN))
372  // for CNs, we just delete all entries
373  resetBindingCacheEntry(*entry);
374  else
375  // the BUL entry to the HA is completely deleted
376  bindingUpdateList.erase(dest);
377 }
#define UNDEFINED_TOKEN
Definition: BindingUpdateList.h:36
virtual void resetBindingCacheEntry(BindingUpdateListEntry &entry)
Resets binding lifetime, tokens, etc.
Definition: BindingUpdateList.cc:406
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
void inet::BindingUpdateList::resetBindingCacheEntry ( BindingUpdateListEntry entry)
protectedvirtual

Resets binding lifetime, tokens, etc.

of the BUL entry.

Referenced by removeBinding().

407 {
408  entry.bindingLifetime = 0;
409  entry.bindingExpiry = 0;
410  //entry.remainingLifetime = 0;
411  //entry.sequenceNumber = 0;
412  entry.sentTime = 0;
413  //entry.nextBUTx = 0;
414  entry.BAck = false;
415  entry.state = NONE;
416 
417  // if tokens should sustain handovers then comment out the following lines of code
418  // (this could eventually allow for parallel CN and HA registration)
419  /*entry.sentHoTI = 0;
420  entry.sentCoTI = 0;
421  entry.tokenH = 0;
422  entry.tokenC = 0;*/
423 }
Definition: BindingUpdateList.h:53
void inet::BindingUpdateList::resetCareOfToken ( const IPv6Address dest,
const IPv6Address hoa 
)
virtual

Resets the token to UNDEFINED.

Referenced by inet::xMIPv6::handleTokenExpiry(), inet::xMIPv6::initiateMIPv6Protocol(), and inet::xMIPv6::sendTestInit().

272 {
273  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
274  ASSERT(entry != nullptr);
275 
276  entry->tokenC = UNDEFINED_TOKEN;
277  //entry->sentCoTI = 0;
278 }
#define UNDEFINED_TOKEN
Definition: BindingUpdateList.h:36
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
void inet::BindingUpdateList::resetHomeToken ( const IPv6Address dest,
const IPv6Address hoa 
)
virtual

Resets the token to UNDEFINED.

Referenced by inet::xMIPv6::handleTokenExpiry(), and inet::xMIPv6::sendTestInit().

263 {
264  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
265  ASSERT(entry != nullptr);
266 
267  entry->tokenH = UNDEFINED_TOKEN;
268  //entry->sentHoTI = 0;
269 }
#define UNDEFINED_TOKEN
Definition: BindingUpdateList.h:36
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
bool inet::BindingUpdateList::sentBindingUpdate ( const IPv6Address dest)
virtual

Returns true if a binding update has been sent to and acknowledged by the provided destination address and the lifetime has not yet expired.

355 {
356  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
357 
358  if (entry == nullptr)
359  return false;
360 
361  return (entry->BAck || (entry->tokenH != UNDEFINED_TOKEN && entry->tokenC != UNDEFINED_TOKEN))
362  && entry->sentTime != 0;
363 }
#define UNDEFINED_TOKEN
Definition: BindingUpdateList.h:36
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198
void inet::BindingUpdateList::setMobilityState ( const IPv6Address dest,
BindingUpdateList::MobilityState  state 
)
virtual

Sets the mobility state to provided state for the CN identified by the provided IP address.

Referenced by inet::xMIPv6::handleTokenExpiry(), inet::xMIPv6::returningHome(), and inet::xMIPv6::triggerRouteOptimization().

226 {
227  auto i = bindingUpdateList.find(dest);
228 
229  if (i != bindingUpdateList.end())
230  i->second.state = state;
231 }
BindingUpdateList6 bindingUpdateList
Definition: BindingUpdateList.h:110
void inet::BindingUpdateList::suspendBinding ( const IPv6Address dest)
virtual

Sets the state of the binding cache entry to "not usable".

Resets the BAck flag to false, etc.

380 {
381  BindingUpdateList::BindingUpdateListEntry *entry = lookup(dest);
382 
383  ASSERT(entry != nullptr);
384 
385  entry->BAck = false;
386 }
virtual BindingUpdateList::BindingUpdateListEntry * lookup(const IPv6Address &dest)
Returns the BUL entry for a certain destination address.
Definition: BindingUpdateList.cc:198

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const BindingUpdateListEntry bul 
)
friend
35 {
36  os << "Destination: " << bul.destAddress << " HoA of MN: " << bul.homeAddress
37  << " CoA of MN: " << bul.careOfAddress << "\n"
38  << "Binding Lifetime: " << bul.bindingLifetime << " binding expiry: "
39  << SIMTIME_STR(bul.bindingExpiry) << " BU Sequence#: " << bul.sequenceNumber
40  << " Sent Time: " << SIMTIME_STR(bul.sentTime) /* << " Next_Tx_Time: " << bul.nextBUTx << */
41  << " BU_Ack: " << bul.BAck << "\n";
42 
43  // this part will only be displayed if the BUL entry is for CN registration
44  if (bul.sentHoTI != 0) {
45  os << "Sent Time HoTI: " << SIMTIME_STR(bul.sentHoTI) << " HoTI cookie: " << bul.cookieHoTI
46  << " home token: " << bul.tokenH << "\n";
47  }
48 
49  if (bul.sentCoTI != 0) {
50  os << " Sent Time CoTI: " << SIMTIME_STR(bul.sentCoTI) << " CoTI cookie: " << bul.cookieCoTI
51  << " care-of token: " << bul.tokenC << "\n";
52  }
53 
54  os << "State: ";
55  switch (bul.state) {
57  os << "none";
58  break;
59 
61  os << "Return Routability";
62  break;
63 
65  os << "Return Routability completed";
66  break;
67 
69  os << "Registering";
70  break;
71 
73  os << "Registered";
74  break;
75 
77  os << "Deregistering";
78  break;
79 
80  default:
81  os << "Unknown";
82  break;
83  }
84  os << endl;
85 
86  return os;
87 }
Definition: BindingUpdateList.h:56
Definition: BindingUpdateList.h:55
Definition: BindingUpdateList.h:57
Definition: BindingUpdateList.h:58
Definition: BindingUpdateList.h:53
Definition: BindingUpdateList.h:54

Member Data Documentation


The documentation for this class was generated from the following files: