Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
dhcp
Commits
7203e8ee
Commit
7203e8ee
authored
Mar 06, 2000
by
Ted Lemon
Browse files
Add interface deregistration routines (Brian Murrell).
parent
0d9bfbfe
Changes
7
Hide whitespace changes
Inline
Side-by-side
common/bpf.c
View file @
7203e8ee
...
...
@@ -22,7 +22,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: bpf.c,v 1.3
3
2000/0
1/26 14:55:3
3 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: bpf.c,v 1.3
4
2000/0
3/06 19:39:5
3 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
...
...
common/dlpi.c
View file @
7203e8ee
...
...
@@ -70,7 +70,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: dlpi.c,v 1.1
7
2000/0
1/25 01:05:01
mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: dlpi.c,v 1.1
8
2000/0
3/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
...
...
common/lpf.c
View file @
7203e8ee
...
...
@@ -23,7 +23,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: lpf.c,v 1.2
1
2000/0
2/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.2
2
2000/0
3/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
,
...
...
common/nit.c
View file @
7203e8ee
...
...
@@ -23,7 +23,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: nit.c,v 1.2
6
2000/0
1/25 01:07:41
mellon Exp $ Copyright (c) 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: nit.c,v 1.2
7
2000/0
3/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
...
...
common/raw.c
View file @
7203e8ee
...
...
@@ -35,7 +35,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: raw.c,v 1.1
5 1999
/03/
1
6
06
:3
7
:5
0
mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: raw.c,v 1.1
6 2000
/03/
0
6
19
:3
9
:5
3
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
;
...
...
common/socket.c
View file @
7203e8ee
...
...
@@ -30,7 +30,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: socket.c,v 1.4
5
2000/0
2
/0
3 03:43
:5
1
mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: socket.c,v 1.4
6
2000/0
3
/0
6 19:39
:5
4
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)
...
...
common/upf.c
View file @
7203e8ee
...
...
@@ -22,7 +22,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: upf.c,v 1.1
5
2000/0
1/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.1
6
2000/0
3/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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment