X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetdev-provider.h;h=1eb1b1e4cacced4d2b4180bbd90967196cdcba0d;hb=87eeed4c03ebb0847c093eeb8a6b7af5f2fd33af;hp=43a330c746b60e4361ac2ef0dd4bb9162e927138;hpb=77909859b05f0d2466069883306e8d75d280bbe7;p=openvswitch diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index 43a330c7..1eb1b1e4 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -25,6 +25,10 @@ #include "list.h" #include "shash.h" +#ifdef __cplusplus +extern "C" { +#endif + struct arg { char *key; char *value; @@ -36,7 +40,8 @@ struct arg { * implementations. */ struct netdev_dev { char *name; /* Name of network device. */ - const struct netdev_class *class; /* Functions to control this device. */ + const struct netdev_class *netdev_class; /* Functions to control + this device. */ int ref_cnt; /* Times this devices was opened. */ struct shash_node *node; /* Pointer to element in global map. */ struct arg *args; /* Argument list from last config. */ @@ -53,9 +58,9 @@ void netdev_dev_get_devices(const struct netdev_class *, struct shash *device_list); static inline void netdev_dev_assert_class(const struct netdev_dev *netdev_dev, - const struct netdev_class *class) + const struct netdev_class *class_) { - assert(netdev_dev->class == class); + assert(netdev_dev->netdev_class == class_); } /* A instance of an open network device. @@ -75,9 +80,9 @@ void netdev_uninit(struct netdev *, bool close); struct netdev_dev *netdev_get_dev(const struct netdev *); static inline void netdev_assert_class(const struct netdev *netdev, - const struct netdev_class *class) + const struct netdev_class *netdev_class) { - netdev_dev_assert_class(netdev_get_dev(netdev), class); + netdev_dev_assert_class(netdev_get_dev(netdev), netdev_class); } /* A network device notifier. @@ -358,4 +363,8 @@ extern const struct netdev_class netdev_linux_class; extern const struct netdev_class netdev_tap_class; extern const struct netdev_class netdev_gre_class; +#ifdef __cplusplus +} +#endif + #endif /* netdev.h */