2 * $Id: rtmp.h,v 1.5 2009-10-13 22:55:37 didg Exp $
3 * Copyright (c) 1990,1993 Regents of The University of Michigan.
4 * All Rights Reserved. See COPYRIGHT.
6 * We have an rtmptab circular linked list for each gateway. Entries
7 * are inserted in the order we get them. The expectation is that
8 * we will get a complexity of N for the stable case. If we have N
9 * existing entries, and M new entries, we'll have on the order of
10 * N + ( M * N ) complexity (really it will be something more than
11 * that, maybe N + ( M * ( N + 1/2 M )). Note that having a list to
12 * search is superior to a hash table if you are expecting bad data:
13 * you have the opportunity to range-check the incoming data.
15 * We keep several ZIP related flags and counters here. For ZIP Extended
16 * Replies, we must keep a flag indicating that the zone is up or down.
17 * This flag is necessary for ZIP Extended Replies which cross packet
18 * boundaries: even tho the rtmptab entry has data, it is not yet
19 * complete. For ZIP in general, we keep a flag indicating that we've
20 * asked for a ZIP (E)Reply. If this flag is not set, we won't process
21 * ZIP Reply data for given rtmptab entries. Lastly, we keep a count of
22 * the number of times we've asked for ZIP Reply data. When this value
23 * reaches some value (3?), we can optionally stop asking.
27 #define ATALKD_RTMP_H 1
29 #include <sys/cdefs.h>
32 struct rtmptab *rt_next,
34 struct rtmptab *rt_inext,
36 u_short rt_firstnet, rt_lastnet;
40 u_char rt_nzq; /* number of zip queries issued */
41 struct gate *rt_gate; /* gate is NULL for interfaces */
43 const struct interface *rt_iface;
56 #define SZ_RTMPTUPLE 3
58 #define RTMPTAB_PERM 0
59 #define RTMPTAB_GOOD 1
60 #define RTMPTAB_SUSP1 2
61 #define RTMPTAB_SUSP2 3
64 #define RTMPTAB_ZIPQUERY 0x01
65 #define RTMPTAB_HASZONES 0x02
66 #define RTMPTAB_EXTENDED 0x04
67 #define RTMPTAB_ROUTE 0x08
70 #define RTMP_ADD SIOCADDRT
71 #define RTMP_DEL SIOCDELRT
73 #define RTMP_ADD RTM_ADD
74 #define RTMP_DEL RTM_DELETE
77 #define STARTUP_FIRSTNET 0xff00
78 #define STARTUP_LASTNET 0xfffe
81 struct rtmptab *newrt (const struct interface *);
82 void rtmp_delzonemap (struct rtmptab *);
84 int rtmp_request ( struct interface * );
85 void rtmp_free ( struct rtmptab * );
86 int rtmp_replace ( struct rtmptab * );
87 int looproute ( struct interface *, unsigned int );
88 int gateroute ( unsigned int, struct rtmptab * );
92 int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len);
94 #endif /* atalkd/rtmp.h */