Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


ax25.h
001: /* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
002:    This file is part of the GNU C Library.
003: 
004:    The GNU C Library is free software; you can redistribute it and/or
005:    modify it under the terms of the GNU Lesser General Public
006:    License as published by the Free Software Foundation; either
007:    version 2.1 of the License, or (at your option) any later version.
008: 
009:    The GNU C Library is distributed in the hope that it will be useful,
010:    but WITHOUT ANY WARRANTY; without even the implied warranty of
011:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:    Lesser General Public License for more details.
013: 
014:    You should have received a copy of the GNU Lesser General Public
015:    License along with the GNU C Library; if not, write to the Free
016:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
017:    02111-1307 USA.  */
018: 
019: #ifndef _NETAX25_AX25_H
020: #define _NETAX25_AX25_H 1
021: 
022: #include <features.h>
023: #include <bits/sockaddr.h>
024: 
025: /* Setsockoptions(2) level.  Thanks to BSD these must match IPPROTO_xxx.  */
026: #define SOL_AX25        257
027: 
028: /* AX.25 flags: */
029: #define AX25_WINDOW     1
030: #define AX25_T1         2
031: #define AX25_T2         5
032: #define AX25_T3         4
033: #define AX25_N2         3
034: #define AX25_BACKOFF    6
035: #define AX25_EXTSEQ     7
036: #define AX25_PIDINCL    8
037: #define AX25_IDLE       9
038: #define AX25_PACLEN     10
039: #define AX25_IPMAXQUEUE 11
040: #define AX25_IAMDIGI    12
041: #define AX25_KILL       99
042: 
043: /* AX.25 socket ioctls: */
044: #define SIOCAX25GETUID          (SIOCPROTOPRIVATE)
045: #define SIOCAX25ADDUID          (SIOCPROTOPRIVATE+1)
046: #define SIOCAX25DELUID          (SIOCPROTOPRIVATE+2)
047: #define SIOCAX25NOUID           (SIOCPROTOPRIVATE+3)
048: #define SIOCAX25BPQADDR         (SIOCPROTOPRIVATE+4)
049: #define SIOCAX25GETPARMS        (SIOCPROTOPRIVATE+5)
050: #define SIOCAX25SETPARMS        (SIOCPROTOPRIVATE+6)
051: #define SIOCAX25OPTRT           (SIOCPROTOPRIVATE+7)
052: #define SIOCAX25CTLCON          (SIOCPROTOPRIVATE+8)
053: #define SIOCAX25GETINFO         (SIOCPROTOPRIVATE+9)
054: #define SIOCAX25ADDFWD          (SIOCPROTOPRIVATE+10)
055: #define SIOCAX25DELFWD          (SIOCPROTOPRIVATE+11)
056: 
057: /* unknown: */
058: #define AX25_NOUID_DEFAULT      0
059: #define AX25_NOUID_BLOCK        1
060: #define AX25_SET_RT_IPMODE      2
061: 
062: /* Digipeating flags: */
063: #define AX25_DIGI_INBAND        0x01    /* Allow digipeating within port */
064: #define AX25_DIGI_XBAND         0x02    /* Allow digipeating across ports */
065: 
066: /* Maximim number of digipeaters: */
067: #define AX25_MAX_DIGIS 8
068: 
069: 
070: typedef struct
071:   {
072:     char ax25_call[7];          /* 6 call + SSID (shifted ascii) */
073:   }
074: ax25_address;
075: 
076: struct sockaddr_ax25
077:   {
078:     sa_family_t sax25_family;
079:     ax25_address sax25_call;
080:     int sax25_ndigis;
081:   };
082: 
083: /*
084:  * The sockaddr struct with the digipeater adresses:
085:  */
086: struct full_sockaddr_ax25
087:   {
088:     struct sockaddr_ax25 fsa_ax25;
089:     ax25_address fsa_digipeater[AX25_MAX_DIGIS];
090:   };
091: #define sax25_uid       sax25_ndigis
092: 
093: struct ax25_routes_struct
094:   {
095:     ax25_address port_addr;
096:     ax25_address dest_addr;
097:     unsigned char digi_count;
098:     ax25_address digi_addr[AX25_MAX_DIGIS];
099:   };
100: 
101: /* The AX.25 ioctl structure: */
102: struct ax25_ctl_struct
103:   {
104:     ax25_address port_addr;
105:     ax25_address source_addr;
106:     ax25_address dest_addr;
107:     unsigned int cmd;
108:     unsigned long arg;
109:     unsigned char digi_count;
110:     ax25_address digi_addr[AX25_MAX_DIGIS];
111:   };
112: 
113: struct ax25_info_struct
114:   {
115:     unsigned int  n2, n2count;
116:     unsigned int t1, t1timer;
117:     unsigned int t2, t2timer;
118:     unsigned int t3, t3timer;
119:     unsigned int idle, idletimer;
120:     unsigned int state;
121:     unsigned int rcv_q, snd_q;
122:   };
123: 
124: struct ax25_fwd_struct
125:   {
126:     ax25_address port_from;
127:     ax25_address port_to;
128:   };
129: 
130: /* AX.25 route structure: */
131: struct ax25_route_opt_struct
132:   {
133:     ax25_address port_addr;
134:     ax25_address dest_addr;
135:     int cmd;
136:     int arg;
137:   };
138: 
139: /* AX.25 BPQ stuff: */
140: struct ax25_bpqaddr_struct
141:   {
142:     char dev[16];
143:     ax25_address addr;
144:   };
145: 
146: /* Definitions for the AX.25 `values' fields: */
147: #define AX25_VALUES_IPDEFMODE   0       /* 'D'=DG 'V'=VC */
148: #define AX25_VALUES_AXDEFMODE   1       /* 8=Normal 128=Extended Seq Nos */
149: #define AX25_VALUES_NETROM      2       /* Allow NET/ROM  - 0=No 1=Yes */
150: #define AX25_VALUES_TEXT        3       /* Allow PID=Text - 0=No 1=Yes */
151: #define AX25_VALUES_BACKOFF     4       /* 'E'=Exponential 'L'=Linear */
152: #define AX25_VALUES_CONMODE     5       /* Allow connected modes - 0=No 1=Yes */
153: #define AX25_VALUES_WINDOW      6       /* Default window size for standard AX.25 */
154: #define AX25_VALUES_EWINDOW     7       /* Default window size for extended AX.25 */
155: #define AX25_VALUES_T1          8       /* Default T1 timeout value */
156: #define AX25_VALUES_T2          9       /* Default T2 timeout value */
157: #define AX25_VALUES_T3          10      /* Default T3 timeout value */
158: #define AX25_VALUES_N2          11      /* Default N2 value */
159: #define AX25_VALUES_DIGI        12      /* Digipeat mode */
160: #define AX25_VALUES_IDLE        13      /* mode vc idle timer */
161: #define AX25_VALUES_PACLEN      14      /* AX.25 MTU */
162: #define AX25_VALUES_IPMAXQUEUE  15      /* Maximum number of buffers enqueued */
163: #define AX25_MAX_VALUES         20
164: 
165: struct ax25_parms_struct
166:   {
167:     ax25_address port_addr;
168:     unsigned short values[AX25_MAX_VALUES];
169:   };
170: 
171: #endif /* netax25/ax25.h */
172: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/