blob: e8289cdbcc20dfa3f3c9244eddaf673bb6e0a4f7 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * These are the public elements of the Linux kernel Rose implementation.
3 * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
4 * definition of the ax25_address structure.
5 */
6
7#ifndef ROSE_KERNEL_H
8#define ROSE_KERNEL_H
9
Ben Hutchingsc2e0cd82011-08-24 18:43:18 +000010#include <linux/ax25.h>
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#define ROSE_MTU 251
13
14#define ROSE_MAX_DIGIS 6
15
16#define ROSE_DEFER 1
17#define ROSE_T1 2
18#define ROSE_T2 3
19#define ROSE_T3 4
20#define ROSE_IDLE 5
21#define ROSE_QBITINCL 6
22#define ROSE_HOLDBACK 7
23
24#define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0)
25#define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1)
26#define SIOCRSL2CALL (SIOCPROTOPRIVATE+2)
27#define SIOCRSSL2CALL (SIOCPROTOPRIVATE+2)
28#define SIOCRSACCEPT (SIOCPROTOPRIVATE+3)
29#define SIOCRSCLRRT (SIOCPROTOPRIVATE+4)
30#define SIOCRSGL2CALL (SIOCPROTOPRIVATE+5)
31#define SIOCRSGFACILITIES (SIOCPROTOPRIVATE+6)
32
33#define ROSE_DTE_ORIGINATED 0x00
34#define ROSE_NUMBER_BUSY 0x01
35#define ROSE_INVALID_FACILITY 0x03
36#define ROSE_NETWORK_CONGESTION 0x05
37#define ROSE_OUT_OF_ORDER 0x09
38#define ROSE_ACCESS_BARRED 0x0B
39#define ROSE_NOT_OBTAINABLE 0x0D
40#define ROSE_REMOTE_PROCEDURE 0x11
41#define ROSE_LOCAL_PROCEDURE 0x13
42#define ROSE_SHIP_ABSENT 0x39
43
44typedef struct {
45 char rose_addr[5];
46} rose_address;
47
48struct sockaddr_rose {
49 sa_family_t srose_family;
50 rose_address srose_addr;
51 ax25_address srose_call;
52 int srose_ndigis;
53 ax25_address srose_digi;
54};
55
56struct full_sockaddr_rose {
57 sa_family_t srose_family;
58 rose_address srose_addr;
59 ax25_address srose_call;
60 unsigned int srose_ndigis;
61 ax25_address srose_digis[ROSE_MAX_DIGIS];
62};
63
64struct rose_route_struct {
65 rose_address address;
66 unsigned short mask;
67 ax25_address neighbour;
68 char device[16];
69 unsigned char ndigis;
70 ax25_address digipeaters[AX25_MAX_DIGIS];
71};
72
73struct rose_cause_struct {
74 unsigned char cause;
75 unsigned char diagnostic;
76};
77
78struct rose_facilities_struct {
79 rose_address source_addr, dest_addr;
80 ax25_address source_call, dest_call;
81 unsigned char source_ndigis, dest_ndigis;
82 ax25_address source_digis[ROSE_MAX_DIGIS];
83 ax25_address dest_digis[ROSE_MAX_DIGIS];
84 unsigned int rand;
85 rose_address fail_addr;
86 ax25_address fail_call;
87};
88
89#endif