From 29b66b8ec360eea80b14e2cd2c3a4edf1309dbdb Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 20 Jun 2009 23:03:32 +0000 Subject: Install libc substitute headers only if really needed. And only to the correct path. --- Makefile.am | 22 +++++-- configure.ac | 5 ++ netax25/ax25.h | 171 ++++++++++++++++++++++++++++++++++++++++++++++++ netax25/kernel_ax25.h | 171 ------------------------------------------------ netax25/kernel_netrom.h | 84 ------------------------ netax25/kernel_rose.h | 116 -------------------------------- netrom/netrom.h | 84 ++++++++++++++++++++++++ netrose/rose.h | 116 ++++++++++++++++++++++++++++++++ 8 files changed, 392 insertions(+), 377 deletions(-) create mode 100644 netax25/ax25.h delete mode 100644 netax25/kernel_ax25.h delete mode 100644 netax25/kernel_netrom.h delete mode 100644 netax25/kernel_rose.h create mode 100644 netrom/netrom.h create mode 100644 netrose/rose.h diff --git a/Makefile.am b/Makefile.am index 0ceed26..1705888 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,16 @@ libax25ioincludedir = $(includedir) INCLUDES = -DAX25_SYSCONFDIR=\""$(sysconfdir)/ax25/"\" \ -DAX25_LOCALSTATEDIR=\""$(localstatedir)/ax25/"\" +if !AX25_H +USE_LIBAX25_AX25_H = netax25/ax25.h +endif +if !NETROM_H +USE_LIBAX25_NETROM_H = netrom/netrom.h +endif +if !ROSE_H +USE_LIBAX25_ROSE_H = netrose/rose.h +endif + nobase_libax25include_HEADERS = \ netax25/axlib.h \ netax25/axconfig.h \ @@ -14,10 +24,10 @@ nobase_libax25include_HEADERS = \ netax25/daemon.h \ netax25/ttyutils.h \ netax25/procutils.h \ - netax25/kernel_ax25.h \ - netax25/kernel_rose.h \ - netax25/kernel_netrom.h \ - netax25/mheard.h + netax25/mheard.h \ + $(USE_LIBAX25_AX25_H) \ + $(USE_LIBAX25_NETROM_H) \ + $(USE_LIBAX25_ROSE_H) nobase_libax25ioinclude_HEADERS = \ netax25/ax25io.h @@ -40,8 +50,8 @@ libax25_la_SOURCES = \ netax25/rsconfig.h \ ttyutils.c \ netax25/ttyutils.h \ - netax25/kernel_ax25.h \ - netax25/kernel_rose.h + $(USE_LIBAX25_AX25_H) \ + $(USE_LIBAX25_ROSE_H) libax25io_la_SOURCES = \ ax25io.c \ diff --git a/configure.ac b/configure.ac index 7e56c65..2701f87 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,8 @@ if test "$has_ax25" = "yes" ; then else AC_MSG_RESULT(no) fi +AM_CONDITIONAL([AX25_H], [test "$has_ax25" = "yes"]) + AC_MSG_CHECKING(for working netrom/netrom.h header file) AC_HEADER_EGREP(unsigned int ndigis, netrom/netrom.h, has_netrom=yes, has_netrom=no) if test "$has_netrom" = "yes" ; then @@ -37,6 +39,8 @@ if test "$has_netrom" = "yes" ; then else AC_MSG_RESULT(no) fi +AM_CONDITIONAL([NETROM_H], [test "$has_netrom" = "yes"]) + AC_MSG_CHECKING(for working netrose/rose.h header file) AC_HEADER_EGREP(rose_facilities_struct, netrose/rose.h, has_rose=yes, has_rose=no) if test "$has_rose" = "yes" ; then @@ -45,6 +49,7 @@ if test "$has_rose" = "yes" ; then else AC_MSG_RESULT(no) fi +AM_CONDITIONAL([ROSE_H], [test "$has_rose" = "yes"]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/netax25/ax25.h b/netax25/ax25.h new file mode 100644 index 0000000..e1b6abb --- /dev/null +++ b/netax25/ax25.h @@ -0,0 +1,171 @@ +/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _NETAX25_AX25_H +#define _NETAX25_AX25_H 1 + +#include +#include + +/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */ +#define SOL_AX25 257 + +/* AX.25 flags: */ +#define AX25_WINDOW 1 +#define AX25_T1 2 +#define AX25_T2 5 +#define AX25_T3 4 +#define AX25_N2 3 +#define AX25_BACKOFF 6 +#define AX25_EXTSEQ 7 +#define AX25_PIDINCL 8 +#define AX25_IDLE 9 +#define AX25_PACLEN 10 +#define AX25_IPMAXQUEUE 11 +#define AX25_IAMDIGI 12 +#define AX25_KILL 99 + +/* AX.25 socket ioctls: */ +#define SIOCAX25GETUID (SIOCPROTOPRIVATE) +#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1) +#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2) +#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3) +#define SIOCAX25BPQADDR (SIOCPROTOPRIVATE+4) +#define SIOCAX25GETPARMS (SIOCPROTOPRIVATE+5) +#define SIOCAX25SETPARMS (SIOCPROTOPRIVATE+6) +#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7) +#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8) +#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+9) +#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10) +#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11) + +/* unknown: */ +#define AX25_NOUID_DEFAULT 0 +#define AX25_NOUID_BLOCK 1 +#define AX25_SET_RT_IPMODE 2 + +/* Digipeating flags: */ +#define AX25_DIGI_INBAND 0x01 /* Allow digipeating within port */ +#define AX25_DIGI_XBAND 0x02 /* Allow digipeating across ports */ + +/* Maximim number of digipeaters: */ +#define AX25_MAX_DIGIS 8 + + +typedef struct + { + char ax25_call[7]; /* 6 call + SSID (shifted ascii) */ + } +ax25_address; + +struct sockaddr_ax25 + { + sa_family_t sax25_family; + ax25_address sax25_call; + int sax25_ndigis; + }; + +/* + * The sockaddr struct with the digipeater adresses: + */ +struct full_sockaddr_ax25 + { + struct sockaddr_ax25 fsa_ax25; + ax25_address fsa_digipeater[AX25_MAX_DIGIS]; + }; +#define sax25_uid sax25_ndigis + +struct ax25_routes_struct + { + ax25_address port_addr; + ax25_address dest_addr; + unsigned char digi_count; + ax25_address digi_addr[AX25_MAX_DIGIS]; + }; + +/* The AX.25 ioctl structure: */ +struct ax25_ctl_struct + { + ax25_address port_addr; + ax25_address source_addr; + ax25_address dest_addr; + unsigned int cmd; + unsigned long arg; + unsigned char digi_count; + ax25_address digi_addr[AX25_MAX_DIGIS]; + }; + +struct ax25_info_struct + { + unsigned int n2, n2count; + unsigned int t1, t1timer; + unsigned int t2, t2timer; + unsigned int t3, t3timer; + unsigned int idle, idletimer; + unsigned int state; + unsigned int rcv_q, snd_q; + }; + +struct ax25_fwd_struct + { + ax25_address port_from; + ax25_address port_to; + }; + +/* AX.25 route structure: */ +struct ax25_route_opt_struct + { + ax25_address port_addr; + ax25_address dest_addr; + int cmd; + int arg; + }; + +/* AX.25 BPQ stuff: */ +struct ax25_bpqaddr_struct + { + char dev[16]; + ax25_address addr; + }; + +/* Definitions for the AX.25 `values' fields: */ +#define AX25_VALUES_IPDEFMODE 0 /* 'D'=DG 'V'=VC */ +#define AX25_VALUES_AXDEFMODE 1 /* 8=Normal 128=Extended Seq Nos */ +#define AX25_VALUES_NETROM 2 /* Allow NET/ROM - 0=No 1=Yes */ +#define AX25_VALUES_TEXT 3 /* Allow PID=Text - 0=No 1=Yes */ +#define AX25_VALUES_BACKOFF 4 /* 'E'=Exponential 'L'=Linear */ +#define AX25_VALUES_CONMODE 5 /* Allow connected modes - 0=No 1=Yes */ +#define AX25_VALUES_WINDOW 6 /* Default window size for standard AX.25 */ +#define AX25_VALUES_EWINDOW 7 /* Default window size for extended AX.25 */ +#define AX25_VALUES_T1 8 /* Default T1 timeout value */ +#define AX25_VALUES_T2 9 /* Default T2 timeout value */ +#define AX25_VALUES_T3 10 /* Default T3 timeout value */ +#define AX25_VALUES_N2 11 /* Default N2 value */ +#define AX25_VALUES_DIGI 12 /* Digipeat mode */ +#define AX25_VALUES_IDLE 13 /* mode vc idle timer */ +#define AX25_VALUES_PACLEN 14 /* AX.25 MTU */ +#define AX25_VALUES_IPMAXQUEUE 15 /* Maximum number of buffers enqueued */ +#define AX25_MAX_VALUES 20 + +struct ax25_parms_struct + { + ax25_address port_addr; + unsigned short values[AX25_MAX_VALUES]; + }; + +#endif /* netax25/ax25.h */ diff --git a/netax25/kernel_ax25.h b/netax25/kernel_ax25.h deleted file mode 100644 index e1b6abb..0000000 --- a/netax25/kernel_ax25.h +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _NETAX25_AX25_H -#define _NETAX25_AX25_H 1 - -#include -#include - -/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */ -#define SOL_AX25 257 - -/* AX.25 flags: */ -#define AX25_WINDOW 1 -#define AX25_T1 2 -#define AX25_T2 5 -#define AX25_T3 4 -#define AX25_N2 3 -#define AX25_BACKOFF 6 -#define AX25_EXTSEQ 7 -#define AX25_PIDINCL 8 -#define AX25_IDLE 9 -#define AX25_PACLEN 10 -#define AX25_IPMAXQUEUE 11 -#define AX25_IAMDIGI 12 -#define AX25_KILL 99 - -/* AX.25 socket ioctls: */ -#define SIOCAX25GETUID (SIOCPROTOPRIVATE) -#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1) -#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2) -#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3) -#define SIOCAX25BPQADDR (SIOCPROTOPRIVATE+4) -#define SIOCAX25GETPARMS (SIOCPROTOPRIVATE+5) -#define SIOCAX25SETPARMS (SIOCPROTOPRIVATE+6) -#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7) -#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8) -#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+9) -#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10) -#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11) - -/* unknown: */ -#define AX25_NOUID_DEFAULT 0 -#define AX25_NOUID_BLOCK 1 -#define AX25_SET_RT_IPMODE 2 - -/* Digipeating flags: */ -#define AX25_DIGI_INBAND 0x01 /* Allow digipeating within port */ -#define AX25_DIGI_XBAND 0x02 /* Allow digipeating across ports */ - -/* Maximim number of digipeaters: */ -#define AX25_MAX_DIGIS 8 - - -typedef struct - { - char ax25_call[7]; /* 6 call + SSID (shifted ascii) */ - } -ax25_address; - -struct sockaddr_ax25 - { - sa_family_t sax25_family; - ax25_address sax25_call; - int sax25_ndigis; - }; - -/* - * The sockaddr struct with the digipeater adresses: - */ -struct full_sockaddr_ax25 - { - struct sockaddr_ax25 fsa_ax25; - ax25_address fsa_digipeater[AX25_MAX_DIGIS]; - }; -#define sax25_uid sax25_ndigis - -struct ax25_routes_struct - { - ax25_address port_addr; - ax25_address dest_addr; - unsigned char digi_count; - ax25_address digi_addr[AX25_MAX_DIGIS]; - }; - -/* The AX.25 ioctl structure: */ -struct ax25_ctl_struct - { - ax25_address port_addr; - ax25_address source_addr; - ax25_address dest_addr; - unsigned int cmd; - unsigned long arg; - unsigned char digi_count; - ax25_address digi_addr[AX25_MAX_DIGIS]; - }; - -struct ax25_info_struct - { - unsigned int n2, n2count; - unsigned int t1, t1timer; - unsigned int t2, t2timer; - unsigned int t3, t3timer; - unsigned int idle, idletimer; - unsigned int state; - unsigned int rcv_q, snd_q; - }; - -struct ax25_fwd_struct - { - ax25_address port_from; - ax25_address port_to; - }; - -/* AX.25 route structure: */ -struct ax25_route_opt_struct - { - ax25_address port_addr; - ax25_address dest_addr; - int cmd; - int arg; - }; - -/* AX.25 BPQ stuff: */ -struct ax25_bpqaddr_struct - { - char dev[16]; - ax25_address addr; - }; - -/* Definitions for the AX.25 `values' fields: */ -#define AX25_VALUES_IPDEFMODE 0 /* 'D'=DG 'V'=VC */ -#define AX25_VALUES_AXDEFMODE 1 /* 8=Normal 128=Extended Seq Nos */ -#define AX25_VALUES_NETROM 2 /* Allow NET/ROM - 0=No 1=Yes */ -#define AX25_VALUES_TEXT 3 /* Allow PID=Text - 0=No 1=Yes */ -#define AX25_VALUES_BACKOFF 4 /* 'E'=Exponential 'L'=Linear */ -#define AX25_VALUES_CONMODE 5 /* Allow connected modes - 0=No 1=Yes */ -#define AX25_VALUES_WINDOW 6 /* Default window size for standard AX.25 */ -#define AX25_VALUES_EWINDOW 7 /* Default window size for extended AX.25 */ -#define AX25_VALUES_T1 8 /* Default T1 timeout value */ -#define AX25_VALUES_T2 9 /* Default T2 timeout value */ -#define AX25_VALUES_T3 10 /* Default T3 timeout value */ -#define AX25_VALUES_N2 11 /* Default N2 value */ -#define AX25_VALUES_DIGI 12 /* Digipeat mode */ -#define AX25_VALUES_IDLE 13 /* mode vc idle timer */ -#define AX25_VALUES_PACLEN 14 /* AX.25 MTU */ -#define AX25_VALUES_IPMAXQUEUE 15 /* Maximum number of buffers enqueued */ -#define AX25_MAX_VALUES 20 - -struct ax25_parms_struct - { - ax25_address port_addr; - unsigned short values[AX25_MAX_VALUES]; - }; - -#endif /* netax25/ax25.h */ diff --git a/netax25/kernel_netrom.h b/netax25/kernel_netrom.h deleted file mode 100644 index 4984772..0000000 --- a/netax25/kernel_netrom.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _NETROM_NETROM_H -#define _NETROM_NETROM_H 1 - -#include - -/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */ -#define SOL_NETROM 259 - -/* NetRom control values: */ -#define NETROM_T1 1 -#define NETROM_T2 2 -#define NETROM_N2 3 -#define NETROM_PACLEN 5 -#define NETROM_T4 6 -#define NETROM_IDLE 7 - -#define NETROM_KILL 99 - -/* Type of route: */ -#define NETROM_NEIGH 0 -#define NETROM_NODE 1 - -struct nr_route_struct - { - int type; - ax25_address callsign; - char device[16]; - unsigned int quality; - char mnemonic[7]; - ax25_address neighbour; - unsigned int obs_count; - unsigned int ndigis; - ax25_address digipeaters[AX25_MAX_DIGIS]; - }; - -/* NetRom socket ioctls: */ -#define SIOCNRGETPARMS (SIOCPROTOPRIVATE+0) -#define SIOCNRSETPARMS (SIOCPROTOPRIVATE+1) -#define SIOCNRDECOBS (SIOCPROTOPRIVATE+2) -#define SIOCNRRTCTL (SIOCPROTOPRIVATE+3) -#define SIOCNRCTLCON (SIOCPROTOPRIVATE+4) - -/* NetRom parameter structure: */ -struct nr_parms_struct - { - unsigned int quality; - unsigned int obs_count; - unsigned int ttl; - unsigned int timeout; - unsigned int ack_delay; - unsigned int busy_delay; - unsigned int tries; - unsigned int window; - unsigned int paclen; - }; - -/* NetRom control structure: */ -struct nr_ctl_struct - { - unsigned char index; - unsigned char id; - unsigned int cmd; - unsigned long arg; - }; - -#endif /* netrom/netrom.h */ diff --git a/netax25/kernel_rose.h b/netax25/kernel_rose.h deleted file mode 100644 index e4ba7d7..0000000 --- a/netax25/kernel_rose.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Definitions for Rose packet radio address family. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* What follows is copied from the 2.1.93 . */ - -#ifndef _NETROSE_ROSE_H -#define _NETROSE_ROSE_H 1 - -/* Socket level values. */ -#define SOL_ROSE 260 - - -/* These are the public elements of the Linux kernel Rose - implementation. For kernel AX.25 see the file ax25.h. This file - requires ax25.h for the definition of the ax25_address structure. */ -#define ROSE_MTU 251 - -#define ROSE_MAX_DIGIS 6 - -#define ROSE_DEFER 1 -#define ROSE_T1 2 -#define ROSE_T2 3 -#define ROSE_T3 4 -#define ROSE_IDLE 5 -#define ROSE_QBITINCL 6 -#define ROSE_HOLDBACK 7 - -#define SIOCRSGCAUSE (SIOCPROTOPRIVATE + 0) -#define SIOCRSSCAUSE (SIOCPROTOPRIVATE + 1) -#define SIOCRSL2CALL (SIOCPROTOPRIVATE + 2) -#define SIOCRSSL2CALL (SIOCPROTOPRIVATE + 2) -#define SIOCRSACCEPT (SIOCPROTOPRIVATE + 3) -#define SIOCRSCLRRT (SIOCPROTOPRIVATE + 4) -#define SIOCRSGL2CALL (SIOCPROTOPRIVATE + 5) -#define SIOCRSGFACILITIES (SIOCPROTOPRIVATE + 6) - -#define ROSE_DTE_ORIGINATED 0x00 -#define ROSE_NUMBER_BUSY 0x01 -#define ROSE_INVALID_FACILITY 0x03 -#define ROSE_NETWORK_CONGESTION 0x05 -#define ROSE_OUT_OF_ORDER 0x09 -#define ROSE_ACCESS_BARRED 0x0B -#define ROSE_NOT_OBTAINABLE 0x0D -#define ROSE_REMOTE_PROCEDURE 0x11 -#define ROSE_LOCAL_PROCEDURE 0x13 -#define ROSE_SHIP_ABSENT 0x39 - - -typedef struct -{ - char rose_addr[5]; -} rose_address; - -struct sockaddr_rose -{ - sa_family_t srose_family; - rose_address srose_addr; - ax25_address srose_call; - int srose_ndigis; - ax25_address srose_digi; -}; - -struct full_sockaddr_rose -{ - sa_family_t srose_family; - rose_address srose_addr; - ax25_address srose_call; - unsigned int srose_ndigis; - ax25_address srose_digis[ROSE_MAX_DIGIS]; -}; - -struct rose_route_struct -{ - rose_address address; - unsigned short int mask; - ax25_address neighbour; - char device[16]; - unsigned char ndigis; - ax25_address digipeaters[AX25_MAX_DIGIS]; -}; - -struct rose_cause_struct -{ - unsigned char cause; - unsigned char diagnostic; -}; - -struct rose_facilities_struct -{ - rose_address source_addr, dest_addr; - ax25_address source_call, dest_call; - unsigned char source_ndigis, dest_ndigis; - ax25_address source_digis[ROSE_MAX_DIGIS]; - ax25_address dest_digis[ROSE_MAX_DIGIS]; - unsigned int rand; - rose_address fail_addr; - ax25_address fail_call; -}; - -#endif /* netrose/rose.h */ diff --git a/netrom/netrom.h b/netrom/netrom.h new file mode 100644 index 0000000..4984772 --- /dev/null +++ b/netrom/netrom.h @@ -0,0 +1,84 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _NETROM_NETROM_H +#define _NETROM_NETROM_H 1 + +#include + +/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */ +#define SOL_NETROM 259 + +/* NetRom control values: */ +#define NETROM_T1 1 +#define NETROM_T2 2 +#define NETROM_N2 3 +#define NETROM_PACLEN 5 +#define NETROM_T4 6 +#define NETROM_IDLE 7 + +#define NETROM_KILL 99 + +/* Type of route: */ +#define NETROM_NEIGH 0 +#define NETROM_NODE 1 + +struct nr_route_struct + { + int type; + ax25_address callsign; + char device[16]; + unsigned int quality; + char mnemonic[7]; + ax25_address neighbour; + unsigned int obs_count; + unsigned int ndigis; + ax25_address digipeaters[AX25_MAX_DIGIS]; + }; + +/* NetRom socket ioctls: */ +#define SIOCNRGETPARMS (SIOCPROTOPRIVATE+0) +#define SIOCNRSETPARMS (SIOCPROTOPRIVATE+1) +#define SIOCNRDECOBS (SIOCPROTOPRIVATE+2) +#define SIOCNRRTCTL (SIOCPROTOPRIVATE+3) +#define SIOCNRCTLCON (SIOCPROTOPRIVATE+4) + +/* NetRom parameter structure: */ +struct nr_parms_struct + { + unsigned int quality; + unsigned int obs_count; + unsigned int ttl; + unsigned int timeout; + unsigned int ack_delay; + unsigned int busy_delay; + unsigned int tries; + unsigned int window; + unsigned int paclen; + }; + +/* NetRom control structure: */ +struct nr_ctl_struct + { + unsigned char index; + unsigned char id; + unsigned int cmd; + unsigned long arg; + }; + +#endif /* netrom/netrom.h */ diff --git a/netrose/rose.h b/netrose/rose.h new file mode 100644 index 0000000..e4ba7d7 --- /dev/null +++ b/netrose/rose.h @@ -0,0 +1,116 @@ +/* Definitions for Rose packet radio address family. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* What follows is copied from the 2.1.93 . */ + +#ifndef _NETROSE_ROSE_H +#define _NETROSE_ROSE_H 1 + +/* Socket level values. */ +#define SOL_ROSE 260 + + +/* These are the public elements of the Linux kernel Rose + implementation. For kernel AX.25 see the file ax25.h. This file + requires ax25.h for the definition of the ax25_address structure. */ +#define ROSE_MTU 251 + +#define ROSE_MAX_DIGIS 6 + +#define ROSE_DEFER 1 +#define ROSE_T1 2 +#define ROSE_T2 3 +#define ROSE_T3 4 +#define ROSE_IDLE 5 +#define ROSE_QBITINCL 6 +#define ROSE_HOLDBACK 7 + +#define SIOCRSGCAUSE (SIOCPROTOPRIVATE + 0) +#define SIOCRSSCAUSE (SIOCPROTOPRIVATE + 1) +#define SIOCRSL2CALL (SIOCPROTOPRIVATE + 2) +#define SIOCRSSL2CALL (SIOCPROTOPRIVATE + 2) +#define SIOCRSACCEPT (SIOCPROTOPRIVATE + 3) +#define SIOCRSCLRRT (SIOCPROTOPRIVATE + 4) +#define SIOCRSGL2CALL (SIOCPROTOPRIVATE + 5) +#define SIOCRSGFACILITIES (SIOCPROTOPRIVATE + 6) + +#define ROSE_DTE_ORIGINATED 0x00 +#define ROSE_NUMBER_BUSY 0x01 +#define ROSE_INVALID_FACILITY 0x03 +#define ROSE_NETWORK_CONGESTION 0x05 +#define ROSE_OUT_OF_ORDER 0x09 +#define ROSE_ACCESS_BARRED 0x0B +#define ROSE_NOT_OBTAINABLE 0x0D +#define ROSE_REMOTE_PROCEDURE 0x11 +#define ROSE_LOCAL_PROCEDURE 0x13 +#define ROSE_SHIP_ABSENT 0x39 + + +typedef struct +{ + char rose_addr[5]; +} rose_address; + +struct sockaddr_rose +{ + sa_family_t srose_family; + rose_address srose_addr; + ax25_address srose_call; + int srose_ndigis; + ax25_address srose_digi; +}; + +struct full_sockaddr_rose +{ + sa_family_t srose_family; + rose_address srose_addr; + ax25_address srose_call; + unsigned int srose_ndigis; + ax25_address srose_digis[ROSE_MAX_DIGIS]; +}; + +struct rose_route_struct +{ + rose_address address; + unsigned short int mask; + ax25_address neighbour; + char device[16]; + unsigned char ndigis; + ax25_address digipeaters[AX25_MAX_DIGIS]; +}; + +struct rose_cause_struct +{ + unsigned char cause; + unsigned char diagnostic; +}; + +struct rose_facilities_struct +{ + rose_address source_addr, dest_addr; + ax25_address source_call, dest_call; + unsigned char source_ndigis, dest_ndigis; + ax25_address source_digis[ROSE_MAX_DIGIS]; + ax25_address dest_digis[ROSE_MAX_DIGIS]; + unsigned int rand; + rose_address fail_addr; + ax25_address fail_call; +}; + +#endif /* netrose/rose.h */ -- cgit v1.2.3