Back to index

glibc  2.9
ax25.h
Go to the documentation of this file.
00001 /* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _NETAX25_AX25_H
00020 #define _NETAX25_AX25_H     1
00021 
00022 #include <features.h>
00023 #include <bits/sockaddr.h>
00024 
00025 /* Setsockoptions(2) level.  Thanks to BSD these must match IPPROTO_xxx.  */
00026 #define SOL_AX25     257
00027 
00028 /* AX.25 flags: */
00029 #define AX25_WINDOW  1
00030 #define AX25_T1             2
00031 #define AX25_T2             5
00032 #define AX25_T3             4
00033 #define AX25_N2             3
00034 #define AX25_BACKOFF 6
00035 #define AX25_EXTSEQ  7
00036 #define AX25_PIDINCL 8
00037 #define AX25_IDLE    9
00038 #define       AX25_PACLEN   10
00039 #define AX25_IPMAXQUEUE 11
00040 #define AX25_IAMDIGI 12
00041 #define AX25_KILL    99
00042 
00043 /* AX.25 socket ioctls: */
00044 #define SIOCAX25GETUID             (SIOCPROTOPRIVATE)
00045 #define SIOCAX25ADDUID             (SIOCPROTOPRIVATE+1)
00046 #define SIOCAX25DELUID             (SIOCPROTOPRIVATE+2)
00047 #define SIOCAX25NOUID              (SIOCPROTOPRIVATE+3)
00048 #define SIOCAX25BPQADDR            (SIOCPROTOPRIVATE+4)
00049 #define SIOCAX25GETPARMS    (SIOCPROTOPRIVATE+5)
00050 #define SIOCAX25SETPARMS    (SIOCPROTOPRIVATE+6)
00051 #define SIOCAX25OPTRT              (SIOCPROTOPRIVATE+7)
00052 #define SIOCAX25CTLCON             (SIOCPROTOPRIVATE+8)
00053 #define SIOCAX25GETINFO            (SIOCPROTOPRIVATE+9)
00054 #define SIOCAX25ADDFWD             (SIOCPROTOPRIVATE+10)
00055 #define SIOCAX25DELFWD             (SIOCPROTOPRIVATE+11)
00056 
00057 /* unknown: */
00058 #define AX25_NOUID_DEFAULT  0
00059 #define AX25_NOUID_BLOCK    1
00060 #define AX25_SET_RT_IPMODE  2
00061 
00062 /* Digipeating flags: */
00063 #define AX25_DIGI_INBAND    0x01   /* Allow digipeating within port */
00064 #define AX25_DIGI_XBAND            0x02   /* Allow digipeating across ports */
00065 
00066 /* Maximim number of digipeaters: */
00067 #define AX25_MAX_DIGIS 8
00068 
00069 
00070 typedef struct
00071   {
00072     char ax25_call[7];             /* 6 call + SSID (shifted ascii) */
00073   }
00074 ax25_address;
00075 
00076 struct sockaddr_ax25
00077   {
00078     sa_family_t sax25_family;
00079     ax25_address sax25_call;
00080     int sax25_ndigis;
00081   };
00082 
00083 /*
00084  * The sockaddr struct with the digipeater adresses:
00085  */
00086 struct full_sockaddr_ax25
00087   {
00088     struct sockaddr_ax25 fsa_ax25;
00089     ax25_address fsa_digipeater[AX25_MAX_DIGIS];
00090   };
00091 #define sax25_uid    sax25_ndigis
00092 
00093 struct ax25_routes_struct
00094   {
00095     ax25_address port_addr;
00096     ax25_address dest_addr;
00097     unsigned char digi_count;
00098     ax25_address digi_addr[AX25_MAX_DIGIS];
00099   };
00100 
00101 /* The AX.25 ioctl structure: */
00102 struct ax25_ctl_struct
00103   {
00104     ax25_address port_addr;
00105     ax25_address source_addr;
00106     ax25_address dest_addr;
00107     unsigned int cmd;
00108     unsigned long arg;
00109     unsigned char digi_count;
00110     ax25_address digi_addr[AX25_MAX_DIGIS];
00111   };
00112 
00113 struct ax25_info_struct
00114   {
00115     unsigned int  n2, n2count;
00116     unsigned int t1, t1timer;
00117     unsigned int t2, t2timer;
00118     unsigned int t3, t3timer;
00119     unsigned int idle, idletimer;
00120     unsigned int state;
00121     unsigned int rcv_q, snd_q;
00122   };
00123 
00124 struct ax25_fwd_struct
00125   {
00126     ax25_address port_from;
00127     ax25_address port_to;
00128   };
00129 
00130 /* AX.25 route structure: */
00131 struct ax25_route_opt_struct
00132   {
00133     ax25_address port_addr;
00134     ax25_address dest_addr;
00135     int cmd;
00136     int arg;
00137   };
00138 
00139 /* AX.25 BPQ stuff: */
00140 struct ax25_bpqaddr_struct
00141   {
00142     char dev[16];
00143     ax25_address addr;
00144   };
00145 
00146 /* Definitions for the AX.25 `values' fields: */
00147 #define       AX25_VALUES_IPDEFMODE       0      /* 'D'=DG 'V'=VC */
00148 #define       AX25_VALUES_AXDEFMODE       1      /* 8=Normal 128=Extended Seq Nos */
00149 #define       AX25_VALUES_NETROM   2      /* Allow NET/ROM  - 0=No 1=Yes */
00150 #define       AX25_VALUES_TEXT     3      /* Allow PID=Text - 0=No 1=Yes */
00151 #define       AX25_VALUES_BACKOFF  4      /* 'E'=Exponential 'L'=Linear */
00152 #define       AX25_VALUES_CONMODE  5      /* Allow connected modes - 0=No 1=Yes */
00153 #define       AX25_VALUES_WINDOW   6      /* Default window size for standard AX.25 */
00154 #define       AX25_VALUES_EWINDOW  7      /* Default window size for extended AX.25 */
00155 #define       AX25_VALUES_T1              8      /* Default T1 timeout value */
00156 #define       AX25_VALUES_T2              9      /* Default T2 timeout value */
00157 #define       AX25_VALUES_T3              10     /* Default T3 timeout value */
00158 #define       AX25_VALUES_N2              11     /* Default N2 value */
00159 #define       AX25_VALUES_DIGI     12     /* Digipeat mode */
00160 #define AX25_VALUES_IDLE    13     /* mode vc idle timer */
00161 #define AX25_VALUES_PACLEN  14     /* AX.25 MTU */
00162 #define AX25_VALUES_IPMAXQUEUE  15 /* Maximum number of buffers enqueued */
00163 #define       AX25_MAX_VALUES             20
00164 
00165 struct ax25_parms_struct
00166   {
00167     ax25_address port_addr;
00168     unsigned short values[AX25_MAX_VALUES];
00169   };
00170 
00171 #endif /* netax25/ax25.h */