#ifdef AURP_SUPPORT
#include <sys/errno.h>
#include <sys/types.h>
#include <sys/param.h>
#include <machine/spl.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/filedesc.h>
#include <sys/fcntl.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <net/if.h>
#include <netat/sysglue.h>
#include <netat/appletalk.h>
#include <netat/at_pcb.h>
#include <netat/at_var.h>
#include <netat/routing_tables.h>
#include <netat/aurp.h>
#include <netat/debug.h>
void AURPsend(mdata, type, node)
gbuf_t *mdata;
int type, node;
{
struct aurp_domain *domain;
gbuf_t *m;
int msize = AT_WR_OFFSET+32+IP_DOMAINSIZE;
if ((m = gbuf_alloc(msize, PRI_MED)) == 0) {
gbuf_freem(mdata);
dPrintf(D_M_AURP, D_L_WARNING, ("AURPsend: gbuf_alloc failed\n"));
return;
}
gbuf_wset(m,msize);
gbuf_rinc(m,AT_WR_OFFSET+32);
gbuf_cont(m) = mdata;
domain = (struct aurp_domain *)gbuf_rptr(m);
domain->dst_length = IP_LENGTH;
domain->dst_authority = IP_AUTHORITY;
domain->dst_distinguisher = IP_DISTINGUISHER;
domain->src_length = IP_LENGTH;
domain->src_authority = IP_AUTHORITY;
domain->src_distinguisher = IP_DISTINGUISHER;
domain->src_address = aurp_global.src_addr;
domain->version = AUD_Version;
domain->reserved = 0;
domain->type = type;
domain->dst_address = aurp_global.dst_addr[node];
atalk_to_ip(m);
}
void AURPcmdx(code, mdata, param)
int code;
gbuf_t *mdata;
int param;
{
unsigned char node;
gbuf_t *mdata_next;
if (mdata == 0)
return;
if (aurp_gref == 0) {
if (code != AURPCODE_DEBUGINFO)
AURPfreemsg(mdata);
return;
}
switch (code) {
case AURPCODE_DATAPKT:
node = (unsigned char)param;
if (gbuf_next(mdata)) {
mdata_next = gbuf_next(mdata);
gbuf_next(mdata) = 0;
AURPsend(mdata, AUD_Atalk, node);
do {
mdata = mdata_next;
mdata_next = gbuf_next(mdata);
gbuf_next(mdata) = 0;
AURPsend(mdata, AUD_Atalk, node);
} while (mdata_next);
} else
AURPsend(mdata, AUD_Atalk, node);
break;
case AURPCODE_RTUPDATE:
AURPrtupdate((RT_entry *)mdata, param);
break;
case AURPCODE_DEBUGINFO:
dbgBits = *(dbgBits_t *)mdata;
net_port = param;
break;
default:
dPrintf(D_M_AURP, D_L_ERROR, ("AURPcmdx: bad code, %d\n", code));
}
}
#endif