From 0341d5ce47c301b4a4d92b77a83930da4fdc8fb3 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Sat, 23 Jan 2010 11:21:17 +0000 Subject: Blitz on bgp_msg_read, particularly OPEN message handling In the BGP Engine the OPEN message needs to be processed into the open_recv structure in the *connection*. The OPEN that arrives must be checked for acceptability before it is acknowledged. Later the connection may be discarded in collision resolution, or the connection may become the Established connection, and the open_recv structure is passed to the session and hence to the Peering Engine. modified: bgpd/bgp.h modified: bgpd/bgp_common.c modified: bgpd/bgp_common.h modified: bgpd/bgp_connection.c modified: bgpd/bgp_connection.h modified: bgpd/bgp_fsm.c modified: bgpd/bgp_msg_read.c modified: bgpd/bgp_msg_read.h modified: bgpd/bgp_msg_write.c modified: bgpd/bgp_notification.c modified: bgpd/bgp_notification.h modified: bgpd/bgp_open.h modified: bgpd/bgp_open_state.c modified: bgpd/bgp_open_state.h modified: bgpd/bgp_packet.c modified: bgpd/bgp_session.h modified: lib/distribute.c modified: lib/if_rmap.c modified: lib/qafi_safi.h modified: lib/stream.c modified: lib/stream.h --- lib/stream.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/stream.c') diff --git a/lib/stream.c b/lib/stream.c index dc636361..79ce1791 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -214,6 +214,13 @@ stream_get_endp (struct stream *s) return s->endp; } +size_t +stream_get_left (struct stream *s) +{ + STREAM_VERIFY_SANE(s); + return s->endp - s->getp ; +} + size_t stream_get_size (struct stream *s) { -- cgit v1.2.3