X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=ofproto%2Fdiscovery.c;h=2044ea5e4b7df3a61d810d3fbcd73790e63db744;hb=79c9f2ee7883b52860c76c3730725f5731402874;hp=2868db5a8599f4b895385b8ac8e0b59695497d99;hpb=a5e54d9b6f8002f34cc792df69e6eda68cf95223;p=openvswitch diff --git a/ofproto/discovery.c b/ofproto/discovery.c index 2868db5a..2044ea5e 100644 --- a/ofproto/discovery.c +++ b/ofproto/discovery.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 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. @@ -29,7 +29,7 @@ #include "openflow/openflow.h" #include "packets.h" #include "status.h" -#include "vconn-ssl.h" +#include "stream-ssl.h" #define THIS_MODULE VLM_discovery #include "vlog.h" @@ -102,7 +102,7 @@ discovery_create(const char *re, bool update_resolv_conf, char local_name[IF_NAMESIZE]; int error; - d = xcalloc(1, sizeof *d); + d = xzalloc(sizeof *d); /* Controller regular expression. */ error = discovery_set_accept_controller_re(d, re); @@ -155,6 +155,12 @@ discovery_destroy(struct discovery *d) } } +bool +discovery_get_update_resolv_conf(const struct discovery *d) +{ + return d->update_resolv_conf; +} + void discovery_set_update_resolv_conf(struct discovery *d, bool update_resolv_conf) @@ -162,6 +168,12 @@ discovery_set_update_resolv_conf(struct discovery *d, d->update_resolv_conf = update_resolv_conf; } +const char * +discovery_get_accept_controller_re(const struct discovery *d) +{ + return d->re; +} + int discovery_set_accept_controller_re(struct discovery *d, const char *re_) { @@ -169,7 +181,7 @@ discovery_set_accept_controller_re(struct discovery *d, const char *re_) int error; char *re; - re = (!re_ ? xstrdup(vconn_ssl_is_configured() ? "^ssl:.*" : "^tcp:.*") + re = (!re_ ? xstrdup(stream_ssl_is_configured() ? "^ssl:.*" : "^tcp:.*") : re_[0] == '^' ? xstrdup(re_) : xasprintf("^%s", re_)); regex = xmalloc(sizeof *regex); error = regcomp(regex, re, REG_NOSUB | REG_EXTENDED); @@ -244,7 +256,7 @@ discovery_wait(struct discovery *d) } static void -modify_dhcp_request(struct dhcp_msg *msg, void *aux UNUSED) +modify_dhcp_request(struct dhcp_msg *msg, void *aux OVS_UNUSED) { dhcp_msg_put_string(msg, DHCP_CODE_VENDOR_CLASS, "OpenFlow"); }