OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2004 Francisco J. Ros | 3 * Copyright (c) 2004 Francisco J. Ros |
4 * Copyright (c) 2007 INESC Porto | 4 * Copyright (c) 2007 INESC Porto |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } | 516 } |
517 | 517 |
518 /********** Host-Network Association Set Manipulation **********/ | 518 /********** Host-Network Association Set Manipulation **********/ |
519 | 519 |
520 AssociationTuple* | 520 AssociationTuple* |
521 OlsrState::FindAssociationTuple (const Ipv4Address &gatewayAddr, const Ipv4Addre
ss &networkAddr, const Ipv4Mask &netmask) | 521 OlsrState::FindAssociationTuple (const Ipv4Address &gatewayAddr, const Ipv4Addre
ss &networkAddr, const Ipv4Mask &netmask) |
522 { | 522 { |
523 for (AssociationSet::iterator it = m_associationSet.begin (); | 523 for (AssociationSet::iterator it = m_associationSet.begin (); |
524 it != m_associationSet.end (); it++) | 524 it != m_associationSet.end (); it++) |
525 { | 525 { |
526 if (it->gatewayAddr == gatewayAddr and it->networkAddr == networkAddr and
it->netmask == netmask) | 526 if (it->gatewayAddr == gatewayAddr && it->networkAddr == networkAddr && it
->netmask == netmask) |
527 { | 527 { |
528 return &(*it); | 528 return &(*it); |
529 } | 529 } |
530 } | 530 } |
531 return NULL; | 531 return NULL; |
532 } | 532 } |
533 | 533 |
534 void | 534 void |
535 OlsrState::EraseAssociationTuple (const AssociationTuple &tuple) | 535 OlsrState::EraseAssociationTuple (const AssociationTuple &tuple) |
536 { | 536 { |
(...skipping 29 matching lines...) Expand all Loading... |
566 } | 566 } |
567 | 567 |
568 void | 568 void |
569 OlsrState::InsertAssociation (const Association &tuple) | 569 OlsrState::InsertAssociation (const Association &tuple) |
570 { | 570 { |
571 m_associations.push_back (tuple); | 571 m_associations.push_back (tuple); |
572 } | 572 } |
573 | 573 |
574 } | 574 } |
575 } // namespace olsr, ns3 | 575 } // namespace olsr, ns3 |
OLD | NEW |