/* Copyright 1987 by the Massachusetts Institute of Technology */
/* See permission and disclaimer notice in file notice.h */
#include	<notice.h>

/*
 *------------------------------------------------------------------
 *
 * $Source: /mit/cgw/src/gw/nip/RCS/fnip.c,v $
 * $Revision: 1.2 $
 * $Date: 89/03/18 17:33:43 $
 * $State: Exp $
 * $Author: jon $
 * $Locker: jon $
 *
 * $Log:	fnip.c,v $
 * Revision 1.2  89/03/18  17:33:43  jon
 * fix bogus reference bug in loging.  
 * 
 * Revision 1.1  87/10/12  01:59:13  jon
 * Initial revision
 * 
 * 
 *------------------------------------------------------------------
 */

#ifndef lint
static char *rcsid_fnip_c = "$Header: fnip.c,v 1.2 89/03/18 17:33:43 jon Locked $";
#endif	lint

#include	<types.h>
#include	<sys.h>
#include	"../src/const.h"
#include	"../src/param.h"
#include	"../src/defs.h"
#include	"../src/macs.h"
#include	"../src/net.h"
#include	"../src/ext.h"

#include        "nip.h"

static char nipns[] = "NIP packet from %s no server, discarded\n";

/* A fake NIP packet handler for gateways that aren't running NIP. */

/* this is gross ... need a better way of getting the hardware address
   of a packet ... this will only work for ethernet */

nip_in(iob)
reg	iorb	*iob;
{
	reg struct nip_pkt *pkt;
	char src[13];
	char *e10_paddr ();

	pkt = mknippkt(iob->i_addr);

	niflog(L_ERRU) {
		pkt = mknippkt(iob->i_addr);
		e10_paddr (12, src, pkt->np_source);
		src[12] = '\0';
		dolog(nipns, src);
	}

	freebuf(iob);
	return;
}
