diff options
| author | David Sommerseth <davids@redhat.com> | 2011-04-11 16:36:56 +0200 |
|---|---|---|
| committer | David Sommerseth <davids@redhat.com> | 2011-04-11 16:36:56 +0200 |
| commit | 508ffffbb3c48eeeb11eeab2bf971180fe4e1940 (patch) | |
| tree | 2b8133c62a904fd400f0cef0a3e2abb12048149a /python-ethtool/etherinfo.h | |
| parent | abc7f912f66d41dd734a10900429d4cad9377da5 (diff) | |
| download | python-ethtool-508ffffbb3c48eeeb11eeab2bf971180fe4e1940.tar.gz python-ethtool-508ffffbb3c48eeeb11eeab2bf971180fe4e1940.tar.xz python-ethtool-508ffffbb3c48eeeb11eeab2bf971180fe4e1940.zip | |
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 <davids@redhat.com>
Diffstat (limited to 'python-ethtool/etherinfo.h')
| -rw-r--r-- | python-ethtool/etherinfo.h | 7 |
1 files changed, 5 insertions, 2 deletions
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 <davids@redhat.com> * @@ -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 |
