5 #ifndef SRC_BGP_BGP_SESSION_H_
6 #define SRC_BGP_BGP_SESSION_H_
8 #include <boost/scoped_ptr.hpp>
47 const std::string &data = std::string());
54 void LogNotification(
int code,
int subcode,
const std::string &direction,
55 const std::string &peer_key,
64 bool ReceiveMsg(
const u_int8_t *msg,
size_t size);
65 virtual void WriteReady(
const boost::system::error_code &error);
70 boost::scoped_ptr<BgpMessageReader>
reader_;
75 #endif // SRC_BGP_BGP_SESSION_H_
virtual void WriteReady(const boost::system::error_code &error)
boost::asio::const_buffer Buffer
boost::scoped_ptr< BgpMessageReader > reader_
boost::function< bool(const uint8_t *, size_t)> ReceiveCallback
DISALLOW_COPY_AND_ASSIGN(BgpSession)
BgpSessionManager * session_mgr_
void set_peer(BgpPeer *peer)
boost::asio::ip::tcp::socket Socket
static const int kMaxMessageSize
virtual int MsgLength(Buffer buffer, int offset)
virtual const int GetMaxMessageSize()
DISALLOW_COPY_AND_ASSIGN(BgpMessageReader)
boost::asio::const_buffer Buffer
bool ReceiveMsg(const u_int8_t *msg, size_t size)
virtual int GetSessionInstance() const
virtual ~BgpMessageReader()
static const int kHeaderLenSize
virtual void OnRead(Buffer buffer)
void LogNotification(int code, int subcode, const std::string &direction, const std::string &peer_key, const BgpProto::Notification &msg) const
void SendNotification(int code, int subcode, const std::string &data=std::string())
virtual Socket * socket() const
BgpMessageReader(TcpSession *session, ReceiveCallback callback)
virtual const int GetHeaderLenSize()
BgpSession(BgpSessionManager *session_mgr, Socket *socket)