From 508ffffbb3c48eeeb11eeab2bf971180fe4e1940 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 11 Apr 2011 16:36:56 +0200 Subject: Only open the NETLINK interface when needed Do not open a NETLINK connection when loading the module, but rahter open it when needed. In a case where multiple users needs the connection, it will be shared and only closed when the last active user is done. Signed-off-by: David Sommerseth --- python-ethtool/etherinfo.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python-ethtool/etherinfo.h') diff --git a/python-ethtool/etherinfo.h b/python-ethtool/etherinfo.h index db368db..5e1056a 100644 --- a/python-ethtool/etherinfo.h +++ b/python-ethtool/etherinfo.h @@ -1,6 +1,6 @@ /* etherinfo.h - Retrieve ethernet interface info via NETLINK * - * Copyright (C) 2009-2010 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * David Sommerseth * @@ -26,10 +26,13 @@ typedef enum {NLQRY_LINK, NLQRY_ADDR} nlQuery; /**< Supported query types in the etherinfo code */ -int get_etherinfo(struct etherinfo *ethinf, struct nl_handle *nlc, nlQuery query); +int get_etherinfo(struct etherinfo_obj_data *data, nlQuery query); void free_etherinfo(struct etherinfo *ptr); void dump_etherinfo(FILE *, struct etherinfo *); void free_ipv6addresses(struct ipv6address *ptr); +int open_netlink(struct etherinfo_obj_data *); +void close_netlink(struct etherinfo_obj_data *); + #endif -- cgit