Changes between Version 35 and Version 36 of Internal/OpenFlow/Notes


Ignore:
Timestamp:
Apr 7, 2010, 5:55:07 PM (14 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/Notes

    v35 v36  
    737737Events must be registered through the Disposition handler, which returns either STOP or CONTINUE, as defined in event.hh. 
    738738
     739Since the app Demosw will behave more like a switch, I used the switch code for reference. Here's the skeleton based on the switch app code, but for my app (if it ever happens...)
     740
     741{{{
     742#include "component.hh"
     743#include "vlog.hh" //for logging purposes -> src/include/vlog.hh
     744
     745//need to spec user custom structs here
     746
     747Vlog_module log("demosw");
     748
     749class Demosw
     750        : public Component
     751{
     752public:
     753        Demosw(const Context* c,
     754                const xercesc::DOMNode*)
     755                : Component(c) { }
     756
     757        void configure(const Configuration*);
     758
     759        void install();
     760
     761        //Disposition defined in component.hh, ref. src/nox/
     762        Disposition handle(const Event&);
     763private:
     764       
     765};
     766
     767void Demosw::configure(const Configuration* conf)
     768{
     769
     770}
     771
     772void Demosw::install()
     773{
     774
     775}
     776
     777Disposition Demosw::handle(const Event& evt) //returns either CONTINUE or STOP
     778{
     779
     780}
     781
     782REGISTER_COMPONENT(container::Simple_component_factory<Demosw>, Demosw);
     783}}}
    739784   
    740785