ofpbuf: New function ofpbuf_push_zeros().
[openvswitch] / lib / stream.h
index ae30b1031c127bec23a0e06668f9778409bc98a9..d8b0814663db00b49eb0d246e2d016f3904bf4bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #ifndef STREAM_H
 #define STREAM_H 1
 
-#include <assert.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
 
-#include "flow.h"
-
 struct pstream;
 struct stream;
 
-void stream_usage(const char *name, bool active, bool passive);
+void stream_usage(const char *name, bool active, bool passive, bool bootstrap);
 
 /* Bidirectional byte streams. */
+int stream_verify_name(const char *name);
 int stream_open(const char *name, struct stream **);
-int stream_open_block(const char *name, struct stream **);
+int stream_open_block(int error, struct stream **);
 void stream_close(struct stream *);
 const char *stream_get_name(const struct stream *);
 uint32_t stream_get_remote_ip(const struct stream *);
@@ -56,11 +54,23 @@ void stream_recv_wait(struct stream *);
 void stream_send_wait(struct stream *);
 
 /* Passive streams: listeners for incoming stream connections. */
+int pstream_verify_name(const char *name);
 int pstream_open(const char *name, struct pstream **);
 const char *pstream_get_name(const struct pstream *);
 void pstream_close(struct pstream *);
 int pstream_accept(struct pstream *, struct stream **);
 int pstream_accept_block(struct pstream *, struct stream **);
 void pstream_wait(struct pstream *);
+\f
+/* Convenience functions. */
+
+int stream_open_with_default_ports(const char *name,
+                                   uint16_t default_tcp_port,
+                                   uint16_t default_ssl_port,
+                                   struct stream **);
+int pstream_open_with_default_ports(const char *name,
+                                    uint16_t default_ptcp_port,
+                                    uint16_t default_pssl_port,
+                                    struct pstream **);
 
 #endif /* stream.h */