From: Ben Pfaff Date: Wed, 8 Oct 2008 21:09:37 +0000 (-0700) Subject: New function dhclient_get_netdev(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b253101bd6199b5494c9b96862fc077454a0f2e5;p=openvswitch New function dhclient_get_netdev(). --- diff --git a/include/dhcp-client.h b/include/dhcp-client.h index 39091434..e0d1e37c 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 1e481cf8..db0bb0bd 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