1607ca46eSDavid Howells /* 2607ca46eSDavid Howells * These are the public elements of the Linux kernel Rose implementation. 3607ca46eSDavid Howells * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the 4607ca46eSDavid Howells * definition of the ax25_address structure. 5607ca46eSDavid Howells */ 6607ca46eSDavid Howells 7607ca46eSDavid Howells #ifndef ROSE_KERNEL_H 8607ca46eSDavid Howells #define ROSE_KERNEL_H 9607ca46eSDavid Howells 10607ca46eSDavid Howells #include <linux/socket.h> 11607ca46eSDavid Howells #include <linux/ax25.h> 12607ca46eSDavid Howells 13607ca46eSDavid Howells #define ROSE_MTU 251 14607ca46eSDavid Howells 15607ca46eSDavid Howells #define ROSE_MAX_DIGIS 6 16607ca46eSDavid Howells 17607ca46eSDavid Howells #define ROSE_DEFER 1 18607ca46eSDavid Howells #define ROSE_T1 2 19607ca46eSDavid Howells #define ROSE_T2 3 20607ca46eSDavid Howells #define ROSE_T3 4 21607ca46eSDavid Howells #define ROSE_IDLE 5 22607ca46eSDavid Howells #define ROSE_QBITINCL 6 23607ca46eSDavid Howells #define ROSE_HOLDBACK 7 24607ca46eSDavid Howells 25607ca46eSDavid Howells #define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0) 26607ca46eSDavid Howells #define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1) 27607ca46eSDavid Howells #define SIOCRSL2CALL (SIOCPROTOPRIVATE+2) 28607ca46eSDavid Howells #define SIOCRSSL2CALL (SIOCPROTOPRIVATE+2) 29607ca46eSDavid Howells #define SIOCRSACCEPT (SIOCPROTOPRIVATE+3) 30607ca46eSDavid Howells #define SIOCRSCLRRT (SIOCPROTOPRIVATE+4) 31607ca46eSDavid Howells #define SIOCRSGL2CALL (SIOCPROTOPRIVATE+5) 32607ca46eSDavid Howells #define SIOCRSGFACILITIES (SIOCPROTOPRIVATE+6) 33607ca46eSDavid Howells 34607ca46eSDavid Howells #define ROSE_DTE_ORIGINATED 0x00 35607ca46eSDavid Howells #define ROSE_NUMBER_BUSY 0x01 36607ca46eSDavid Howells #define ROSE_INVALID_FACILITY 0x03 37607ca46eSDavid Howells #define ROSE_NETWORK_CONGESTION 0x05 38607ca46eSDavid Howells #define ROSE_OUT_OF_ORDER 0x09 39607ca46eSDavid Howells #define ROSE_ACCESS_BARRED 0x0B 40607ca46eSDavid Howells #define ROSE_NOT_OBTAINABLE 0x0D 41607ca46eSDavid Howells #define ROSE_REMOTE_PROCEDURE 0x11 42607ca46eSDavid Howells #define ROSE_LOCAL_PROCEDURE 0x13 43607ca46eSDavid Howells #define ROSE_SHIP_ABSENT 0x39 44607ca46eSDavid Howells 45607ca46eSDavid Howells typedef struct { 46607ca46eSDavid Howells char rose_addr[5]; 47607ca46eSDavid Howells } rose_address; 48607ca46eSDavid Howells 49607ca46eSDavid Howells struct sockaddr_rose { 50607ca46eSDavid Howells __kernel_sa_family_t srose_family; 51607ca46eSDavid Howells rose_address srose_addr; 52607ca46eSDavid Howells ax25_address srose_call; 53607ca46eSDavid Howells int srose_ndigis; 54607ca46eSDavid Howells ax25_address srose_digi; 55607ca46eSDavid Howells }; 56607ca46eSDavid Howells 57607ca46eSDavid Howells struct full_sockaddr_rose { 58607ca46eSDavid Howells __kernel_sa_family_t srose_family; 59607ca46eSDavid Howells rose_address srose_addr; 60607ca46eSDavid Howells ax25_address srose_call; 61607ca46eSDavid Howells unsigned int srose_ndigis; 62607ca46eSDavid Howells ax25_address srose_digis[ROSE_MAX_DIGIS]; 63607ca46eSDavid Howells }; 64607ca46eSDavid Howells 65607ca46eSDavid Howells struct rose_route_struct { 66607ca46eSDavid Howells rose_address address; 67607ca46eSDavid Howells unsigned short mask; 68607ca46eSDavid Howells ax25_address neighbour; 69607ca46eSDavid Howells char device[16]; 70607ca46eSDavid Howells unsigned char ndigis; 71607ca46eSDavid Howells ax25_address digipeaters[AX25_MAX_DIGIS]; 72607ca46eSDavid Howells }; 73607ca46eSDavid Howells 74607ca46eSDavid Howells struct rose_cause_struct { 75607ca46eSDavid Howells unsigned char cause; 76607ca46eSDavid Howells unsigned char diagnostic; 77607ca46eSDavid Howells }; 78607ca46eSDavid Howells 79607ca46eSDavid Howells struct rose_facilities_struct { 80607ca46eSDavid Howells rose_address source_addr, dest_addr; 81607ca46eSDavid Howells ax25_address source_call, dest_call; 82607ca46eSDavid Howells unsigned char source_ndigis, dest_ndigis; 83607ca46eSDavid Howells ax25_address source_digis[ROSE_MAX_DIGIS]; 84607ca46eSDavid Howells ax25_address dest_digis[ROSE_MAX_DIGIS]; 85607ca46eSDavid Howells unsigned int rand; 86607ca46eSDavid Howells rose_address fail_addr; 87607ca46eSDavid Howells ax25_address fail_call; 88607ca46eSDavid Howells }; 89607ca46eSDavid Howells 90607ca46eSDavid Howells #endif 91