xorp

io_link_dummy.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 
00003 // Copyright (c) 2007-2011 XORP, Inc and Others
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, Version 2, June
00007 // 1991 as published by the Free Software Foundation. Redistribution
00008 // and/or modification of this program under the terms of any other
00009 // version of the GNU General Public License is not permitted.
00010 // 
00011 // This program is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00014 // see the GNU General Public License, Version 2, a copy of which can be
00015 // found in the XORP LICENSE.gpl file.
00016 // 
00017 // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00018 // http://xorp.net
00019 
00020 // $XORP: xorp/fea/data_plane/io/io_link_dummy.hh,v 1.6 2008/10/11 04:20:19 pavlin Exp $
00021 
00022 #ifndef __FEA_DATA_PLANE_IO_IO_LINK_DUMMY_HH__
00023 #define __FEA_DATA_PLANE_IO_IO_LINK_DUMMY_HH__
00024 
00025 //
00026 // I/O link raw communication support.
00027 //
00028 // The mechanism is Dummy (for testing purpose).
00029 //
00030 
00031 
00032 
00033 #include "libxorp/xorp.h"
00034 
00035 #include "fea/io_link.hh"
00036 #include "fea/io_link_manager.hh"
00037 
00038 
00045 class IoLinkDummy : public IoLink {
00046 public:
00060     IoLinkDummy(FeaDataPlaneManager& fea_data_plane_manager,
00061         const IfTree& iftree, const string& if_name,
00062         const string& vif_name, uint16_t ether_type,
00063         const string& filter_program);
00064 
00068     virtual ~IoLinkDummy();
00069 
00076     int     start(string& error_msg);
00077 
00084     int     stop(string& error_msg);
00085 
00093     int     join_multicast_group(const Mac& group, string& error_msg);
00094     
00102     int     leave_multicast_group(const Mac& group, string& error_msg);
00103 
00114     int     send_packet(const Mac&      src_address,
00115                 const Mac&      dst_address,
00116                 uint16_t        ether_type,
00117                 const vector<uint8_t>& payload,
00118                 string&     error_msg);
00119 
00120 private:
00121     set<IoLinkComm::JoinedMulticastGroup> _joined_groups_table;
00122 };
00123 
00124 #endif // __FEA_DATA_PLANE_IO_IO_LINK_DUMMY_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations