/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "coverage.h"
#include "dpctl.h"
#include "dp-packet.h"
+#include "dpif-netdev.h"
#include "dynamic-string.h"
#include "flow.h"
#include "netdev.h"
#include "tnl-arp-cache.h"
#include "tnl-ports.h"
#include "util.h"
+#include "uuid.h"
#include "valgrind.h"
#include "openvswitch/vlog.h"
ovsthread_once_done(&once);
}
hash_bytes128(key, key_len, secret, hash);
+ uuid_set_bits_v4((struct uuid *)hash);
}
/* Deletes all flows from 'dpif'. Returns 0 if successful, otherwise a
error = dpif_flow_get(dpif, key->data, key->size, ufid,
PMD_ID_NULL, &reply, &flow);
if (!error
- && (!ufid || (flow.ufid_present && ovs_u128_equal(ufid, &flow.ufid)))) {
+ && (!ufid || (flow.ufid_present
+ && ovs_u128_equals(ufid, &flow.ufid)))) {
enable_feature = true;
}
int
dpif_flow_get(struct dpif *dpif,
const struct nlattr *key, size_t key_len, const ovs_u128 *ufid,
- const int pmd_id, struct ofpbuf *buf, struct dpif_flow *flow)
+ const unsigned pmd_id, struct ofpbuf *buf, struct dpif_flow *flow)
{
struct dpif_op *opp;
struct dpif_op op;
const struct nlattr *key, size_t key_len,
const struct nlattr *mask, size_t mask_len,
const struct nlattr *actions, size_t actions_len,
- const ovs_u128 *ufid, const int pmd_id,
+ const ovs_u128 *ufid, const unsigned pmd_id,
struct dpif_flow_stats *stats)
{
struct dpif_op *opp;
int
dpif_flow_del(struct dpif *dpif,
const struct nlattr *key, size_t key_len, const ovs_u128 *ufid,
- const int pmd_id, struct dpif_flow_stats *stats)
+ const unsigned pmd_id, struct dpif_flow_stats *stats)
{
struct dpif_op *opp;
struct dpif_op op;
ovs_assert(cnt == 1);
switch ((enum ovs_action_attr)type) {
+ case OVS_ACTION_ATTR_CT:
case OVS_ACTION_ATTR_OUTPUT:
case OVS_ACTION_ATTR_TUNNEL_PUSH:
case OVS_ACTION_ATTR_TUNNEL_POP:
return error;
}
+void
+dpif_register_dp_purge_cb(struct dpif *dpif, dp_purge_callback *cb, void *aux)
+{
+ if (dpif->dpif_class->register_dp_purge_cb) {
+ dpif->dpif_class->register_dp_purge_cb(dpif, cb, aux);
+ }
+}
+
void
dpif_register_upcall_cb(struct dpif *dpif, upcall_callback *cb, void *aux)
{
bool
dpif_supports_tnl_push_pop(const struct dpif *dpif)
{
- return !strcmp(dpif->dpif_class->type, "netdev") ||
- !strcmp(dpif->dpif_class->type, "dummy");
+ return dpif_is_netdev(dpif);
}