aboutsummaryrefslogtreecommitdiff
path: root/lib/stream-tcp.c
diff options
context:
space:
mode:
authorMehak Mahajan <mmahajan@nicira.com>2012-03-10 15:58:10 -0800
committerMehak Mahajan <mmahajan@nicira.com>2012-03-23 18:13:08 -0700
commitf125905cdd3dc0339ad968c0a70128807884b400 (patch)
treeab389d41b625f2d9e5c820bdac80ec2df825ff8a /lib/stream-tcp.c
parent11460e2316b88f0bd0ea0005d94338d800ea16bd (diff)
Allow configuring DSCP on controller and manager connections.
The changes allow the user to specify a separate dscp value for the controller connection and the manager connection. The value will take effect on resetting the connections. If no value is specified a default value of 192 is chosen for each of the connections. Feature #10074 Requested-by: Rajiv Ramanathan <rramanathan@nicira.com> Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Diffstat (limited to 'lib/stream-tcp.c')
-rw-r--r--lib/stream-tcp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c
index 052ad8cb..c7a2ee2e 100644
--- a/lib/stream-tcp.c
+++ b/lib/stream-tcp.c
@@ -38,7 +38,7 @@ VLOG_DEFINE_THIS_MODULE(stream_tcp);
static int
new_tcp_stream(const char *name, int fd, int connect_status,
- const struct sockaddr_in *remote, struct stream **streamp)
+ const struct sockaddr_in *remote, struct stream **streamp)
{
struct sockaddr_in local;
socklen_t local_len = sizeof local;
@@ -70,12 +70,12 @@ new_tcp_stream(const char *name, int fd, int connect_status,
}
static int
-tcp_open(const char *name, char *suffix, struct stream **streamp)
+tcp_open(const char *name, char *suffix, struct stream **streamp, uint8_t dscp)
{
struct sockaddr_in sin;
int fd, error;
- error = inet_open_active(SOCK_STREAM, suffix, 0, &sin, &fd);
+ error = inet_open_active(SOCK_STREAM, suffix, 0, &sin, &fd, dscp);
if (fd >= 0) {
return new_tcp_stream(name, fd, error, &sin, streamp);
} else {
@@ -102,13 +102,14 @@ static int ptcp_accept(int fd, const struct sockaddr *sa, size_t sa_len,
struct stream **streamp);
static int
-ptcp_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp)
+ptcp_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp,
+ uint8_t dscp)
{
struct sockaddr_in sin;
char bound_name[128];
int fd;
- fd = inet_open_passive(SOCK_STREAM, suffix, -1, &sin);
+ fd = inet_open_passive(SOCK_STREAM, suffix, -1, &sin, dscp);
if (fd < 0) {
return -fd;
}