projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
[unix-history]
/
sys
/
netinet
/
in.c
diff --git
a/sys/netinet/in.c
b/sys/netinet/in.c
index
75824d1
..
c3a90c3
100644
(file)
--- a/
sys/netinet/in.c
+++ b/
sys/netinet/in.c
@@
-30,10
+30,12
@@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)in.c 7.17 (Berkeley) 4/20/91
+ * from: @(#)in.c 7.17 (Berkeley) 4/20/91
+ * $Id: in.c,v 1.5 1993/11/18 00:08:13 wollman Exp $
*/
#include "param.h"
*/
#include "param.h"
+#include "systm.h"
#include "ioctl.h"
#include "mbuf.h"
#include "socket.h"
#include "ioctl.h"
#include "mbuf.h"
#include "socket.h"
@@
-41,11
+43,15
@@
#include "in_systm.h"
#include "net/if.h"
#include "net/route.h"
#include "in_systm.h"
#include "net/if.h"
#include "net/route.h"
-#include "net/af.h"
#include "in.h"
#include "in_var.h"
#ifdef INET
#include "in.h"
#include "in_var.h"
#ifdef INET
+struct in_ifaddr *in_ifaddr;
+struct ifqueue ipintrq;
+
+static void in_ifscrub(struct ifnet *, struct in_ifaddr *);
+
/*
* Formulate an Internet address from network + host.
*/
/*
* Formulate an Internet address from network + host.
*/
@@
-105,6
+111,7
@@
in_netof(in)
/*
* Compute and save network mask as sockaddr from an internet address.
*/
/*
* Compute and save network mask as sockaddr from an internet address.
*/
+void
in_sockmaskof(in, sockmask)
struct in_addr in;
register struct sockaddr_in *sockmask;
in_sockmaskof(in, sockmask)
struct in_addr in;
register struct sockaddr_in *sockmask;
@@
-192,6
+199,7
@@
int subnetsarelocal = SUBNETSARELOCAL;
* is true, this includes other subnets of the local net.
* Otherwise, it includes only the directly-connected (sub)nets.
*/
* is true, this includes other subnets of the local net.
* Otherwise, it includes only the directly-connected (sub)nets.
*/
+int
in_localaddr(in)
struct in_addr in;
{
in_localaddr(in)
struct in_addr in;
{
@@
-215,6
+223,7
@@
in_localaddr(in)
* that may not be forwarded, or whether datagrams to that destination
* may be forwarded.
*/
* that may not be forwarded, or whether datagrams to that destination
* may be forwarded.
*/
+int
in_canforward(in)
struct in_addr in;
{
in_canforward(in)
struct in_addr in;
{
@@
-239,6
+248,7
@@
extern struct ifnet loif;
* Ifp is 0 if not an interface-specific ioctl.
*/
/* ARGSUSED */
* Ifp is 0 if not an interface-specific ioctl.
*/
/* ARGSUSED */
+int
in_control(so, cmd, data, ifp)
struct socket *so;
int cmd;
in_control(so, cmd, data, ifp)
struct socket *so;
int cmd;
@@
-363,7
+373,8
@@
in_control(so, cmd, data, ifp)
oldaddr = ia->ia_dstaddr;
ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
if (ifp->if_ioctl &&
oldaddr = ia->ia_dstaddr;
ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
if (ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, ia))) {
+ (error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR,
+ (caddr_t)ia))) {
ia->ia_dstaddr = oldaddr;
return (error);
}
ia->ia_dstaddr = oldaddr;
return (error);
}
@@
-462,6
+473,7
@@
in_control(so, cmd, data, ifp)
/*
* Delete any existing route for an interface.
*/
/*
* Delete any existing route for an interface.
*/
+static void
in_ifscrub(ifp, ia)
register struct ifnet *ifp;
register struct in_ifaddr *ia;
in_ifscrub(ifp, ia)
register struct ifnet *ifp;
register struct in_ifaddr *ia;
@@
-480,10
+492,12
@@
in_ifscrub(ifp, ia)
* Initialize an interface's internet address
* and routing table entry.
*/
* Initialize an interface's internet address
* and routing table entry.
*/
+int
in_ifinit(ifp, ia, sin, scrub)
register struct ifnet *ifp;
register struct in_ifaddr *ia;
struct sockaddr_in *sin;
in_ifinit(ifp, ia, sin, scrub)
register struct ifnet *ifp;
register struct in_ifaddr *ia;
struct sockaddr_in *sin;
+ int scrub;
{
register u_long i = ntohl(sin->sin_addr.s_addr);
struct sockaddr_in oldaddr;
{
register u_long i = ntohl(sin->sin_addr.s_addr);
struct sockaddr_in oldaddr;
@@
-496,7
+510,8
@@
in_ifinit(ifp, ia, sin, scrub)
* if this is its first address,
* and to validate the address if necessary.
*/
* if this is its first address,
* and to validate the address if necessary.
*/
- if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) {
+ if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR,
+ (caddr_t)ia))) {
splx(s);
ia->ia_addr = oldaddr;
return (error);
splx(s);
ia->ia_addr = oldaddr;
return (error);
@@
-570,6
+585,7
@@
in_iaonnetof(net)
/*
* Return 1 if the address might be a local broadcast address.
*/
/*
* Return 1 if the address might be a local broadcast address.
*/
+int
in_broadcast(in)
struct in_addr in;
{
in_broadcast(in)
struct in_addr in;
{