ns3-bgp  0.2
BGP module for ns-3.
Public Member Functions | List of all members
ns3::BgpNs3SocketOut Class Reference

Simple container class for FSM to send data to peer. More...

#include <bgp-ns3-socket-out.h>

Inheritance diagram for ns3::BgpNs3SocketOut:
Inheritance graph
[legend]
Collaboration diagram for ns3::BgpNs3SocketOut:
Collaboration graph
[legend]

Public Member Functions

 BgpNs3SocketOut (Ptr< Socket > socket, Callback< void, Ptr< Socket >, int, int > state_change_cb)
 Construct the container. More...
 
bool handleOut (const uint8_t *buffer, size_t length)
 Handle output from libbgp. See libbgp document. More...
 
void notifyStateChange (int old_state, int new_state)
 Handle state change notification from libbgp. See libbgp document. More...
 
void setStateChangeCallback (Callback< void, Ptr< Socket >, int, int > state_change_cb)
 Set callback to use when FSM change state. More...
 
- Public Member Functions inherited from libbgp::BgpOutHandler
virtual void notifyStateChange (__attribute__((unused)) int old_state, __attribute__((unused)) int new_state)
 

Detailed Description

Simple container class for FSM to send data to peer.

Definition at line 25 of file bgp-ns3-socket-out.h.

Constructor & Destructor Documentation

◆ BgpNs3SocketOut()

ns3::BgpNs3SocketOut::BgpNs3SocketOut ( Ptr< Socket >  socket,
Callback< void, Ptr< Socket >, int, int >  state_change_cb 
)

Construct the container.

Parameters
socketsocket to write to.
state_change_cbCallback to notify FSM state changes.

Definition at line 21 of file bgp-ns3-socket-out.cc.

Member Function Documentation

◆ handleOut()

bool ns3::BgpNs3SocketOut::handleOut ( const uint8_t *  buffer,
size_t  length 
)
virtual

Handle output from libbgp. See libbgp document.

Parameters
bufferPacket buffer.
lengthBuffer size.
Returns
true Packet written.
false Failed to write packet.

Implements libbgp::BgpOutHandler.

Definition at line 34 of file bgp-ns3-socket-out.cc.

◆ notifyStateChange()

void ns3::BgpNs3SocketOut::notifyStateChange ( int  old_state,
int  new_state 
)

Handle state change notification from libbgp. See libbgp document.

Parameters
old_stateOld state.
new_stateNew state.

Definition at line 44 of file bgp-ns3-socket-out.cc.

◆ setStateChangeCallback()

void ns3::BgpNs3SocketOut::setStateChangeCallback ( Callback< void, Ptr< Socket >, int, int >  state_change_cb)

Set callback to use when FSM change state.

Parameters
state_change_cbCallback.

Definition at line 53 of file bgp-ns3-socket-out.cc.


The documentation for this class was generated from the following files: