2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

netdev: Pass class structure, instead of type, to "create" function.

This opens up the possibility of storing private data at a relative offset
to the class structure, instead of having to keep a separate table.
This commit is contained in:
Ben Pfaff
2010-09-24 10:54:42 -07:00
parent 6fcfff1b11
commit b8dcf5e9c5
5 changed files with 20 additions and 22 deletions

View File

@@ -129,11 +129,11 @@ struct netdev_class {
* to be called. May be null if nothing is needed here. */
void (*wait)(void);
/* Attempts to create a network device of 'type' with 'name'.
* 'type' corresponds to the 'type' field used in the netdev_class
* structure. On success sets 'netdev_devp' to the newly created device. */
int (*create)(const char *name, const char *type, const struct shash *args,
struct netdev_dev **netdev_devp);
/* Attempts to create a network device named 'name' with initial 'args' in
* 'netdev_class'. On success sets 'netdev_devp' to the newly created
* device. */
int (*create)(const struct netdev_class *netdev_class, const char *name,
const struct shash *args, struct netdev_dev **netdev_devp);
/* Destroys 'netdev_dev'.
*