X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto-sflow.c;h=5351b83787f9bd8c3d62499baf6506e610ecda94;hb=3a225db7079158d1c46e56dced7ac3103a8864e2;hp=b3206c12ed3ab8eb61d2a73aca8fa0df9453815a;hpb=856081f683d3e7d5b5fa07af4233d285eb205c47;p=openvswitch diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index b3206c12..5351b837 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010 Nicira Networks. + * Copyright (c) 2009, 2010, 2011 Nicira Networks. * Copyright (c) 2009 InMon Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -72,7 +72,7 @@ static bool ofproto_sflow_options_equal(const struct ofproto_sflow_options *a, const struct ofproto_sflow_options *b) { - return (svec_equal(&a->targets, &b->targets) + return (sset_equals(&a->targets, &b->targets) && a->sampling_rate == b->sampling_rate && a->polling_interval == b->polling_interval && a->header_len == b->header_len @@ -85,7 +85,7 @@ static struct ofproto_sflow_options * ofproto_sflow_options_clone(const struct ofproto_sflow_options *old) { struct ofproto_sflow_options *new = xmemdup(old, sizeof *old); - svec_clone(&new->targets, &old->targets); + sset_clone(&new->targets, &old->targets); new->agent_device = old->agent_device ? xstrdup(old->agent_device) : NULL; new->control_ip = old->control_ip ? xstrdup(old->control_ip) : NULL; return new; @@ -95,7 +95,7 @@ static void ofproto_sflow_options_destroy(struct ofproto_sflow_options *options) { if (options) { - svec_destroy(&options->targets); + sset_destroy(&options->targets); free(options->agent_device); free(options->control_ip); free(options); @@ -395,7 +395,7 @@ ofproto_sflow_set_options(struct ofproto_sflow *os, SFLAddress agentIP; time_t now; - if (!options->targets.n || !options->sampling_rate) { + if (sset_is_empty(&options->targets) || !options->sampling_rate) { /* No point in doing any work if there are no targets or nothing to * sample. */ ofproto_sflow_clear(os); @@ -409,7 +409,7 @@ ofproto_sflow_set_options(struct ofproto_sflow *os, * collectors (which indicates that opening one or more of the configured * collectors failed, so that we should retry). */ if (options_changed - || collectors_count(os->collectors) < options->targets.n) { + || collectors_count(os->collectors) < sset_count(&options->targets)) { collectors_destroy(os->collectors); collectors_create(&options->targets, SFL_DEFAULT_COLLECTOR_PORT, &os->collectors); @@ -536,13 +536,13 @@ ofproto_sflow_received(struct ofproto_sflow *os, ovs_be16 tci; switch (nl_attr_type(a)) { - case ODPAT_OUTPUT: + case ODP_ACTION_ATTR_OUTPUT: fs.output = ofproto_sflow_odp_port_to_ifindex(os, nl_attr_get_u32(a)); n_outputs++; break; - case ODPAT_SET_DL_TCI: + case ODP_ACTION_ATTR_SET_DL_TCI: tci = nl_attr_get_be16(a); switchElem.flowType.sw.dst_vlan = vlan_tci_to_vid(tci); switchElem.flowType.sw.dst_priority = vlan_tci_to_pcp(tci);