summaryrefslogtreecommitdiffstats
path: root/lib/stream.h
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-01-04 15:09:29 +0000
committerChris Hall <GMCH@hestia.halldom.com>2010-01-04 15:09:29 +0000
commit6746ef8cd683a5e0afa57a5fc90a28f533be68be (patch)
treed7608f3253abe75208db6c789752dd91840e1fcc /lib/stream.h
parent152acaa5615afcb6d5a06aaed74d2fdd4b5a1233 (diff)
downloadquagga-6746ef8cd683a5e0afa57a5fc90a28f533be68be.tar.bz2
quagga-6746ef8cd683a5e0afa57a5fc90a28f533be68be.tar.xz
Initial commit for bgp_engine branch -- seeding new files...
On branch bgp_engine modified: .gitignore modified: bgpd/Makefile.am new file: bgpd/bgp.h new file: bgpd/bgp_common.c new file: bgpd/bgp_common.h new file: bgpd/bgp_connection.c new file: bgpd/bgp_connection.h modified: bgpd/bgp_debug.c new file: bgpd/bgp_engine.c new file: bgpd/bgp_engine.h modified: bgpd/bgp_fsm.c modified: bgpd/bgp_fsm.h modified: bgpd/bgp_network.c modified: bgpd/bgp_network.h new file: bgpd/bgp_notification.c new file: bgpd/bgp_notification.h modified: bgpd/bgp_open.c new file: bgpd/bgp_open_state.c new file: bgpd/bgp_open_state.h modified: bgpd/bgp_packet.c new file: bgpd/bgp_peer.c new file: bgpd/bgp_peer.h modified: bgpd/bgp_route.c new file: bgpd/bgp_session.c new file: bgpd/bgp_session.h modified: bgpd/bgp_vty.c modified: bgpd/bgp_zebra.c modified: bgpd/bgpd.c modified: bgpd/bgpd.h modified: lib/Makefile.am modified: lib/memtypes.c modified: lib/mqueue.c modified: lib/mqueue.h new file: lib/qafi_safi.h modified: lib/qpselect.c modified: lib/qpselect.h modified: lib/qpthreads.c modified: lib/qpthreads.h modified: lib/sockopt.c modified: lib/sockunion.c modified: lib/sockunion.h modified: lib/stream.c modified: lib/stream.h modified: lib/symtab.h modified: lib/zebra.h
Diffstat (limited to 'lib/stream.h')
-rw-r--r--lib/stream.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/stream.h b/lib/stream.h
index 3e4ba7b4..4c8a4fa9 100644
--- a/lib/stream.h
+++ b/lib/stream.h
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with GNU Zebra; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * 02111-1307, USA.
*/
#ifndef _ZEBRA_STREAM_H
@@ -78,7 +78,7 @@
* The stream is empty from endp to size. Without adjusting getp, there are
* still endp-getp bytes of valid data to be read from the stream.
*
- * Methods are provided to get and put to/from the stream, as well as
+ * Methods are provided to get and put to/from the stream, as well as
* retrieve the values of the 3 markers and manipulate the getp marker.
*
* Note:
@@ -98,7 +98,7 @@ struct stream
/* Remainder is ***private*** to stream
* direct access is frowned upon!
- * Use the appropriate functions/macros
+ * Use the appropriate functions/macros
*/
size_t getp; /* next get position */
size_t endp; /* last valid data position */
@@ -127,7 +127,7 @@ struct stream_fifo
#define STREAM_DATA(S) ((S)->data)
#define STREAM_REMAIN(S) STREAM_WRITEABLE((S))
-/* Stream prototypes.
+/* Stream prototypes.
* For stream_{put,get}S, the S suffix mean:
*
* c: character (unsigned byte)
@@ -139,6 +139,7 @@ extern struct stream *stream_new (size_t);
extern void stream_free (struct stream *);
extern struct stream * stream_copy (struct stream *, struct stream *src);
extern struct stream *stream_dup (struct stream *);
+extern struct stream* stream_dup_pending(struct stream*) ;
extern size_t stream_resize (struct stream *, size_t);
extern size_t stream_get_getp (struct stream *);
extern size_t stream_get_endp (struct stream *);
@@ -177,7 +178,7 @@ extern u_int32_t stream_get_ipv4 (struct stream *);
#undef stream_read
#undef stream_write
-/* Deprecated: assumes blocking I/O. Will be removed.
+/* Deprecated: assumes blocking I/O. Will be removed.
Use stream_read_try instead. */
extern int stream_read (struct stream *, int, size_t);
@@ -185,6 +186,8 @@ extern int stream_read (struct stream *, int, size_t);
Will be removed. Use stream_read_try instead. */
extern int stream_read_unblock (struct stream *, int, size_t);
+extern int stream_read_nonblock (struct stream *s, int fd, size_t size) ;
+
/* Read up to size bytes into the stream.
Return code:
>0: number of bytes read
@@ -197,8 +200,8 @@ extern ssize_t stream_read_try(struct stream *s, int fd, size_t size);
extern ssize_t stream_recvmsg (struct stream *s, int fd, struct msghdr *,
int flags, size_t size);
-extern ssize_t stream_recvfrom (struct stream *s, int fd, size_t len,
- int flags, struct sockaddr *from,
+extern ssize_t stream_recvfrom (struct stream *s, int fd, size_t len,
+ int flags, struct sockaddr *from,
socklen_t *fromlen);
extern size_t stream_write (struct stream *, const void *, size_t);
@@ -207,6 +210,10 @@ extern void stream_reset (struct stream *);
extern int stream_flush (struct stream *, int);
extern int stream_empty (struct stream *); /* is the stream empty? */
+extern int stream_pending(struct stream* s) ;
+extern int stream_flush_try(struct stream* s, int fd) ;
+extern void* stream_transfer(void* p, struct stream* s, void* limit) ;
+
/* deprecated */
extern u_char *stream_pnt (struct stream *);