From b253101bd6199b5494c9b96862fc077454a0f2e5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 8 Oct 2008 14:09:37 -0700 Subject: [PATCH] New function dhclient_get_netdev(). --- include/dhcp-client.h | 2 ++ lib/dhcp-client.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/include/dhcp-client.h b/include/dhcp-client.h index 390914341..e0d1e37c5 100644 --- a/include/dhcp-client.h +++ b/include/dhcp-client.h @@ -46,6 +46,8 @@ int dhclient_create(const char *netdev, void *aux, struct dhclient **); void dhclient_destroy(struct dhclient *); +struct netdev *dhclient_get_netdev(struct dhclient *); + void dhclient_init(struct dhclient *, uint32_t requested_ip); void dhclient_release(struct dhclient *); void dhclient_force_renew(struct dhclient *, int deadline); diff --git a/lib/dhcp-client.c b/lib/dhcp-client.c index 1e481cf8f..db0bb0bd1 100644 --- a/lib/dhcp-client.c +++ b/lib/dhcp-client.c @@ -219,6 +219,14 @@ dhclient_destroy(struct dhclient *cli) } } +/* Returns the network device in use by 'cli'. The caller must not destroy + * the returned device. */ +struct netdev * +dhclient_get_netdev(struct dhclient *cli) +{ + return cli->netdev; +} + /* Forces 'cli' into a (re)initialization state, in which no address is bound * but the client is advertising to obtain one. If 'requested_ip' is nonzero, * then the client will attempt to re-bind to that IP address; otherwise, it -- 2.43.0