• Main Page
  • Classes
  • Files
  • File List

/Users/yzchen/ns/ns-allinone-2.33/ns-2.33/um-olsr-0.8.8/OLSR_state.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Francisco J. Ros                                *
00003  *   fjrm@dif.um.es                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00025 
00026 #ifndef __OLSR_state_h__
00027 #define __OLSR_state_h__
00028 
00029 #include <olsr/OLSR_repositories.h>
00030 
00032 class OLSR_state {
00033         friend class OLSR;
00034         
00035         linkset_t       linkset_;       
00036         nbset_t         nbset_;         
00037         nb2hopset_t     nb2hopset_;     
00038         topologyset_t   topologyset_;   
00039         mprset_t        mprset_;        
00040         mprselset_t     mprselset_;     
00041         dupset_t        dupset_;        
00042         ifaceassocset_t ifaceassocset_; 
00043         
00044 protected:
00045         inline  linkset_t&              linkset()       { return linkset_; }
00046         inline  mprset_t&               mprset()        { return mprset_; }
00047         inline  mprselset_t&            mprselset()     { return mprselset_; }
00048         inline  nbset_t&                nbset()         { return nbset_; }
00049         inline  nb2hopset_t&            nb2hopset()     { return nb2hopset_; }
00050         inline  topologyset_t&          topologyset()   { return topologyset_; }
00051         inline  dupset_t&               dupset()        { return dupset_; }
00052         inline  ifaceassocset_t&        ifaceassocset() { return ifaceassocset_; }
00053         
00054         OLSR_mprsel_tuple*      find_mprsel_tuple(nsaddr_t);
00055         void                    erase_mprsel_tuple(OLSR_mprsel_tuple*);
00056         void                    erase_mprsel_tuples(nsaddr_t);
00057         void                    insert_mprsel_tuple(OLSR_mprsel_tuple*);
00058         
00059         OLSR_nb_tuple*          find_nb_tuple(nsaddr_t);
00060         OLSR_nb_tuple*          find_sym_nb_tuple(nsaddr_t);
00061         OLSR_nb_tuple*          find_nb_tuple(nsaddr_t, u_int8_t);
00062         void                    erase_nb_tuple(OLSR_nb_tuple*);
00063         void                    erase_nb_tuple(nsaddr_t);
00064         void                    insert_nb_tuple(OLSR_nb_tuple*);
00065         
00066         OLSR_nb2hop_tuple*      find_nb2hop_tuple(nsaddr_t, nsaddr_t);
00067         void                    erase_nb2hop_tuple(OLSR_nb2hop_tuple*);
00068         void                    erase_nb2hop_tuples(nsaddr_t);
00069         void                    erase_nb2hop_tuples(nsaddr_t, nsaddr_t);
00070         void                    insert_nb2hop_tuple(OLSR_nb2hop_tuple*);
00071 
00072         bool                    find_mpr_addr(nsaddr_t);
00073         void                    insert_mpr_addr(nsaddr_t);
00074         void                    clear_mprset();
00075         
00076         OLSR_dup_tuple*         find_dup_tuple(nsaddr_t, u_int16_t);
00077         void                    erase_dup_tuple(OLSR_dup_tuple*);
00078         void                    insert_dup_tuple(OLSR_dup_tuple*);
00079         
00080         OLSR_link_tuple*        find_link_tuple(nsaddr_t);
00081         OLSR_link_tuple*        find_sym_link_tuple(nsaddr_t, double);
00082         void                    erase_link_tuple(OLSR_link_tuple*);
00083         void                    insert_link_tuple(OLSR_link_tuple*);
00084 
00085         OLSR_topology_tuple*    find_topology_tuple(nsaddr_t, nsaddr_t);
00086         OLSR_topology_tuple*    find_newer_topology_tuple(nsaddr_t, u_int16_t);
00087         void                    erase_topology_tuple(OLSR_topology_tuple*);
00088         void                    erase_older_topology_tuples(nsaddr_t, u_int16_t);
00089         void                    insert_topology_tuple(OLSR_topology_tuple*);
00090         
00091         OLSR_iface_assoc_tuple* find_ifaceassoc_tuple(nsaddr_t);
00092         void                    erase_ifaceassoc_tuple(OLSR_iface_assoc_tuple*);
00093         void                    insert_ifaceassoc_tuple(OLSR_iface_assoc_tuple*);
00094         
00095 };
00096 
00097 #endif

Generated on Tue Aug 10 2010 16:16:09 for ns-2.33 by  doxygen 1.7.1