/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1994-2007 Apple Inc. All rights reserved.
*
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
*
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*----------------------------------------------------------------------------
*
*
*----------------------------------------------------------------------------
*
- * Copyright (c) 1994, 1996, 1997, 1998 Apple Computer, Inc.
*/
#include <sys/errno.h>
#include <netat/sysglue.h>
#include <netat/appletalk.h>
+#include <netat/at_pcb.h>
#include <netat/at_var.h>
#include <netat/ddp.h>
#include <netat/rtmp.h>
-#include <netat/at_pcb.h>
#include <netat/zip.h>
#include <netat/routing_tables.h>
#include <netat/at_snmp.h>
short ErrorRTMPoverflow = 0; /* flag if RTMP table is too small for this net */
short ErrorZIPoverflow = 0; /* flag if ZIP table is too small for this net */
- /* prototypes */
-void getIfUsage( int, at_ifnames_t *);
/*
* This a temporary function : just to display the router error
*/
-void RouterError(port, err_number)
-short port, err_number;
-
+void RouterError(__unused short port, short err_number)
{
switch (err_number) {
{
RT_entry *ptree = &RT_table_start;
+#if DEBUG
register at_net_al NetStart = NewEntry->NetStart;
+#endif
register at_net_al NetStop = NewEntry->NetStop;
dPrintf(D_M_RTMP_LOW, D_L_ROUTING, ("rt_binsert: for Net %d-%d state=x%x NextIR %d:%d\n",
*
*/
-RT_entry *rt_bdelete (NetStop, NetStart)
- at_net_al NetStop, NetStart;
+RT_entry *rt_bdelete (at_net_al NetStop, __unused at_net_al NetStart)
{
- RT_entry *rt_found, *pprevious, *pnext, *pnextl, *psub;
+ RT_entry *rt_found, *pprevious = NULL, *pnext, *pnextl, *psub;
at_net_al LowEnd;
rt_found = &RT_table_start;
}
-RT_entry *rt_sortedshow(parent)
-RT_entry *parent;
+#if DEBUG
+RT_entry *rt_sortedshow(RT_entry *parent);
+RT_entry *rt_sortedshow(RT_entry *parent)
{
RT_entry *me;
* debug only: display the contents of the routing table
*/
-void rt_show ()
+void rt_show(void);
+void rt_show(void)
{
RT_entry *ptree;
int i=0;
i++;
}
}
+#endif /* DEBUG */
/*
* prepare the indexing of the free entries in the RTMP table
*/
+int
rt_table_init()
{
short i;
* zt_add_zone: add a zone name in the zone table.
*/
+int
zt_add_zone(name, length)
char *name;
short length;
{
register short res,i;
- if (res = zt_find_zname(zname))
+ if ((res = zt_find_zname(zname)))
return(res);
for (i = 0; i < ZT_maxentry ; i++) {
/*
* zt_compute_hash: compute hash index from the zone name string
*/
+static short zt_compute_hash(at_nvestr_t *);
-short zt_compute_hash(zname)
+static short zt_compute_hash(zname)
at_nvestr_t *zname;
{
register u_short checksum=0, i;
* zt_upper_zname: translate the name string into uppercase
*/
+#if 0
void zt_upper_zname(zname)
at_nvestr_t *zname;
{
zname->str[i] = c1;
}
}
+#endif
/*
* zt_get_zmcast: calcularte the zone multicast address for a
* Returns the result in "buffer"
*/
+int
zt_get_zmcast(ifID, zname, buffer)
at_ifaddr_t *ifID; /* we want to know the media type */
at_nvestr_t *zname; /* source name for multicast address */
/*
* zt_ent_zcount: count the number of actives zone for a routing entry
*/
-
+int
zt_ent_zcount(ent)
RT_entry *ent;
{
/*
* zt_find_zname: match a zone name in the zone table and return the entry if found
*/
+int
zt_find_zname(zname)
at_nvestr_t *zname;
{
*/
void zt_set_zmap(znum, zmap)
u_short znum;
- char *zmap;
+ unsigned char *zmap;
{
register u_short num = znum -1;
/*
* zt_clr_zmap: clear a bit for the corresponding zone map in an entry bitmap
*/
+#if 0
void zt_clr_zmap(znum, zmap)
u_short znum;
char *zmap;
ZT_table[num].ZoneCount--;
}
}
-
+#endif
/*
* routing_needed :
return(NULL);
}
-
+int
getRtmpTableSize()
{
register int i;
return(0);
}
-getZipTableSize()
+int
+getZipTableSize(void)
{
register int i;
register ZT_entry *zt;
return(0);
}
+void
getRtmpTable(d,s,c)
RT_entry *d; /* destination */
int s; /* starting entry */
}
}
+void
getZipTable(d,s,c)
ZT_entry *d; /* destination */
int s; /* starting entry */
at_nvestr_t *getRTRLocalZone(ifz)
zone_usage_t *ifz;
{
- char *zmap;
+ unsigned char *zmap = NULL;
RT_entry *route;
int i, j, index;
int zcnt=0; /* zone we're pointing to in the list */