NSIS-ka
A free C++ implementation of NSIS protocols

Changeset 2293

Show
Ignore:
Timestamp:
11/08/06 10:44:29 (7 years ago)
Author:
stud-matfried
Message:

eval: Fixed the nop_dispatcher to still serialize messages.

Location:
natfw-nslp/trunk/eval
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • natfw-nslp/trunk/eval/nf.cpp

    r2291 r2293  
    1616using namespace protlib; 
    1717 
    18  
    19 class nop_dispatcher : public dispatcher { 
    20   public: 
    21         nop_dispatcher(session_manager *m, nat_manager *n, 
    22                         policy_rule_installer *p, natfw_config *c) 
    23                 : dispatcher(m, n, p, c) { } 
    24  
    25         void send_message(msg::ntlp_msg *msg) throw () { } 
    26         id_t start_timer(const session *s, int seconds) throw () { return 0; } 
    27 }; 
    2818 
    2919 
  • natfw-nslp/trunk/eval/ni.cpp

    r2291 r2293  
    1616using namespace protlib; 
    1717 
    18  
    19 class nop_dispatcher : public dispatcher { 
    20   public: 
    21         nop_dispatcher(session_manager *m, nat_manager *n, 
    22                         policy_rule_installer *p, natfw_config *c) 
    23                 : dispatcher(m, n, p, c) { } 
    24  
    25         void send_message(msg::ntlp_msg *msg) throw () { } 
    26         id_t start_timer(const session *s, int seconds) throw () { return 0; } 
    27 }; 
    2818 
    2919 
  • natfw-nslp/trunk/eval/utils.cpp

    r2291 r2293  
    88#include "utils.h" 
    99#include "msg/natfw_msg.h" 
     10#include "session_id.h" 
    1011 
    1112 
     
    7980 
    8081 
     82void nop_dispatcher::send_message(msg::ntlp_msg *msg) throw () { 
     83        DLog("nop_dispatcher", "sending " << *msg); 
     84 
     85        ntlp::APIMsg *apimsg = mapper.create_api_msg(msg); 
     86        apimsg->get_ghc();      // no-op to prevent compiler warning 
     87 
     88        // we don't really send the message, this is just a dummy method! 
     89 
     90        delete msg; 
     91} 
     92 
     93 
     94id_t nop_dispatcher::start_timer(const session *s, int seconds) throw () { 
     95        DLog("nop_dispatcher", "starting timer: " << seconds << "s from now"); 
     96        return 0; 
     97} 
     98 
     99 
    81100} // namespace natfw 
    82101 
  • natfw-nslp/trunk/eval/utils.h

    r2290 r2293  
    88#include "network_message.h" 
    99#include "apimessage.h" 
     10#include "dispatcher.h" 
    1011 
    1112 
     
    1920ntlp::APIMsg *build_api_create_msg(); 
    2021 
     22 
     23class nop_dispatcher : public dispatcher { 
     24  private: 
     25        gistka_mapper mapper; 
     26 
     27  public: 
     28        nop_dispatcher(session_manager *m, nat_manager *n, 
     29                        policy_rule_installer *p, natfw_config *c) 
     30                : dispatcher(m, n, p, c) { } 
     31 
     32        void send_message(msg::ntlp_msg *msg) throw (); 
     33 
     34        id_t start_timer(const session *s, int seconds) throw (); 
     35}; 
     36 
     37 
    2138} 
    2239