projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FAQ: Patch ports are not targeted for upstream.
[openvswitch]
/
lib
/
dpif-netdev.c
diff --git
a/lib/dpif-netdev.c
b/lib/dpif-netdev.c
index a33fe23ddca79057eb0df024e7d8fb05ebd196f8..5f7ce8ff2a87714a1dce75c450a3a07e2fe7838b 100644
(file)
--- a/
lib/dpif-netdev.c
+++ b/
lib/dpif-netdev.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009, 2010, 2011, 2012 Nicira
Networks
.
+ * Copyright (c) 2009, 2010, 2011, 2012 Nicira
, Inc
.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-165,6
+165,17
@@
get_dp_netdev(const struct dpif *dpif)
return dpif_netdev_cast(dpif)->dp;
}
return dpif_netdev_cast(dpif)->dp;
}
+static int
+dpif_netdev_enumerate(struct sset *all_dps)
+{
+ struct shash_node *node;
+
+ SHASH_FOR_EACH(node, &dp_netdevs) {
+ sset_add(all_dps, node->name);
+ }
+ return 0;
+}
+
static struct dpif *
create_dpif_netdev(struct dp_netdev *dp)
{
static struct dpif *
create_dpif_netdev(struct dp_netdev *dp)
{
@@
-702,10
+713,9
@@
set_flow_actions(struct dp_netdev_flow *flow,
}
static int
}
static int
-
add_flow(struct dpif *dpif
, const struct flow *key,
- const struct nlattr *actions, size_t actions_len)
+
dp_netdev_flow_add(struct dp_netdev *dp
, const struct flow *key,
+
const struct nlattr *actions, size_t actions_len)
{
{
- struct dp_netdev *dp = get_dp_netdev(dpif);
struct dp_netdev_flow *flow;
int error;
struct dp_netdev_flow *flow;
int error;
@@
-751,7
+761,8
@@
dpif_netdev_flow_put(struct dpif *dpif, const struct dpif_flow_put *put)
if (put->stats) {
memset(put->stats, 0, sizeof *put->stats);
}
if (put->stats) {
memset(put->stats, 0, sizeof *put->stats);
}
- return add_flow(dpif, &key, put->actions, put->actions_len);
+ return dp_netdev_flow_add(dp, &key, put->actions,
+ put->actions_len);
} else {
return EFBIG;
}
} else {
return EFBIG;
}
@@
-945,7
+956,7
@@
dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall,
free(u);
ofpbuf_uninit(buf);
free(u);
ofpbuf_uninit(buf);
- *buf = *u->packet;
+ *buf = *u
pcall
->packet;
return 0;
} else {
return 0;
} else {
@@
-1241,7
+1252,7
@@
dp_netdev_execute_actions(struct dp_netdev *dp,
const struct dpif_class dpif_netdev_class = {
"netdev",
const struct dpif_class dpif_netdev_class = {
"netdev",
- NULL, /* enumerate */
+ dpif_netdev_enumerate,
dpif_netdev_open,
dpif_netdev_close,
dpif_netdev_destroy,
dpif_netdev_open,
dpif_netdev_close,
dpif_netdev_destroy,