Commit 7203e8ee authored by Ted Lemon's avatar Ted Lemon
Browse files

Add interface deregistration routines (Brian Murrell).

parent 0d9bfbfe
......@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
"$Id: bpf.c,v 1.33 2000/01/26 14:55:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: bpf.c,v 1.34 2000/03/06 19:39:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -130,6 +130,27 @@ 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 bpf API for sending and receiving,
we don't need to register this interface twice. */
#ifndef USE_BPF_RECEIVE
close (info -> wfdesc);
#endif
info -> wfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling output on BPF/%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_BPF_SEND */
#if defined (USE_BPF_RECEIVE) || defined (USE_LPF_RECEIVE)
......@@ -253,6 +274,23 @@ void if_register_receive (info)
(info -> shared_network ?
info -> shared_network -> name : ""));
}
void if_deregister_receive (info)
struct interface_info *info;
{
close (info -> rfdesc);
info -> rfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling input on BPF/%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_BPF_RECEIVE */
#ifdef USE_BPF_SEND
......
......@@ -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
......
......@@ -23,7 +23,7 @@
#ifndef lint
static char copyright[] =
"$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";
"$Id: lpf.c,v 1.22 2000/03/06 19:39:53 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -131,9 +131,9 @@ void if_deregister_send (info)
are closed */
close (info -> wfdesc);
#endif
info -> wfdesc = 0;
info -> wfdesc = -1;
if (!quiet_interface_discovery)
log_info ("NOT Sending on LPF/%s/%s%s%s",
log_info ("Disabling output on LPF/%s/%s%s%s",
info -> name,
print_hw_addr (info -> hw_address.hbuf [0],
info -> hw_address.hlen - 1,
......@@ -183,9 +183,9 @@ void if_deregister_receive (info)
/* for LPF this is simple, packet filters are removed when sockets
are closed */
close (info -> rfdesc);
info -> rfdesc = 0;
info -> rfdesc = -1;
if (!quiet_interface_discovery)
log_info ("NOT Listening on LPF/%s/%s%s%s",
log_info ("Disabling input on LPF/%s/%s%s%s",
info -> name,
print_hw_addr (info -> hw_address.hbuf [0],
info -> hw_address.hlen - 1,
......
......@@ -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
......
......@@ -35,7 +35,7 @@
#ifndef lint
static char copyright[] =
"$Id: raw.c,v 1.15 1999/03/16 06:37:50 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: raw.c,v 1.16 2000/03/06 19:39:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -85,6 +85,20 @@ void if_register_send (info)
info -> shared_network -> name : ""));
}
void if_deregister_send (info)
struct interface_info *info;
{
close (info -> wfdesc);
info -> wfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling output on Raw/%s%s%s",
info -> name,
(info -> shared_network ? "/" : ""),
(info -> shared_network ?
info -> shared_network -> name : ""));
}
size_t send_packet (interface, packet, raw, len, from, to, hto)
struct interface_info *interface;
struct packet *packet;
......
......@@ -30,7 +30,7 @@
#ifndef lint
static char copyright[] =
"$Id: socket.c,v 1.45 2000/02/03 03:43:51 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: socket.c,v 1.46 2000/03/06 19:39:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -153,6 +153,24 @@ void if_register_send (info)
(info -> shared_network ?
info -> shared_network -> name : ""));
}
#if !defined (USE_SOCKET_FALLBACK)
void if_deregister_send (info)
struct interface_info *info;
{
#ifndef USE_SOCKET_RECEIVE
close (info -> wfdesc);
#endif
info -> wfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling output on Socket/%s%s%s",
info -> name,
(info -> shared_network ? "/" : ""),
(info -> shared_network ?
info -> shared_network -> name : ""));
}
#endif /* !USE_SOCKET_FALLBACK */
#endif /* USE_SOCKET_SEND || USE_SOCKET_FALLBACK */
#ifdef USE_SOCKET_RECEIVE
......@@ -169,6 +187,19 @@ void if_register_receive (info)
(info -> shared_network ?
info -> shared_network -> name : ""));
}
void if_deregister_receive (info)
struct interface_info *info;
{
close (info -> rfdesc);
info -> rfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling input on Socket/%s%s%s",
info -> name,
(info -> shared_network ? "/" : ""),
(info -> shared_network ?
info -> shared_network -> name : ""));
#endif /* USE_SOCKET_RECEIVE */
#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_FALLBACK)
......
......@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
"$Id: upf.c,v 1.15 2000/01/25 01:17:01 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: upf.c,v 1.16 2000/03/06 19:39:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -132,6 +132,24 @@ void if_register_send (info)
(info -> shared_network ?
info -> shared_network -> name : ""));
}
void if_deregister_send (info)
struct interface_info *info;
{
#ifndef USE_UPF_RECEIVE
close (info -> wfdesc);
#endif
info -> wfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling output on UPF/%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_UPF_SEND */
#ifdef USE_UPF_RECEIVE
......@@ -198,6 +216,22 @@ void if_register_receive (info)
(info -> shared_network ?
info -> shared_network -> name : ""));
}
void if_deregister_receive (info)
struct interface_info *info;
{
close (info -> rfdesc);
info -> rfdesc = -1;
if (!quiet_interface_discovery)
log_info ("Disabling input on UPF/%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_UPF_RECEIVE */
#ifdef USE_UPF_SEND
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment