1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells /* 3607ca46eSDavid Howells * These are the public elements of the Linux kernel AX.25 code. A similar 4607ca46eSDavid Howells * file netrom.h exists for the NET/ROM protocol. 5607ca46eSDavid Howells */ 6607ca46eSDavid Howells 7607ca46eSDavid Howells #ifndef AX25_KERNEL_H 8607ca46eSDavid Howells #define AX25_KERNEL_H 9607ca46eSDavid Howells 10607ca46eSDavid Howells #include <linux/socket.h> 11607ca46eSDavid Howells 12607ca46eSDavid Howells #define AX25_MTU 256 13607ca46eSDavid Howells #define AX25_MAX_DIGIS 8 14607ca46eSDavid Howells 15607ca46eSDavid Howells #define AX25_WINDOW 1 16607ca46eSDavid Howells #define AX25_T1 2 17607ca46eSDavid Howells #define AX25_N2 3 18607ca46eSDavid Howells #define AX25_T3 4 19607ca46eSDavid Howells #define AX25_T2 5 20607ca46eSDavid Howells #define AX25_BACKOFF 6 21607ca46eSDavid Howells #define AX25_EXTSEQ 7 22607ca46eSDavid Howells #define AX25_PIDINCL 8 23607ca46eSDavid Howells #define AX25_IDLE 9 24607ca46eSDavid Howells #define AX25_PACLEN 10 25607ca46eSDavid Howells #define AX25_IAMDIGI 12 26607ca46eSDavid Howells 27607ca46eSDavid Howells #define AX25_KILL 99 28607ca46eSDavid Howells 29607ca46eSDavid Howells #define SIOCAX25GETUID (SIOCPROTOPRIVATE+0) 30607ca46eSDavid Howells #define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1) 31607ca46eSDavid Howells #define SIOCAX25DELUID (SIOCPROTOPRIVATE+2) 32607ca46eSDavid Howells #define SIOCAX25NOUID (SIOCPROTOPRIVATE+3) 33607ca46eSDavid Howells #define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7) 34607ca46eSDavid Howells #define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8) 35607ca46eSDavid Howells #define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9) 36607ca46eSDavid Howells #define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10) 37607ca46eSDavid Howells #define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11) 38607ca46eSDavid Howells #define SIOCAX25DEVCTL (SIOCPROTOPRIVATE+12) 39607ca46eSDavid Howells #define SIOCAX25GETINFO (SIOCPROTOPRIVATE+13) 40607ca46eSDavid Howells 41607ca46eSDavid Howells #define AX25_SET_RT_IPMODE 2 42607ca46eSDavid Howells 43607ca46eSDavid Howells #define AX25_NOUID_DEFAULT 0 44607ca46eSDavid Howells #define AX25_NOUID_BLOCK 1 45607ca46eSDavid Howells 46607ca46eSDavid Howells typedef struct { 47607ca46eSDavid Howells char ax25_call[7]; /* 6 call + SSID (shifted ascii!) */ 48607ca46eSDavid Howells } ax25_address; 49607ca46eSDavid Howells 50607ca46eSDavid Howells struct sockaddr_ax25 { 51607ca46eSDavid Howells __kernel_sa_family_t sax25_family; 52607ca46eSDavid Howells ax25_address sax25_call; 53607ca46eSDavid Howells int sax25_ndigis; 54607ca46eSDavid Howells /* Digipeater ax25_address sets follow */ 55607ca46eSDavid Howells }; 56607ca46eSDavid Howells 57607ca46eSDavid Howells #define sax25_uid sax25_ndigis 58607ca46eSDavid Howells 59607ca46eSDavid Howells struct full_sockaddr_ax25 { 60607ca46eSDavid Howells struct sockaddr_ax25 fsa_ax25; 61607ca46eSDavid Howells ax25_address fsa_digipeater[AX25_MAX_DIGIS]; 62607ca46eSDavid Howells }; 63607ca46eSDavid Howells 64607ca46eSDavid Howells struct ax25_routes_struct { 65607ca46eSDavid Howells ax25_address port_addr; 66607ca46eSDavid Howells ax25_address dest_addr; 67607ca46eSDavid Howells unsigned char digi_count; 68607ca46eSDavid Howells ax25_address digi_addr[AX25_MAX_DIGIS]; 69607ca46eSDavid Howells }; 70607ca46eSDavid Howells 71607ca46eSDavid Howells struct ax25_route_opt_struct { 72607ca46eSDavid Howells ax25_address port_addr; 73607ca46eSDavid Howells ax25_address dest_addr; 74607ca46eSDavid Howells int cmd; 75607ca46eSDavid Howells int arg; 76607ca46eSDavid Howells }; 77607ca46eSDavid Howells 78607ca46eSDavid Howells struct ax25_ctl_struct { 79607ca46eSDavid Howells ax25_address port_addr; 80607ca46eSDavid Howells ax25_address source_addr; 81607ca46eSDavid Howells ax25_address dest_addr; 82607ca46eSDavid Howells unsigned int cmd; 83607ca46eSDavid Howells unsigned long arg; 84607ca46eSDavid Howells unsigned char digi_count; 85607ca46eSDavid Howells ax25_address digi_addr[AX25_MAX_DIGIS]; 86607ca46eSDavid Howells }; 87607ca46eSDavid Howells 88607ca46eSDavid Howells /* this will go away. Please do not export to user land */ 89607ca46eSDavid Howells struct ax25_info_struct_deprecated { 90607ca46eSDavid Howells unsigned int n2, n2count; 91607ca46eSDavid Howells unsigned int t1, t1timer; 92607ca46eSDavid Howells unsigned int t2, t2timer; 93607ca46eSDavid Howells unsigned int t3, t3timer; 94607ca46eSDavid Howells unsigned int idle, idletimer; 95607ca46eSDavid Howells unsigned int state; 96607ca46eSDavid Howells unsigned int rcv_q, snd_q; 97607ca46eSDavid Howells }; 98607ca46eSDavid Howells 99607ca46eSDavid Howells struct ax25_info_struct { 100607ca46eSDavid Howells unsigned int n2, n2count; 101607ca46eSDavid Howells unsigned int t1, t1timer; 102607ca46eSDavid Howells unsigned int t2, t2timer; 103607ca46eSDavid Howells unsigned int t3, t3timer; 104607ca46eSDavid Howells unsigned int idle, idletimer; 105607ca46eSDavid Howells unsigned int state; 106607ca46eSDavid Howells unsigned int rcv_q, snd_q; 107607ca46eSDavid Howells unsigned int vs, vr, va, vs_max; 108607ca46eSDavid Howells unsigned int paclen; 109607ca46eSDavid Howells unsigned int window; 110607ca46eSDavid Howells }; 111607ca46eSDavid Howells 112607ca46eSDavid Howells struct ax25_fwd_struct { 113607ca46eSDavid Howells ax25_address port_from; 114607ca46eSDavid Howells ax25_address port_to; 115607ca46eSDavid Howells }; 116607ca46eSDavid Howells 117607ca46eSDavid Howells #endif 118