netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
etc/atalkd/rtmp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1990,1993 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
4 *
5 * We have an rtmptab circular linked list for each gateway. Entries
6 * are inserted in the order we get them. The expectation is that
7 * we will get a complexity of N for the stable case. If we have N
8 * existing entries, and M new entries, we'll have on the order of
9 * N + ( M * N ) complexity (really it will be something more than
10 * that, maybe N + ( M * ( N + 1/2 M )). Note that having a list to
11 * search is superior to a hash table if you are expecting bad data:
12 * you have the opportunity to range-check the incoming data.
13 *
14 * We keep several ZIP related flags and counters here. For ZIP Extended
15 * Replies, we must keep a flag indicating that the zone is up or down.
16 * This flag is necessary for ZIP Extended Replies which cross packet
17 * boundaries: even tho the rtmptab entry has data, it is not yet
18 * complete. For ZIP in general, we keep a flag indicating that we've
19 * asked for a ZIP (E)Reply. If this flag is not set, we won't process
20 * ZIP Reply data for given rtmptab entries. Lastly, we keep a count of
21 * the number of times we've asked for ZIP Reply data. When this value
22 * reaches some value (3?), we can optionally stop asking.
23 */
24
25#ifndef ATALKD_RTMP_H
26#define ATALKD_RTMP_H 1
27
28#include <sys/types.h>
29
30struct rtmptab {
33 unsigned short rt_firstnet, rt_lastnet;
34 unsigned char rt_hops;
35 unsigned char rt_state;
36 unsigned char rt_flags;
37 unsigned char rt_nzq; /* number of zip queries issued */
38 struct gate *rt_gate; /* gate is NULL for interfaces */
39 struct list *rt_zt;
40 const struct interface *rt_iface;
41};
42
43struct rtmp_head {
44 unsigned short rh_net;
45 unsigned char rh_nodelen;
46 unsigned char rh_node;
47};
48
49struct rtmp_tuple {
50 unsigned short rt_net;
51 unsigned char rt_dist;
52};
53#define SZ_RTMPTUPLE 3
54
55#define RTMPTAB_PERM 0
56#define RTMPTAB_GOOD 1
57#define RTMPTAB_SUSP1 2
58#define RTMPTAB_SUSP2 3
59#define RTMPTAB_BAD 4
60
61#define RTMPTAB_ZIPQUERY 0x01
62#define RTMPTAB_HASZONES 0x02
63#define RTMPTAB_EXTENDED 0x04
64#define RTMPTAB_ROUTE 0x08
65
66#ifndef BSD4_4
67#define RTMP_ADD SIOCADDRT
68#define RTMP_DEL SIOCDELRT
69#else /* BSD4_4 */
70#define RTMP_ADD RTM_ADD
71#define RTMP_DEL RTM_DELETE
72#endif /* BSD4_4 */
73
74#define STARTUP_FIRSTNET 0xff00
75#define STARTUP_LASTNET 0xfffe
76
77/* On NetBSD, Net 0 is reserved for lo0, it can't be used on other interfaces. */
78#ifndef __NetBSD__
79#define OS_STARTUP_FIRSTNET 0
80#else
81#define OS_STARTUP_FIRSTNET 1
82#endif
83
84extern int rtfd;
85struct rtmptab *newrt(const struct interface *);
86void rtmp_delzonemap(struct rtmptab *);
87
88int rtmp_request(struct interface *);
89void rtmp_free(struct rtmptab *);
90int rtmp_replace(struct rtmptab **);
91int looproute(struct interface *, unsigned int);
92int gateroute(unsigned int, struct rtmptab *);
93
94struct atport;
95
96int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data,
97 int len);
98
99#endif /* atalkd/rtmp.h */
int rtfd
Definition etc/atalkd/main.c:69
int gateroute(unsigned int, struct rtmptab *)
Definition rtmp.c:1060
int rtmp_request(struct interface *)
Definition rtmp.c:958
int looproute(struct interface *, unsigned int)
Definition rtmp.c:1001
void rtmp_delzonemap(struct rtmptab *)
Definition rtmp.c:41
struct rtmptab * newrt(const struct interface *)
Definition rtmp.c:1149
int rtmp_replace(struct rtmptab **)
Definition rtmp.c:365
int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
Definition rtmp.c:505
void rtmp_free(struct rtmptab *)
Definition rtmp.c:325
#define data
Definition hash.c:37
Definition atserv.h:8
Definition gate.h:6
Definition interface.h:11
Definition etc/atalkd/list.h:6
Definition etc/atalkd/rtmp.h:43
unsigned char rh_nodelen
Definition etc/atalkd/rtmp.h:45
unsigned short rh_net
Definition etc/atalkd/rtmp.h:44
unsigned char rh_node
Definition etc/atalkd/rtmp.h:46
Definition etc/atalkd/rtmp.h:49
unsigned char rt_dist
Definition etc/atalkd/rtmp.h:51
unsigned short rt_net
Definition etc/atalkd/rtmp.h:50
Definition etc/atalkd/rtmp.h:30
struct rtmptab * rt_next
Definition etc/atalkd/rtmp.h:31
unsigned char rt_flags
Definition etc/atalkd/rtmp.h:36
const struct interface * rt_iface
Definition etc/atalkd/rtmp.h:40
struct rtmptab * rt_iprev
Definition etc/atalkd/rtmp.h:32
struct rtmptab * rt_prev
Definition etc/atalkd/rtmp.h:31
unsigned char rt_hops
Definition etc/atalkd/rtmp.h:34
struct list * rt_zt
Definition etc/atalkd/rtmp.h:39
unsigned char rt_state
Definition etc/atalkd/rtmp.h:35
struct rtmptab * rt_inext
Definition etc/atalkd/rtmp.h:32
struct gate * rt_gate
Definition etc/atalkd/rtmp.h:38
unsigned short rt_firstnet
Definition etc/atalkd/rtmp.h:33
unsigned char rt_nzq
Definition etc/atalkd/rtmp.h:37
unsigned short rt_lastnet
Definition etc/atalkd/rtmp.h:33
Definition at.h:88