|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v4 09/11] lib/uknetdev: Promiscuous mode interfaces
On 11.10.18 16:58, Sharan Santhanam wrote: Hello Simon, Please find the comments inline. On 10/10/2018 02:00 PM, Simon Kuenzer wrote:From: Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx> Add interfaces to query, enable, and disable promiscuous mode for a netdev. Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> Signed-off-by: Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx> --- lib/uknetdev/exportsyms.uk | 2 ++ lib/uknetdev/include/uk/netdev.h | 26 ++++++++++++++++++++++++++ lib/uknetdev/include/uk/netdev_core.h | 9 +++++++++lib/uknetdev/netdev.c | 35 +++++++++++++++++++++++++++++++++++4 files changed, 72 insertions(+) diff --git a/lib/uknetdev/exportsyms.uk b/lib/uknetdev/exportsyms.uk index 8b13499..6e8b06b 100644 --- a/lib/uknetdev/exportsyms.uk +++ b/lib/uknetdev/exportsyms.uk @@ -24,3 +24,5 @@ uk_netdev_txq_configure uk_netdev_start uk_netdev_hwaddr_set uk_netdev_hwaddr_get +uk_netdev_promiscuous_get +uk_netdev_promiscuous_setdiff --git a/lib/uknetdev/include/uk/netdev.h b/lib/uknetdev/include/uk/netdev.hindex 423e321..b06978a 100644 --- a/lib/uknetdev/include/uk/netdev.h +++ b/lib/uknetdev/include/uk/netdev.h@@ -309,6 +309,32 @@ const struct uk_hwaddr *uk_netdev_hwaddr_get(struct uk_netdev *dev);*/int uk_netdev_hwaddr_set(struct uk_netdev *dev, const struct uk_hwaddr *hwaddr);+/**+ * Returns if promiscuous mode is enabled for an Unikraft network device.+ * + * @param dev + * The Unikraft Network Device. + * @return + * - (1): if promiscuous is enabled + * - (0): if promiscuous is disabled.We should rephrase it as < 0 for error, as it depend on the device driver Yes + * - (-1): on error + */ +int uk_netdev_promiscuous_get(struct uk_netdev *dev); + +/** + * Enables or disables promiscuous mode for an Unikraft network device. + * + * @param dev + * The Unikraft Network Device. + * @param mode + * - (0): disable promiscuous mode + * - (1): enable promiscuous mode + * @return + * - (0): if successful. + * - (-ENOTSUP): if driver doesn't support promiscuous mode. + */ +int uk_netdev_promiscuous_set(struct uk_netdev *dev, int mode); + #ifdef __cplusplus } #endifdiff --git a/lib/uknetdev/include/uk/netdev_core.h b/lib/uknetdev/include/uk/netdev_core.hindex cca6d13..0171127 100644 --- a/lib/uknetdev/include/uk/netdev_core.h +++ b/lib/uknetdev/include/uk/netdev_core.h@@ -241,6 +241,11 @@ typedef const struct uk_hwaddr *(*uk_netdev_hwaddr_get_t)(typedef int (*uk_netdev_hwaddr_set_t)(struct uk_netdev *dev, const struct uk_hwaddr *hwaddr); +/** Driver callback type to get the current promiscuous mode */ +typedef int (*uk_netdev_promiscuous_get_t)(struct uk_netdev *dev); + +/** Driver callback type to enable or disable promiscuous mode */+typedef int (*uk_netdev_promiscuous_set_t)(struct uk_netdev *dev, int mode); _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |