Siena Fast Forwarding Documentation (v. 2.0.1)
forwarding.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // This file is part of Siena, a wide-area event notification system.
4 // See http://www.inf.usi.ch/carzaniga/siena/
5 //
6 // Authors: Antonio Carzaniga
7 // See the file AUTHORS for full details.
8 //
9 // Copyright (C) 2001-2002 University of Colorado
10 //
11 // Siena is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // Siena is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with Siena. If not, see <http://www.gnu.org/licenses/>.
23 //
24 #ifndef SIENA_FORWARDING_H_INCLUDED
25 #define SIENA_FORWARDING_H_INCLUDED
26 
27 #include <siena/attributes.h>
28 #include <siena/tags.h>
29 
34 namespace siena {
35 
43 typedef unsigned int InterfaceId;
44 
57 class MatchHandler {
58 public:
60  virtual ~MatchHandler() {};
61 
70  virtual bool output(InterfaceId) = 0;
71 };
72 
120 class FIB {
121 public:
125  virtual ~FIB() {};
126 
142  virtual void consolidate() {};
143 
154  virtual void clear() = 0;
155 
166  virtual void clear_recycle() = 0;
167 
174  virtual size_t allocated_bytesize() const = 0;
175 
182  virtual size_t bytesize() const = 0;
183 };
184 
195 class AttributesFIB : public FIB {
196 public:
207  virtual void ifconfig(InterfaceId, const Predicate &) = 0;
208 
222  virtual void match(const Message &, MatchHandler &) const = 0;
223 };
224 
234 class TagsFIB : public FIB {
235 public:
246  virtual void ifconfig(InterfaceId, const TagSetList &) = 0;
247 
261  virtual void match(const TagSet &, MatchHandler &) const = 0;
262 };
263 
264 } // end namespace siena
265 
266 #endif