
/*
 * linkstate.hh
 * Copyright (C) 2002 by John Heidemann <johnh@isi.edu>
 * $Id: linkstate.hh,v 1.5 2002/04/05 21:36:56 johnh Exp $
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 *
 */

#include <iostream>
#include <map>
#include <vector>

#include "msg.hh"


typedef map<int,LSA*> LSAMap;

/*
 * a data structure to keep track of LSA routing
 */
class LinkStateRouting {
protected:
	int me_;
	map<int,bool> neighbor_status_;  // direct neighbors only
	LSAMap router_lsas_;
	vector<Route*> routes_;
public:
	LinkStateRouting(int id);

	bool new_lsa(LSA *lsa);  // returns if new LSA must be sent
	void fill_in_neighbor_links_in_lsa(LSA *lsa);
	void compute();
	
	friend ostream& operator<< (ostream&, LinkStateRouting&);
};


