summaryrefslogtreecommitdiff
path: root/common/lpf.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-02-15 20:40:36 +0000
committerTed Lemon <source@isc.org>2000-02-15 20:40:36 +0000
commitbdcaf7b95d9b5a409919e0f359e3c651a6f1e100 (patch)
tree530fc0f6b9e5dea5c661a6c173a87491ae1ba81c /common/lpf.c
parentf824c26ece3147d93ec56e172c3e6646086ed1ee (diff)
downloadisc-dhcp-bdcaf7b95d9b5a409919e0f359e3c651a6f1e100.tar.gz
Incorporate Brian Murrell's new OMAPI DHCP client changes.
Diffstat (limited to 'common/lpf.c')
-rw-r--r--common/lpf.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/common/lpf.c b/common/lpf.c
index 2ec3a69d..e1a88be1 100644
--- a/common/lpf.c
+++ b/common/lpf.c
@@ -23,7 +23,7 @@
#ifndef lint
static char copyright[] =
-"$Id: lpf.c,v 1.20 2000/01/27 23:27:38 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: lpf.c,v 1.21 2000/02/15 20:40:30 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -106,7 +106,7 @@ void if_register_send (info)
/* If we're using the lpf API for sending and receiving,
we don't need to register this interface twice. */
#ifndef USE_LPF_RECEIVE
- info -> wfdesc = if_register_lpf (info, interface);
+ info -> wfdesc = if_register_lpf (info);
#else
info -> wfdesc = info -> rfdesc;
#endif
@@ -120,6 +120,28 @@ void if_register_send (info)
(info -> shared_network ?
info -> shared_network -> name : ""));
}
+
+void if_deregister_send (info)
+ struct interface_info *info;
+{
+ /* don't need to close twice if we are using lpf for sending and
+ receiving */
+#ifndef USE_LPF_RECEIVE
+ /* for LPF this is simple, packet filters are removed when sockets
+ are closed */
+ close (info -> wfdesc);
+#endif
+ info -> wfdesc = 0;
+ if (!quiet_interface_discovery)
+ log_info ("NOT Sending on LPF/%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_LPF_SEND */
#ifdef USE_LPF_RECEIVE
@@ -155,6 +177,24 @@ void if_register_receive (info)
info -> shared_network -> name : ""));
}
+void if_deregister_receive (info)
+ struct interface_info *info;
+{
+ /* for LPF this is simple, packet filters are removed when sockets
+ are closed */
+ close (info -> rfdesc);
+ info -> rfdesc = 0;
+ if (!quiet_interface_discovery)
+ log_info ("NOT Listening on LPF/%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 : ""));
+}
+
static void lpf_gen_filter_setup (info)
struct interface_info *info;
{