ns3-bgp  0.2
BGP module for ns-3.
bgp-ns3-socket-out.h
Go to the documentation of this file.
1 
11 #ifndef BGP_NS3_SOCKET_OUT_H
12 #define BGP_NS3_SOCKET_OUT_H
13 
14 #include <libbgp/bgp-out-handler.h>
15 #include "ns3/socket.h"
16 #include "ns3/simple-ref-count.h"
17 #include "ns3/callback.h"
18 
19 namespace ns3 {
20 
25 class BgpNs3SocketOut : public libbgp::BgpOutHandler, public SimpleRefCount<BgpNs3SocketOut> {
26 public:
27  BgpNs3SocketOut(Ptr<Socket> socket, Callback<void, Ptr<Socket>, int, int> state_change_cb);
28  bool handleOut(const uint8_t *buffer, size_t length);
29  void notifyStateChange(int old_state, int new_state);
30  void setStateChangeCallback(Callback<void, Ptr<Socket>, int, int> state_change_cb);
31 private:
32  Ptr<Socket> _socket;
33  Callback<void, Ptr<Socket>, int, int> _state_change_cb;
34 };
35 
36 }
37 
38 #endif //BGP_NS3_SOCKET_OUT_H
bool handleOut(const uint8_t *buffer, size_t length)
Handle output from libbgp. See libbgp document.
void notifyStateChange(int old_state, int new_state)
Handle state change notification from libbgp. See libbgp document.
Definition: bgp-log.cc:15
Simple container class for FSM to send data to peer.
void setStateChangeCallback(Callback< void, Ptr< Socket >, int, int > state_change_cb)
Set callback to use when FSM change state.
BgpNs3SocketOut(Ptr< Socket > socket, Callback< void, Ptr< Socket >, int, int > state_change_cb)
Construct the container.