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/nit.c | |
parent | 0d9bfbfe141a816f099fd6fd407868913410a5b9 (diff) | |
download | isc-dhcp-7203e8eedf1c42849337d1bdde3fb33e4941835b.tar.gz |
Add interface deregistration routines (Brian Murrell).
Diffstat (limited to 'common/nit.c')
-rw-r--r-- | common/nit.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/common/nit.c b/common/nit.c index 0f4191bd..6c28a54f 100644 --- a/common/nit.c +++ b/common/nit.c @@ -23,7 +23,7 @@ #ifndef lint static char copyright[] = -"$Id: nit.c,v 1.26 2000/01/25 01:07:41 mellon Exp $ Copyright (c) 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: nit.c,v 1.27 2000/03/06 19:39:53 mellon Exp $ Copyright (c) 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -145,6 +145,25 @@ void if_register_send (info) (info -> shared_network ? info -> shared_network -> name : "")); } + +void if_deregister_send (info) + struct interface_info *info; +{ + /* If we're using the nit API for sending and receiving, + we don't need to register this interface twice. */ +#ifndef USE_NIT_RECEIVE + close (info -> wfdesc); +#endif + info -> wfdesc = -1; + if (!quiet_interface_discovery) + log_info ("Disabling output on NIT/%s%s%s", + 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_NIT_SEND */ #ifdef USE_NIT_RECEIVE @@ -229,6 +248,24 @@ void if_register_receive (info) (info -> shared_network ? info -> shared_network -> name : "")); } + +void if_deregister_receive (info) + struct interface_info *info; +{ + /* If we're using the nit API for sending and receiving, + we don't need to register this interface twice. */ + close (info -> rfdesc); + info -> rfdesc = -1; + + if (!quiet_interface_discovery) + log_info ("Disabling input on NIT/%s%s%s", + 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_NIT_RECEIVE */ #ifdef USE_NIT_SEND |