/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
return 0;
}
+
+/* Returns the transport port on which 'pstream' is listening, or 0 if the
+ * concept doesn't apply. */
+ovs_be16
+pstream_get_bound_port(const struct pstream *pstream)
+{
+ return pstream->bound_port;
+}
\f
/* Initializes 'stream' as a new stream named 'name', implemented via 'class'.
* The initial connection status, supplied as 'connect_status', is interpreted
pstream_init(struct pstream *pstream, const struct pstream_class *class,
const char *name)
{
+ memset(pstream, 0, sizeof *pstream);
pstream->class = class;
pstream->name = xstrdup(name);
}
+
+void
+pstream_set_bound_port(struct pstream *pstream, ovs_be16 port)
+{
+ pstream->bound_port = port;
+}
\f
static int
count_fields(const char *s_)