From 4608edf7712bf474beae7fb06976b385d5f208cf Mon Sep 17 00:00:00 2001 From: "Srivats P." Date: Thu, 27 Mar 2014 06:39:08 +0530 Subject: [PATCH] NOX: Dot2Llc - Separated protocol and widget as per new framework --- common/dot2llcconfig.h | 36 ++++++++++++++++++++++++++++++++ common/ostproto.pro | 2 +- common/ostprotogui.pro | 1 + common/protocolmanager.cpp | 6 +++--- common/protocolwidgetfactory.cpp | 4 ++++ 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 common/dot2llcconfig.h diff --git a/common/dot2llcconfig.h b/common/dot2llcconfig.h new file mode 100644 index 0000000..76a5b24 --- /dev/null +++ b/common/dot2llcconfig.h @@ -0,0 +1,36 @@ +/* +Copyright (C) 2014 Srivats P. + +This file is part of "Ostinato" + +This is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +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, see +*/ + +#ifndef _DOT2_LLC_CONFIG_H +#define _DOT2_LLC_CONFIG_H + +#include "comboprotocolconfig.h" + +#include "dot3config.h" +#include "llcconfig.h" +#include "dot3.h" +#include "llc.h" + +typedef ComboProtocolConfigForm < + OstProto::Protocol::kDot2LlcFieldNumber, + Dot3ConfigForm, LlcConfigForm, + Dot3Protocol, LlcProtocol + > Dot2LlcConfigForm; + +#endif diff --git a/common/ostproto.pro b/common/ostproto.pro index 2a5a373..63524f4 100644 --- a/common/ostproto.pro +++ b/common/ostproto.pro @@ -53,11 +53,11 @@ HEADERS += \ eth2.h \ dot3.h \ llc.h \ + dot2llc.h \ ip6.h HEADERS1 += \ snap.h \ - dot2llc.h \ dot2snap.h \ arp.h \ ip4.h \ diff --git a/common/ostprotogui.pro b/common/ostprotogui.pro index 95f1a38..7a90fe4 100644 --- a/common/ostprotogui.pro +++ b/common/ostprotogui.pro @@ -55,6 +55,7 @@ HEADERS += \ eth2config.h \ dot3config.h \ llcconfig.h \ + dot2llcconfig.h \ ip6config.h SOURCES += \ diff --git a/common/protocolmanager.cpp b/common/protocolmanager.cpp index ed8a62f..d385d0e 100644 --- a/common/protocolmanager.cpp +++ b/common/protocolmanager.cpp @@ -23,7 +23,6 @@ along with this program. If not, see #include "protocol.pb.h" #if 0 #include "snap.h" -#include "dot2llc.h" #include "dot2snap.h" #include "arp.h" #include "ip4.h" @@ -48,6 +47,7 @@ along with this program. If not, see #include "vlanstack.h" #include "dot3.h" #include "llc.h" +#include "dot2llc.h" #include "eth2.h" #include "ip6.h" #endif @@ -62,8 +62,6 @@ ProtocolManager::ProtocolManager() #if 0 registerProtocol(OstProto::Protocol::kSnapFieldNumber, (void*) SnapProtocol::createInstance); - registerProtocol(OstProto::Protocol::kDot2LlcFieldNumber, - (void*) Dot2LlcProtocol::createInstance); registerProtocol(OstProto::Protocol::kDot2SnapFieldNumber, (void*) Dot2SnapProtocol::createInstance); @@ -119,6 +117,8 @@ ProtocolManager::ProtocolManager() (void*) Dot3Protocol::createInstance); registerProtocol(OstProto::Protocol::kLlcFieldNumber, (void*) LlcProtocol::createInstance); + registerProtocol(OstProto::Protocol::kDot2LlcFieldNumber, + (void*) Dot2LlcProtocol::createInstance); registerProtocol(OstProto::Protocol::kIp6FieldNumber, (void*) Ip6Protocol::createInstance); diff --git a/common/protocolwidgetfactory.cpp b/common/protocolwidgetfactory.cpp index 591fed6..e3bf662 100644 --- a/common/protocolwidgetfactory.cpp +++ b/common/protocolwidgetfactory.cpp @@ -27,6 +27,7 @@ along with this program. If not, see #include "eth2config.h" #include "dot3config.h" #include "llcconfig.h" +#include "dot2llcconfig.h" #include "ip6config.h" ProtocolWidgetFactory *OstProtocolWidgetFactory; @@ -64,6 +65,9 @@ ProtocolWidgetFactory::ProtocolWidgetFactory() OstProtocolWidgetFactory->registerProtocolConfigWidget( OstProto::Protocol::kLlcFieldNumber, (void*) LlcConfigForm::createInstance); + OstProtocolWidgetFactory->registerProtocolConfigWidget( + OstProto::Protocol::kDot2LlcFieldNumber, + (void*) Dot2LlcConfigForm::createInstance); OstProtocolWidgetFactory->registerProtocolConfigWidget( OstProto::Protocol::kIp6FieldNumber,