* SUCH DAMAGE.
*
* from: @(#)in.c 7.17 (Berkeley) 4/20/91
- * $Id$
+ * $Id: in.c,v 1.5 1993/11/18 00:08:13 wollman Exp $
*/
#include "param.h"
+#include "systm.h"
#include "ioctl.h"
#include "mbuf.h"
#include "socket.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
+struct in_ifaddr *in_ifaddr;
+struct ifqueue ipintrq;
+
+static void in_ifscrub(struct ifnet *, struct in_ifaddr *);
+
/*
* Formulate an Internet address from network + host.
*/
/*
* 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;
* 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;
{
* that may not be forwarded, or whether datagrams to that destination
* may be forwarded.
*/
+int
in_canforward(in)
struct in_addr in;
{
* Ifp is 0 if not an interface-specific ioctl.
*/
/* ARGSUSED */
+int
in_control(so, cmd, data, ifp)
struct socket *so;
int cmd;
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);
}
/*
* Delete any existing route for an interface.
*/
+static void
in_ifscrub(ifp, ia)
register struct ifnet *ifp;
register struct in_ifaddr *ia;
* 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;
+ int scrub;
{
register u_long i = ntohl(sin->sin_addr.s_addr);
struct sockaddr_in oldaddr;
* 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);
/*
* Return 1 if the address might be a local broadcast address.
*/
+int
in_broadcast(in)
struct in_addr in;
{