summaryrefslogtreecommitdiffstats
path: root/usr.sbin/IPXrouted/trace.c
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>1997-07-06 07:38:36 +0000
committerjhay <jhay@FreeBSD.org>1997-07-06 07:38:36 +0000
commit18fa8ff2b470b736a50fb803e1e891bc2f4d247b (patch)
tree99ed7bad5d7b247fd7423644806e43dc4dc3a8dc /usr.sbin/IPXrouted/trace.c
parent60f787e21f64c5425b302b242c9a638f55ebb6ad (diff)
downloadFreeBSD-src-18fa8ff2b470b736a50fb803e1e891bc2f4d247b.zip
FreeBSD-src-18fa8ff2b470b736a50fb803e1e891bc2f4d247b.tar.gz
Major IPXrouted rework.
In rt_change() remember to update the interface pointer otherwise we will send the RIP packets to the wrong interface(s) in future. Update the hash generator and increase the size of the hash tables. Only use the network and host parts when comparing IPX interface addresses. Immediately broadscast RIP and SAP changes. Change the alarm code to use the setitimer() call and only set a flag in the alarm signal handler. This gets rid of possible race conditions. Remove the host routing table. IPX RIP cannot do host routes, only net routes. Make the delay between broadcast packets 50ms. It seems that some Netware 4.x servers is very slow and don't have much input buffering. Handle received messages about networks and services that go down, better. Add tracing of RIP and SAP changes. It gets sysloged with a level of LOG_DEBUG.
Diffstat (limited to 'usr.sbin/IPXrouted/trace.c')
-rw-r--r--usr.sbin/IPXrouted/trace.c83
1 files changed, 82 insertions, 1 deletions
diff --git a/usr.sbin/IPXrouted/trace.c b/usr.sbin/IPXrouted/trace.c
index 3b76d2c..a4c5df9 100644
--- a/usr.sbin/IPXrouted/trace.c
+++ b/usr.sbin/IPXrouted/trace.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: trace.c,v 1.4 1997/02/22 16:01:04 peter Exp $
*/
#ifndef lint
@@ -219,6 +219,87 @@ traceaction(fd, action, rt)
}
void
+traceactionlog(action, rt)
+ char *action;
+ struct rt_entry *rt;
+{
+ struct sockaddr_ipx *dst, *gate;
+ static struct bits {
+ int t_bits;
+ char *t_name;
+ } flagbits[] = {
+ { RTF_UP, "UP" },
+ { RTF_GATEWAY, "GATEWAY" },
+ { RTF_HOST, "HOST" },
+ { 0 }
+ }, statebits[] = {
+ { RTS_PASSIVE, "PASSIVE" },
+ { RTS_REMOTE, "REMOTE" },
+ { RTS_INTERFACE,"INTERFACE" },
+ { RTS_CHANGED, "CHANGED" },
+ { 0 }
+ };
+ register struct bits *p;
+ register int first;
+ char *cp;
+ char *lstr, *olstr;
+
+ dst = (struct sockaddr_ipx *)&rt->rt_dst;
+ gate = (struct sockaddr_ipx *)&rt->rt_router;
+ asprintf(&lstr, "%s dst %s,", action, ipxdp_ntoa(&dst->sipx_addr));
+ olstr = lstr;
+ asprintf(&lstr, "%s router %s, metric %d, ticks %d, flags",
+ olstr, ipxdp_ntoa(&gate->sipx_addr), rt->rt_metric, rt->rt_ticks);
+ free(olstr);
+ olstr = lstr;
+ cp = "%s %s";
+ for (first = 1, p = flagbits; p->t_bits > 0; p++) {
+ if ((rt->rt_flags & p->t_bits) == 0)
+ continue;
+ asprintf(&lstr, cp, olstr, p->t_name);
+ free(olstr);
+ olstr = lstr;
+ if (first) {
+ cp = "%s|%s";
+ first = 0;
+ }
+ }
+ asprintf(&lstr, "%s state", olstr);
+ free(olstr);
+ olstr = lstr;
+ cp = "%s %s";
+ for (first = 1, p = statebits; p->t_bits > 0; p++) {
+ if ((rt->rt_state & p->t_bits) == 0)
+ continue;
+ asprintf(&lstr, cp, olstr, p->t_name);
+ free(olstr);
+ olstr = lstr;
+ if (first) {
+ cp = "%s|%s";
+ first = 0;
+ }
+ }
+ syslog(LOG_DEBUG, lstr);
+ free(lstr);
+}
+
+void
+tracesapactionlog(action, sap)
+ char *action;
+ struct sap_entry *sap;
+{
+ syslog(LOG_DEBUG, "%-12.12s service %04X %-20.20s "
+ "addr %s.%04X %c metric %d\n",
+ action,
+ ntohs(sap->sap.ServType),
+ sap->sap.ServName,
+ ipxdp_ntoa(&sap->sap.ipx),
+ ntohs(sap->sap.ipx.x_port),
+ (sap->clone ? 'C' : ' '),
+ ntohs(sap->sap.hops));
+}
+
+void
dumpif(fd, ifp)
register struct interface *ifp;
FILE *fd;
OpenPOWER on IntegriCloud