OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [net/] [netrom.h] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 *      Declarations of NET/ROM type objects.
3
 *
4
 *      Jonathan Naylor G4KLX   9/4/95
5
 */
6
 
7
#ifndef _NETROM_H
8
#define _NETROM_H 
9
#include <linux/netrom.h>
10
 
11
#define NR_SLOWHZ                       10      /* Run timing at 1/10 second */
12
 
13
#define NR_NETWORK_LEN                  15
14
#define NR_TRANSPORT_LEN                5
15
 
16
#define NR_PROTO_IP                     0x0C
17
 
18
#define NR_PROTOEXT                     0x00
19
#define NR_CONNREQ                      0x01
20
#define NR_CONNACK                      0x02
21
#define NR_DISCREQ                      0x03
22
#define NR_DISCACK                      0x04
23
#define NR_INFO                         0x05
24
#define NR_INFOACK                      0x06
25
 
26
#define NR_CHOKE_FLAG                   0x80
27
#define NR_NAK_FLAG                     0x40
28
#define NR_MORE_FLAG                    0x20
29
 
30
/* Define Link State constants. */
31
 
32
#define NR_STATE_0                      0
33
#define NR_STATE_1                      1
34
#define NR_STATE_2                      2
35
#define NR_STATE_3                      3
36
 
37
#define NR_COND_ACK_PENDING             0x01
38
#define NR_COND_REJECT                  0x02
39
#define NR_COND_PEER_RX_BUSY            0x04
40
#define NR_COND_OWN_RX_BUSY             0x08
41
 
42
#define NR_DEFAULT_T1                   (120 * NR_SLOWHZ)       /* Outstanding frames - 120 seconds */
43
#define NR_DEFAULT_T2                   (5   * NR_SLOWHZ)       /* Response delay     - 5 seconds */
44
#define NR_DEFAULT_N2                   3                       /* Number of Retries - 3 */
45
#define NR_DEFAULT_T4                   (180 * NR_SLOWHZ)       /* Busy Delay - 180 seconds */
46
#define NR_DEFAULT_WINDOW               4                       /* Default Window Size - 4 */
47
#define NR_DEFAULT_OBS                  6                       /* Default Obsolescence Count - 6 */
48
#define NR_DEFAULT_QUAL                 10                      /* Default Neighbour Quality - 10 */
49
#define NR_DEFAULT_TTL                  16                      /* Default Time To Live - 16 */
50
#define NR_DEFAULT_ROUTING              1                       /* Is routing enabled ? */
51
#define NR_DEFAULT_FAILS                2                       /* Link fails until route fails */
52
 
53
#define NR_MODULUS                      256
54
#define NR_MAX_WINDOW_SIZE              127                     /* Maximum Window Allowable - 127 */
55
#define NR_MAX_PACKET_SIZE              236                     /* Maximum Packet Length - 236 */
56
 
57
typedef struct {
58
        ax25_address            user_addr, source_addr, dest_addr;
59
        struct device           *device;
60
        unsigned char           my_index,   my_id;
61
        unsigned char           your_index, your_id;
62
        unsigned char           state, condition, bpqext, window;
63
        unsigned short          vs, vr, va, vl;
64
        unsigned char           n2, n2count;
65
        unsigned short          t1, t2, t4;
66
        unsigned short          t1timer, t2timer, t4timer;
67
        unsigned short          fraglen;
68
        struct sk_buff_head     ack_queue;
69
        struct sk_buff_head     reseq_queue;
70
        struct sk_buff_head     frag_queue;
71
        struct sock             *sk;            /* Backlink to socket */
72
} nr_cb;
73
 
74
struct nr_neigh {
75
        struct nr_neigh *next;
76
        ax25_address    callsign;
77
        ax25_digi       *digipeat;
78
        ax25_cb         *ax25;
79
        struct device   *dev;
80
        unsigned char   quality;
81
        unsigned char   locked;
82
        unsigned short  count;
83
        unsigned int    number;
84
        unsigned char   failed;
85
};
86
 
87
struct nr_route {
88
        unsigned char   quality;
89
        unsigned char   obs_count;
90
        struct nr_neigh *neighbour;
91
};
92
 
93
struct nr_node {
94
        struct nr_node  *next;
95
        ax25_address    callsign;
96
        char            mnemonic[7];
97
        unsigned char   which;
98
        unsigned char   count;
99
        struct nr_route routes[3];
100
};
101
 
102
/* af_netrom.c */
103
extern int  sysctl_netrom_default_path_quality;
104
extern int  sysctl_netrom_obsolescence_count_initialiser;
105
extern int  sysctl_netrom_network_ttl_initialiser;
106
extern int  sysctl_netrom_transport_timeout;
107
extern int  sysctl_netrom_transport_maximum_tries;
108
extern int  sysctl_netrom_transport_acknowledge_delay;
109
extern int  sysctl_netrom_transport_busy_delay;
110
extern int  sysctl_netrom_transport_requested_window_size;
111
extern int  sysctl_netrom_routing_control;
112
extern int  sysctl_netrom_link_fails_count;
113
extern int  nr_rx_frame(struct sk_buff *, struct device *);
114
extern void nr_destroy_socket(struct sock *);
115
 
116
/* nr_dev.c */
117
extern int  nr_rx_ip(struct sk_buff *, struct device *);
118
extern int  nr_init(struct device *);
119
 
120
#include <net/nrcall.h>
121
 
122
/* nr_in.c */
123
extern int  nr_process_rx_frame(struct sock *, struct sk_buff *);
124
 
125
/* nr_out.c */
126
extern void nr_output(struct sock *, struct sk_buff *);
127
extern void nr_send_nak_frame(struct sock *);
128
extern void nr_kick(struct sock *);
129
extern void nr_transmit_buffer(struct sock *, struct sk_buff *);
130
extern void nr_establish_data_link(struct sock *);
131
extern void nr_enquiry_response(struct sock *);
132
extern void nr_check_iframes_acked(struct sock *, unsigned short);
133
 
134
/* nr_route.c */
135
extern void nr_rt_device_down(struct device *);
136
extern struct device *nr_dev_first(void);
137
extern struct device *nr_dev_get(ax25_address *);
138
extern int  nr_rt_ioctl(unsigned int, void *);
139
extern void nr_link_failed(ax25_cb *, int);
140
extern int  nr_route_frame(struct sk_buff *, ax25_cb *);
141
extern int  nr_nodes_get_info(char *, char **, off_t, int, int);
142
extern int  nr_neigh_get_info(char *, char **, off_t, int, int);
143
extern void nr_rt_free(void);
144
 
145
/* nr_subr.c */
146
extern void nr_clear_queues(struct sock *);
147
extern void nr_frames_acked(struct sock *, unsigned short);
148
extern void nr_requeue_frames(struct sock *);
149
extern int  nr_validate_nr(struct sock *, unsigned short);
150
extern int  nr_in_rx_window(struct sock *, unsigned short);
151
extern void nr_write_internal(struct sock *, int);
152
extern void nr_transmit_dm(struct sk_buff *, int);
153
 
154
/* nr_timer.c */
155
extern void nr_set_timer(struct sock *);
156
 
157
/* sysctl_net_netrom.c */
158
extern void nr_register_sysctl(void);
159
extern void nr_unregister_sysctl(void);
160
 
161
/* nr_loopback.c */
162
extern void nr_loopback_init(void);
163
extern void nr_loopback_clear(void);
164
extern int nr_loopback_queue(struct sk_buff *);
165
 
166
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.