diff options
author | Ted Lemon <source@isc.org> | 2000-03-06 19:39:54 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-03-06 19:39:54 +0000 |
commit | 7203e8eedf1c42849337d1bdde3fb33e4941835b (patch) | |
tree | 3066b6582794a6c89695f580e8c87ece0aa4c30b /common/dlpi.c | |
parent | 0d9bfbfe141a816f099fd6fd407868913410a5b9 (diff) | |
download | isc-dhcp-7203e8eedf1c42849337d1bdde3fb33e4941835b.tar.gz |
Add interface deregistration routines (Brian Murrell).
Diffstat (limited to 'common/dlpi.c')
-rw-r--r-- | common/dlpi.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/common/dlpi.c b/common/dlpi.c index 26601fbf..e4a60c64 100644 --- a/common/dlpi.c +++ b/common/dlpi.c @@ -70,7 +70,7 @@ #ifndef lint static char copyright[] = -"$Id: dlpi.c,v 1.17 2000/01/25 01:05:01 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dlpi.c,v 1.18 2000/03/06 19:39:53 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -357,6 +357,27 @@ void if_register_send (info) # endif #endif } + +void if_deregister_send (info) + struct interface_info *info; +{ + /* If we're using the DLPI API for sending and receiving, + we don't need to register this interface twice. */ +#ifndef USE_DLPI_RECEIVE + close (info -> wfdesc); +#endif + info -> wfdesc = -1; + + if (!quiet_interface_discovery) + log_info ("Disabling output on DLPI/%s/%s%s%s", + info -> name, + print_hw_addr (info -> hw_address.hbuf [0], + info -> hw_address.hlen - 1, + &info -> hw_address.hbuf [1]), + (info -> shared_network ? "/" : ""), + (info -> shared_network ? + info -> shared_network -> name : "")); +} #endif /* USE_DLPI_SEND */ #ifdef USE_DLPI_RECEIVE @@ -440,6 +461,27 @@ void if_register_receive (info) # endif #endif } + +void if_deregister_receive (info) + struct interface_info *info; +{ + /* If we're using the DLPI API for sending and receiving, + we don't need to register this interface twice. */ +#ifndef USE_DLPI_SEND + close (info -> rfdesc); +#endif + info -> rfdesc = -1; + + if (!quiet_interface_discovery) + log_info ("Disabling input on DLPI/%s/%s%s%s", + info -> name, + print_hw_addr (info -> hw_address.hbuf [0], + info -> hw_address.hlen - 1, + &info -> hw_address.hbuf [1]), + (info -> shared_network ? "/" : ""), + (info -> shared_network ? + info -> shared_network -> name : "")); +} #endif /* USE_DLPI_RECEIVE */ #ifdef USE_DLPI_SEND |