ax25-tools-0.0.10-rc2+cvs20120204/0000755000175000017500000000000011713361566013736 5ustar patpatax25-tools-0.0.10-rc2+cvs20120204/README0000644000175000017500000000056307264465014014621 0ustar patpatAX25 Tools ========== Note that kissattch has changed its command line format slight. While the old format will work, the -i option is now, err, not optional. This was done to stop the million or so emails we get on linux-hams email list saying why do people get axports unconfigured even after a kissattach command. - Craig Small ax25-tools-0.0.10-rc2+cvs20120204/COPYING0000644000175000017500000004311007264465012014765 0ustar patpat GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ax25-tools-0.0.10-rc2+cvs20120204/ax25-tools.spec.in0000644000175000017500000001412411601314623017122 0ustar patpatName: ax25-tools Version: @BASEVERSION@@EXTRAVERSION@ Release: 4 Summary: Non-GUI tools used to configure an AX.25 enabled computer Group: Applications/Communications License: GPLv2+ URL: http://www.linux-ax25.org/ Source0: http://www.linux-ax25.org/pub/%{name}/%{name}-@VERSION@.tar.gz BuildRoot: %{_tmppath}/%{name}-@VERSION@-%{release}-root-%(%{__id_u} -n) BuildRequires: libax25-devel BuildRequires: libXext-devel, libX11-devel, libXi-devel, fltk-devel %description ax25-tools is a collection of tools that are used to configure an ax.25 enabled computer. They will configure interfaces and assign callsigns to ports as well as Net/ROM and ROSE configuration. This package only contains the command line programs; the GUI programs are contained in ax25-tools-x package. * m6pack - handle multiple 6pack TNCs on a single interface * ax25d - general purpose AX.25, NET/ROM and Rose daemon * axctl - configure/Kill running AX.25 connections * axparms - configure AX.25 interfaces * axspawn - allow automatic login to a Linux system * beacon - transmit periodic messages on an AX.25 port * bpqparms - configure BPQ ethernet devices * mheardd - display AX.25 calls recently heard * rxecho - transparently route AX.25 packets between ports * mheard - collect information about packet activity * dmascc_cfg - configure dmascc devices * sethdlc - get/set Linux HDLC packet radio modem driver port information * smmixer - get/set Linux soundcard packet radio modem driver mixer * kissattach - Attach a KISS or 6PACK interface * kissnetd - create a virtual network * kissparms - configure KISS TNCs * mkiss - attach multiple KISS interfaces * net2kiss - convert a network AX.25 driver to a KISS stream on a pty * netromd - send and receive NET/ROM routing messages * nodesave - saves NET/ROM routing information * nrattach - start a NET/ROM interface * nrparms - configure a NET/ROM interface * nrsdrv - KISS to NET/ROM serial converter * rsattach - start a ROSE interface * rsdwnlnk - user exit from the ROSE network * rsmemsiz - monitor the ROSE subsystem * rsusers.sh - monitor AX.25, NET/ROM and ROSE users * rsparms - configure a ROSE interface * rsuplnk - User entry into the ROSE network * rip98d - RIP98 routing daemon * ttylinkd - TTYlink daemon for AX.25, NET/ROM, ROSE and IP * ax25_call - Make an AX.25 connection * netrom_call - Make a NET/ROM connection * rose_call - Make a ROSE connection * tcp_call - Make a TCP connection * yamcfg - configure a YAM interface %package x Summary: Tools used to configure an AX.25 enabled computer Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description x ax25-tools is a collection of tools that are used to configure an ax.25 enabled computer. This package contains the GUI programs to configure Baycom modem and sound modem. * smdiag - Linux soundcard packet radio modem driver diagnostics utility * xfhdlcchpar - kernel HDLC radio modem driver channel parameter utility * xfhdlcst - kernel HDLC radio modem driver status display utility * xfsmdiag - kernel soundcard radio modem driver diagnostics utility * xfsmmixer - kernel soundcard radio modem driver mixer utility %prep %setup -q -n %{name}-@VERSION@ %build %configure make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT #don't include these twice rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}/ %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING README %doc yamdrv/README.yamdrv user_call/README.user_call tcpip/ttylinkd.README dmascc/README.dmascc %{_bindir}/axgetput %{_bindir}/bget %{_bindir}/bput %{_bindir}/mheard %{_bindir}/sethdlc %{_bindir}/smmixer %{_sbindir}/ax25_call %{_sbindir}/ax25d %{_sbindir}/axctl %{_sbindir}/axparms %{_sbindir}/axspawn %{_sbindir}/beacon %{_sbindir}/bpqparms %{_sbindir}/dmascc_cfg %{_sbindir}/kissattach %{_sbindir}/kissnetd %{_sbindir}/kissparms %{_sbindir}/m6pack %{_sbindir}/mcs2h %{_sbindir}/mheardd %{_sbindir}/mkiss %{_sbindir}/net2kiss %{_sbindir}/netrom_call %{_sbindir}/netromd %{_sbindir}/nodesave %{_sbindir}/nrattach %{_sbindir}/nrparms %{_sbindir}/nrsdrv %{_sbindir}/rip98d %{_sbindir}/rose_call %{_sbindir}/rsattach %{_sbindir}/rsdwnlnk %{_sbindir}/rsmemsiz %{_sbindir}/rsparms %{_sbindir}/rsuplnk %{_sbindir}/rsusers.sh %{_sbindir}/rxecho %{_sbindir}/spattach %{_sbindir}/tcp_call %{_sbindir}/ttylinkd %{_sbindir}/yamcfg %{_mandir}/man1/* %{_mandir}/man4/* %{_mandir}/man5/* %{_mandir}/man8/ax25_call.8.gz %{_mandir}/man8/ax25d.8.gz %{_mandir}/man8/axctl.8.gz %{_mandir}/man8/axparms.8.gz %{_mandir}/man8/axspawn.8.gz %{_mandir}/man8/beacon.8.gz %{_mandir}/man8/bpqparms.8.gz %{_mandir}/man8/kissattach.8.gz %{_mandir}/man8/kissnetd.8.gz %{_mandir}/man8/kissparms.8.gz %{_mandir}/man8/m6pack.8.gz %{_mandir}/man8/mheardd.8.gz %{_mandir}/man8/mkiss.8.gz %{_mandir}/man8/net2kiss.8.gz %{_mandir}/man8/netrom_call.8.gz %{_mandir}/man8/netromd.8.gz %{_mandir}/man8/nodesave.8.gz %{_mandir}/man8/nrattach.8.gz %{_mandir}/man8/nrparms.8.gz %{_mandir}/man8/nrsdrv.8.gz %{_mandir}/man8/rip98d.8.gz %{_mandir}/man8/rose_call.8.gz %{_mandir}/man8/rsattach.8.gz %{_mandir}/man8/rsdwnlnk.8.gz %{_mandir}/man8/rsparms.8.gz %{_mandir}/man8/rsuplnk.8.gz %{_mandir}/man8/rxecho.8.gz %{_mandir}/man8/sethdlc.8.gz %{_mandir}/man8/smmixer.8.gz %{_mandir}/man8/spattach.8.gz %{_mandir}/man8/tcp_call.8.gz %{_mandir}/man8/ttylinkd.8.gz %{_mandir}/man9/baycom.9.gz %{_mandir}/man9/hdlcdrv.9.gz %{_mandir}/man9/soundmodem.9.gz %files x %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING %{_bindir}/smdiag %{_sbindir}/xfhdlcchpar %{_sbindir}/xfhdlcst %{_sbindir}/xfsmdiag %{_sbindir}/xfsmmixer %{_mandir}/man8/smdiag.8.gz %changelog * Sat Jun 25 2011 Ralf Baechle - Add BuildRequires to libax25-devel, libXext-devel and libX11-devel. - Move smdiag, xfhdlcchpar, xfhdlcst, xfsmdiag and xfsmmixer into a separate package. - Bump Release to 4. * Fri Jun 24 2011 Ralf Baechle - Add BuildRequires to libXi-devel and fltk-devel - Bump Release to 2. * Sat Jun 27 2009 Ralf Baechle - Initial version ax25-tools-0.0.10-rc2+cvs20120204/AUTHORS0000644000175000017500000000262211601302732014772 0ustar patpataxspawn Joerg Reuter DL1BKE ax25ipd Rob Mayfield VK5XXX ax25rtd Klaus Kudielka bpqparms Joerg Reuter DL1BKE call Alexander Tietzel DG6XA mkiss Tomi Manninen OH2BNS kissnetd Frederic Rible F1OAT listen Heikki Hannikainen OH7LZB net2kiss Thomas Sailer HB9JNX node Tomi Manninen OH2BNS nodesave Tomi Manninen OH2BNS nrsdrv Dave Brown N2RJT piconfig John Paul Morrison VE7JPM pms David Brown N2RJT rxecho Tomi Manninen OH2BNS setcrystal Thomas Sailer HB9JNX sethdlc Thomas Sailer HB9JNX smdiag Thomas Sailer HB9JNX smmixer Thomas Sailer HB9JNX ttylinkd Craig Small VK2XLZ dmascc_cfg Klaus Kudielka xfhdlcchpar Thomas Sailer HB9JNX xfhdlcst Thomas Sailer HB9JNX xfsmdiag Thomas Sailer HB9JNX xfsmmixer Thomas Sailer HB9JNX yamcfg Jean-Paul Roubelat F6FBB All others Jonathon Naylor G4KLX ax25-tools-0.0.10-rc2+cvs20120204/rose/0000755000175000017500000000000011713361565014705 5ustar patpatax25-tools-0.0.10-rc2+cvs20120204/rose/rsattach.80000644000175000017500000000174707264466572016632 0ustar patpat.TH RSATTACH 8 "27 August 1996" Linux "Linux System Managers Manual" .SH NAME rsattach \- Start a Rose interface .SH SYNOPSIS .B rsattach [-i inetaddr] [-v] port .SH DESCRIPTION .LP .B Rsattach takes many of the parameters for the port from the rsports(5) file. The port argument is the name of a port as given in the rsports(5) file. .LP .B Rsattach tries to find the free Rose device in the system. The device name checked is rose0. If no free Rose device is available an error is generated and the program terminates. .SH OPTIONS .TP 16 .BI "\-i inetaddr" Set the internet address of the interface. This address may either be a dotted decimal address or a host name. .TP 16 .BI \-v Display the version. .SH "SEE ALSO" .BR rose (4), .BR rsparms (4), .BR rsports (5), .BR ifconfig (8). .SH BUGS The program can be run many times with the same arguments creating many instances of the same attributes on different devices. Not a good idea. .SH AUTHOR Jonathan Naylor G4KLX ax25-tools-0.0.10-rc2+cvs20120204/rose/rsusers.sh0000755000175000017500000000442507264466575016774 0ustar patpat#! /bin/sh ALL=n if [ $# = 1 ]; then ALL=y fi echo -en "Linux/ROSE 001. AX.25, NET/ROM and ROSE Users.\r" if [ -r /proc/net/ax25 ]; then cat /proc/net/ax25 | awk ' BEGIN { printf "Active AX.25 Sessions\r" printf "Dest Source State\r" n = 0 } NR > 1 { if ($4 == 0) { state = "LISTENING" } else if ($4 == 1) { state = "CONNECTING" } else if ($4 == 2) { state = "DISCONNECTING" } else if ($4 == 3) { state = "CONNECTED" } else { state = "RECOVERY" } if ($4 != 0) { printf "%-9s %-9s %s\r", $1, $2, state n++ } else { if (ALL == "y") { printf "%-9s %-9s %s\r", $1, $2, state n++ } } } END { if (n == 0) { printf "None active\r" } }' ALL=$ALL echo -en "\r" fi if [ -r /proc/net/nr ]; then cat /proc/net/nr | awk ' BEGIN { printf "Active NET/ROM Sessions\r" printf "User Dest Source State\r" n = 0 } NR > 1 { if ($7 == 0) { state = "LISTENING" } else if ($7 == 1) { state = "CONNECTING" } else if ($7 == 2) { state = "DISCONNECTING" } else if ($7 == 3) { state = "CONNECTED" } else { state = "RECOVERY" } if ($7 != 0) { printf "%-9s %-9s %-9s %s\r", $1, $2, $3, state n++ } else { if (ALL == "y") { printf "%-9s %-9s %-9s %s\r", $1, $2, $3, state n++ } } } END { if (n == 0) { printf "None active\r" } }' ALL=$ALL echo -en "\r" fi if [ -r /proc/net/rose ]; then cat /proc/net/rose | awk ' BEGIN { printf "Active ROSE Sessions\r" printf "Dest Source State\r" n = 0 } NR > 1 { if ($7 == 0) { state = "LISTENING" } else if ($7 == 1) { state = "CONNECTING" } else if ($7 == 2) { state = "DISCONNECTING" } else if ($7 == 3) { state = "CONNECTED" } else { state = "RESETTING" } if ($7 != 0) { printf "%-10s %-9s %-10s %-9s %s\r", $1, $2, $3, $4, state n++ } else { if (ALL == "y") { printf "%-10s %-9s %-10s %-9s %s\r", $1, $2, $3, $4, state n++ } } } END { if (n == 0) { printf "None active\r" } }' ALL=$ALL echo -en "\r" fi read exit 0 ax25-tools-0.0.10-rc2+cvs20120204/rose/.cvsignore0000644000175000017500000000011211216643422016670 0ustar patpatMakefile Makefile.in rsattach rsdwnlnk rsparms rsuplnk rsmemsiz .deps *.o ax25-tools-0.0.10-rc2+cvs20120204/rose/rsuplnk.80000644000175000017500000000307407264466574016514 0ustar patpat.TH RSUPLNK 8 "29 April 1997" Linux "Linux Programmer's Manual" .SH NAME rsuplnk \- User entry into the ROSE network. .SH SYNOPSIS .B rsuplnk [-q] .SH DESCRIPTION .LP The .B rsuplnk program allows a user to gain entry into the ROSE network using the standard pseudo-digipeating method. Recent Linux kernels are aware of this form of operation and the .B ax25d program can listen for such connections. The normal mode of operation of a ROSE switch is to have one ROSE address (ie port) per physical AX.25 port. Therefore ROSE users coming in on a given AX.25 port will appear as if they come from the associated ROSE port. This is the reason for the need for a ROSE port as an argument. .LP To use .B rsuplnk you need an entry in .B ax25d.conf to listen for incoming connections. In the example below, I will be listening for ROSE connections on my AX.25 port 144 using the callsign KE4GAJ-10 and the ROSE port associated with the AX.25 port is rs144. .LP # .br [KE4GAJ-10* VIA 144] .br NOCALL * * * * * * L .br default * * * * * * - root /usr/sbin/rsuplnk rsuplnk rs144 .br # .LP There would typically be one .B rsuplnk per user access AX.25 port. The associated program for exiting a ROSE network is .B rsdwnlnk. .LP All errors generated by .B rsuplnk are written to the system debug log file. .SH OPTIONS .TP 8 .BI \-q Supresses the messages generated by .B rsuplnk when making the connection. .SH FILES .br /etc/ax25/rsports .SH "SEE ALSO" .BR rose (4), .BR ax25d.conf (5), .BR ax25d (8), .BR rsdwnlnk (8), .BR rose_call (8). .SH AUTHOR Jonathan Naylor G4KLX ax25-tools-0.0.10-rc2+cvs20120204/rose/rose.40000644000175000017500000000312411607702066015737 0ustar patpat.TH ROSE 4 "27 August 1996" Linux "Linux Programmer's Manual" .SH NAME AF_ROSE \- Rose amateur packet radio protocol family .SH DESCRIPTION .LP .B Rose is a protocol used extensively by radio amateurs. The Linux Rose protocol family permits access to these protocols via the standard networking .B socket metaphor. .LP The Rose protocol layer only supports connected mode. .LP The only mode of operation is connected mode which is the mode used for a socket of type SOCK_SEQPACKET (stream sockets are not available in Rose). This requires that the user ensures output data is suitably packetised, and that input data is read a packet at a time into a buffer of suitable size. .LP Rose addresses consist of 10 digits. These are encoded into a sockaddr_rose structure which is provided to the relevant system calls. .LP Rose has some unusual properties. Notably in a multi-user system an AX.25 address is often associated with a user, and some users may not have such an association. a set of ioctl calls are provided to manage an association table. .LP Rose supports the following socket options for SOL_ROSE. ROSE_T1 is the T11/T21 timer in 1/10ths of a second, ROSE_T2 is the T12/T22 timer in 1/10ths of a second. ROSE_T3, is the T13/T23 timer in 1/10ths of a second. It is possible for an application to request that the Rose layer return the Rose header as well as the application data, this is done via the ROSE_HDRINCL socket option. .SH "SEE ALSO" .BR call (1), .BR socket (2), .BR setsockopt(2), .BR getsockopt(2), .BR rsports (5), .BR rsparms (8). .LP .SH AUTHOR Jonathan Naylor G4KLX ax25-tools-0.0.10-rc2+cvs20120204/rose/rsdwnlnk.c0000644000175000017500000001411511217472623016712 0ustar patpat#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define AX25_HBIT 0x80 void alarm_handler(int sig) { } int main(int argc, char **argv) { unsigned char buffer[512], *addr; fd_set read_fd; int n = 0, s, yes = 1; struct full_sockaddr_ax25 axbind, axconnect; struct sockaddr_rose rosesock, rosepeer; socklen_t addrlen; openlog("rsdwnlnk", LOG_PID, LOG_DAEMON); /* * Arguments should be "rsdwnlnk ax25port ax25call" */ if (argc != 3) { syslog(LOG_ERR, "invalid number of parameters\n"); closelog(); return 1; } if (ax25_config_load_ports() == 0) { syslog(LOG_ERR, "problem with axports file\n"); closelog(); return 1; } addrlen = sizeof(struct sockaddr_rose); if (getsockname(STDIN_FILENO, (struct sockaddr *)&rosesock, &addrlen) == -1) { syslog(LOG_ERR, "cannot getsockname - %s\n", strerror(errno)); closelog(); return 1; } addrlen = sizeof(struct sockaddr_rose); if (getpeername(STDIN_FILENO, (struct sockaddr *)&rosepeer, &addrlen) == -1) { syslog(LOG_ERR, "cannot getpeername - %s\n", strerror(errno)); closelog(); return 1; } if (setsockopt(STDIN_FILENO, SOL_ROSE, ROSE_QBITINCL, &yes, sizeof(yes)) == -1) { syslog(LOG_ERR, "cannot setsockopt(ROSE_QBITINCL) - %s\n", strerror(errno)); closelog(); return 1; } /* * Parse the passed values for correctness. */ axbind.fsa_ax25.sax25_family = AF_AX25; axbind.fsa_ax25.sax25_ndigis = 1; axbind.fsa_ax25.sax25_call = rosepeer.srose_call; if ((addr = ax25_config_get_addr(argv[1])) == NULL) { syslog(LOG_ERR, "invalid AX.25 port name - %s\n", argv[1]); closelog(); return 1; } if (ax25_aton_entry(addr, axbind.fsa_digipeater[0].ax25_call) == -1) { syslog(LOG_ERR, "invalid AX.25 port callsign - %s\n", argv[1]); closelog(); return 1; } axconnect.fsa_ax25.sax25_family = AF_AX25; axconnect.fsa_ax25.sax25_call = rosesock.srose_call; /* * The path at the far end has a digi in it. */ if (rosepeer.srose_ndigis == 1) { axconnect.fsa_digipeater[n] = rosepeer.srose_digi; axconnect.fsa_digipeater[n].ax25_call[6] |= AX25_HBIT; n++; } /* * Incoming call has a different DNIC */ if (memcmp(rosepeer.srose_addr.rose_addr, rosesock.srose_addr.rose_addr, 2) != 0) { addr = rose_ntoa(&rosepeer.srose_addr); addr[4] = '\0'; if (ax25_aton_entry(addr, axconnect.fsa_digipeater[n].ax25_call) == -1) { syslog(LOG_ERR, "invalid callsign - %s\n", addr); closelog(); return 1; } axconnect.fsa_digipeater[n].ax25_call[6] |= AX25_HBIT; n++; } /* * Put the remote address sans DNIC into the digi chain. */ addr = rose_ntoa(&rosepeer.srose_addr); if (ax25_aton_entry(addr + 4, axconnect.fsa_digipeater[n].ax25_call) == -1) { syslog(LOG_ERR, "invalid callsign - %s\n", addr + 4); closelog(); return 1; } axconnect.fsa_digipeater[n].ax25_call[6] |= AX25_HBIT; n++; /* * And my local ROSE callsign. */ if (ax25_aton_entry(argv[2], axconnect.fsa_digipeater[n].ax25_call) == -1) { syslog(LOG_ERR, "invalid callsign - %s\n", argv[2]); closelog(); return 1; } axconnect.fsa_digipeater[n].ax25_call[6] |= AX25_HBIT; n++; /* * A digi has been specified for this end. */ if (rosesock.srose_ndigis == 1) { axconnect.fsa_digipeater[n] = rosesock.srose_digi; n++; } axconnect.fsa_ax25.sax25_ndigis = n; addrlen = sizeof(struct full_sockaddr_ax25); /* * Open the socket into the kernel. */ if ((s = socket(AF_AX25, SOCK_SEQPACKET, 0)) < 0) { syslog(LOG_ERR, "cannot open AX.25 socket, %s\n", strerror(errno)); closelog(); return 1; } #ifdef HAVE_AX25_IAMDIGI if (setsockopt(s, SOL_AX25, AX25_IAMDIGI, &yes, sizeof(yes)) == -1) { syslog(LOG_ERR, "cannot setsockopt(AX25_IAMDIGI), %s\n", strerror(errno)); close(s); closelog(); return 1; } #endif /* HAVE_AX25_IAMDIGI */ #ifdef HAVE_AX25_PIDINCL if (setsockopt(s, SOL_AX25, AX25_PIDINCL, &yes, sizeof(yes)) == -1) { syslog(LOG_ERR, "cannot setsockopt(AX25_PIDINCL), %s\n", strerror(errno)); close(s); closelog(); return 1; } #endif /* HAVE_AX25_PIDINCL */ /* * Set our AX.25 callsign and AX.25 port callsign accordingly. */ if (bind(s, (struct sockaddr *)&axbind, addrlen) != 0) { syslog(LOG_ERR, "cannot bind AX.25 socket, %s\n", strerror(errno)); close(s); closelog(); return 1; } /* * If no response in 60 seconds, go away. */ alarm(60); signal(SIGALRM, alarm_handler); /* * Lets try and connect to the far end. */ if (connect(s, (struct sockaddr *)&axconnect, addrlen) != 0) { switch (errno) { case ECONNREFUSED: strcpy(buffer, "*** Connection refused\r"); break; case ENETUNREACH: strcpy(buffer, "*** No known route\r"); break; case EINTR: strcpy(buffer, "*** Connection timed out\r"); break; default: sprintf(buffer, "ERROR: cannot connect to AX.25 callsign, %s\r", strerror(errno)); break; } close(s); write(STDOUT_FILENO, buffer, strlen(buffer)); sleep(20); return 0; } /* * We got there. */ alarm(0); strcpy(buffer, "*** Connected\r"); write(STDOUT_FILENO, buffer, strlen(buffer)); /* * Loop until one end of the connection goes away. */ for (;;) { FD_ZERO(&read_fd); FD_SET(STDIN_FILENO, &read_fd); FD_SET(s, &read_fd); select(s + 1, &read_fd, NULL, NULL, NULL); if (FD_ISSET(s, &read_fd)) { if ((n = read(s, buffer + 2, sizeof(buffer)-2)) == -1) break; if (buffer[2] == 0xF0) { buffer[2] = 0; write(STDOUT_FILENO, buffer + 2, n); } else { buffer[0] = 1; /* Set Q Bit on */ buffer[1] = 0x7F; /* Q Bit escape */ write(STDOUT_FILENO, buffer, n + 2); } } if (FD_ISSET(STDIN_FILENO, &read_fd)) { if ((n = read(STDIN_FILENO, buffer, 512)) == -1) { close(s); break; } if (buffer[0] == 0) { /* Q Bit not set */ buffer[0] = 0xF0; write(s, buffer, n); } else { /* Lose the leading 0x7F */ write(s, buffer + 2, n - 2); } } } closelog(); return 0; } ax25-tools-0.0.10-rc2+cvs20120204/rose/rsuplnk.c0000644000175000017500000001447211217472623016554 0ustar patpat#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void alarm_handler(int sig) { } int main(int argc, char **argv) { unsigned char buffer[512], *addr, *p; char rose_address[11]; fd_set read_fd; int n, s, dnicindex = -1, addrindex = -1; int yes = 1, verbose = 1; socklen_t addrlen; struct sockaddr_rose rosebind, roseconnect; struct full_sockaddr_ax25 ax25sock, ax25peer; openlog("rsuplnk", LOG_PID, LOG_DAEMON); /* * Arguments should be "rsuplnk [-q] roseport" */ if (argc > 2 && strcmp(argv[1], "-q") == 0) { verbose = 0; --argc; ++argv; } if (argc != 2) { syslog(LOG_ERR, "invalid number of parameters\n"); closelog(); return 1; } if (rs_config_load_ports() == 0) { syslog(LOG_ERR, "problem with rsports file\n"); closelog(); return 1; } addrlen = sizeof(struct full_sockaddr_ax25); if (getsockname(STDIN_FILENO, (struct sockaddr *)&ax25sock, &addrlen) == -1) { syslog(LOG_ERR, "cannot getsockname, %s\n", strerror(errno)); closelog(); return 1; } addrlen = sizeof(struct full_sockaddr_ax25); if (getpeername(STDIN_FILENO, (struct sockaddr *)&ax25peer, &addrlen) == -1) { syslog(LOG_ERR, "cannot getpeername, %s\n", strerror(errno)); closelog(); return 1; } #ifdef HAVE_AX25_PIDINCL if (setsockopt(STDIN_FILENO, SOL_AX25, AX25_PIDINCL, &yes, sizeof(yes)) == -1) { syslog(LOG_ERR, "cannot setsockopt(AX25_PIDINCL) - %s\n", strerror(errno)); closelog(); return 1; } #endif /* HAVE_AX25_PIDINCL */ roseconnect.srose_family = rosebind.srose_family = AF_ROSE; roseconnect.srose_ndigis = rosebind.srose_ndigis = 0; addrlen = sizeof(struct sockaddr_rose); if ((addr = rs_config_get_addr(argv[1])) == NULL) { syslog(LOG_ERR, "invalid Rose port name - %s\n", argv[1]); closelog(); return 1; } if (rose_aton(addr, rosebind.srose_addr.rose_addr) == -1) { syslog(LOG_ERR, "invalid ROSE port address - %s\n", argv[1]); closelog(); return 1; } /* * Copy our DNIC in as default. */ memset(rose_address, 0x00, 11); memcpy(rose_address, addr, 4); for (n = 0; n < ax25peer.fsa_ax25.sax25_ndigis; n++) { addr = ax25_ntoa(&ax25peer.fsa_digipeater[n]); if (strspn(addr, "0123456789-") == strlen(addr)) { if ((p = strchr(addr, '-')) != NULL) *p = '\0'; switch (strlen(addr)) { case 4: memcpy(rose_address + 0, addr, 4); dnicindex = n; break; case 6: memcpy(rose_address + 4, addr, 6); addrindex = n; break; default: break; } } } /* * The user didn't give an address. */ if (addrindex == -1) { strcpy(buffer, "*** No ROSE address given\r"); write(STDOUT_FILENO, buffer, strlen(buffer)); sleep(20); closelog(); return 1; } if (rose_aton(rose_address, roseconnect.srose_addr.rose_addr) == -1) { syslog(LOG_ERR, "invalid Rose address - %s\n", argv[4]); closelog(); return 1; } rosebind.srose_call = ax25peer.fsa_ax25.sax25_call; roseconnect.srose_call = ax25sock.fsa_ax25.sax25_call; /* * A far end digipeater was specified. */ if (addrindex > 0) { roseconnect.srose_ndigis = 1; roseconnect.srose_digi = ax25peer.fsa_digipeater[addrindex - 1]; } /* * Check for a local digipeater. */ if (dnicindex != -1) { if (ax25peer.fsa_ax25.sax25_ndigis - dnicindex > 2) { rosebind.srose_ndigis = 1; rosebind.srose_digi = ax25peer.fsa_digipeater[dnicindex + 2]; } } else { if (ax25peer.fsa_ax25.sax25_ndigis - addrindex > 2) { rosebind.srose_ndigis = 1; rosebind.srose_digi = ax25peer.fsa_digipeater[addrindex + 2]; } } /* * Open the socket into the kernel. */ if ((s = socket(AF_ROSE, SOCK_SEQPACKET, 0)) < 0) { syslog(LOG_ERR, "cannot open ROSE socket, %s\n", strerror(errno)); closelog(); return 1; } /* * Set our AX.25 callsign and Rose address accordingly. */ if (bind(s, (struct sockaddr *)&rosebind, addrlen) != 0) { syslog(LOG_ERR, "cannot bind ROSE socket, %s\n", strerror(errno)); closelog(); close(s); return 1; } if (setsockopt(s, SOL_ROSE, ROSE_QBITINCL, &yes, sizeof(yes)) == -1) { syslog(LOG_ERR, "cannot setsockopt(ROSE_QBITINCL) - %s\n", strerror(errno)); closelog(); close(s); return 1; } if (verbose) { strcpy(buffer, "*** Connection in progress\r"); write(STDOUT_FILENO, buffer, strlen(buffer)); } /* * If no response in 5 minutes, go away. */ alarm(300); signal(SIGALRM, alarm_handler); /* * Lets try and connect to the far end. */ if (connect(s, (struct sockaddr *)&roseconnect, addrlen) != 0) { switch (errno) { case ECONNREFUSED: strcpy(buffer, "*** Disconnected - 0100 - Number Busy\r"); break; case ENETUNREACH: strcpy(buffer, "*** Disconnected - 0D00 - Not Obtainable\r"); break; case EINTR: strcpy(buffer, "*** Disconnected - 3900 - Ship Absent\r"); break; default: sprintf(buffer, "*** Disconnected - %d - %s\r", errno, strerror(errno)); break; } close(s); if (verbose) { write(STDOUT_FILENO, buffer, strlen(buffer)); sleep(20); } return 0; } /* * We got there. */ alarm(0); if (verbose) { strcpy(buffer, "*** Connected\r"); write(STDOUT_FILENO, buffer, strlen(buffer)); } /* * Loop until one end of the connection goes away. */ for (;;) { FD_ZERO(&read_fd); FD_SET(STDIN_FILENO, &read_fd); FD_SET(s, &read_fd); select(s + 1, &read_fd, NULL, NULL, NULL); if (FD_ISSET(s, &read_fd)) { if ((n = read(s, buffer, 512)) == -1) { strcpy(buffer, "\r*** Disconnected - 0000 - DTE Originated\r"); write(STDOUT_FILENO, buffer, strlen(buffer)); break; } if (buffer[0] == 0) { /* Q Bit not set */ buffer[0] = 0xF0; write(STDOUT_FILENO, buffer, n); } else { /* Lose the leading 0x7F */ write(STDOUT_FILENO, buffer + 2, n - 2); } } if (FD_ISSET(STDIN_FILENO, &read_fd)) { if ((n = read(STDIN_FILENO, buffer + 2, sizeof(buffer)-2)) == -1) { close(s); break; } if (buffer[2] == 0xF0) { buffer[2] = 0; write(s, buffer + 2, n); } else { buffer[0] = 1; /* Set Q bit on */ buffer[1] = 0x7F; /* PID Escape */ write(s, buffer, n + 2); } } } closelog(); return 0; } ax25-tools-0.0.10-rc2+cvs20120204/rose/rsattach.c0000644000175000017500000001003211217472623016653 0ustar patpat#include #include #include #include #include #include #include #include #include #include #include #include /* #include */ #include #include /* #include */ #include #include #include #include #include "../pathnames.h" char *address; int mtu = 128; int readconfig(char *port) { FILE *fp; char buffer[90], *s; int n = 0; if ((fp = fopen(CONF_RSPORTS_FILE, "r")) == NULL) { fprintf(stderr, "rsattach: cannot open rsports file\n"); return FALSE; } while (fgets(buffer, 90, fp) != NULL) { n++; if ((s = strchr(buffer, '\n')) != NULL) *s = '\0'; if (strlen(buffer) > 0 && *buffer == '#') continue; if ((s = strtok(buffer, " \t\r\n")) == NULL) { fprintf(stderr, "rsattach: unable to parse line %d of the rsports file\n", n); return FALSE; } if (strcmp(s, port) != 0) continue; if ((s = strtok(NULL, " \t\r\n")) == NULL) { fprintf(stderr, "rsattach: unable to parse line %d of the rsports file\n", n); return FALSE; } address = strdup(s); fclose(fp); return TRUE; } fclose(fp); fprintf(stderr, "rsattach: cannot find port %s in rsports\n", port); return FALSE; } int getfreedev(char *dev) { struct ifreq ifr; int fd; int i; if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("rsattach: socket"); return FALSE; } for (i = 0; i < 6; i++) { sprintf(dev, "rose%d", i); strcpy(ifr.ifr_name, dev); if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { perror("rsattach: SIOCGIFFLAGS"); return FALSE; } if (!(ifr.ifr_flags & IFF_UP)) { close(fd); return TRUE; } } close(fd); return FALSE; } int startiface(char *dev, struct hostent *hp) { struct ifreq ifr; char addr[5]; int fd; if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("rsattach: socket"); return FALSE; } strcpy(ifr.ifr_name, dev); if (hp != NULL) { ifr.ifr_addr.sa_family = AF_INET; ifr.ifr_addr.sa_data[0] = 0; ifr.ifr_addr.sa_data[1] = 0; ifr.ifr_addr.sa_data[2] = hp->h_addr_list[0][0]; ifr.ifr_addr.sa_data[3] = hp->h_addr_list[0][1]; ifr.ifr_addr.sa_data[4] = hp->h_addr_list[0][2]; ifr.ifr_addr.sa_data[5] = hp->h_addr_list[0][3]; ifr.ifr_addr.sa_data[6] = 0; if (ioctl(fd, SIOCSIFADDR, &ifr) < 0) { perror("rsattach: SIOCSIFADDR"); return FALSE; } } if (rose_aton(address, addr) == -1) return FALSE; ifr.ifr_hwaddr.sa_family = ARPHRD_ROSE; memcpy(ifr.ifr_hwaddr.sa_data, addr, 5); if (ioctl(fd, SIOCSIFHWADDR, &ifr) != 0) { perror("rsattach: SIOCSIFHWADDR"); return FALSE; } ifr.ifr_mtu = mtu; if (ioctl(fd, SIOCSIFMTU, &ifr) < 0) { perror("rsattach: SIOCSIFMTU"); return FALSE; } if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { perror("rsattach: SIOCGIFFLAGS"); return FALSE; } ifr.ifr_flags &= IFF_NOARP; ifr.ifr_flags |= IFF_UP; ifr.ifr_flags |= IFF_RUNNING; if (ioctl(fd, SIOCSIFFLAGS, &ifr) < 0) { perror("rsattach: SIOCSIFFLAGS"); return FALSE; } close(fd); return TRUE; } int main(int argc, char *argv[]) { int fd; char dev[64]; struct hostent *hp = NULL; while ((fd = getopt(argc, argv, "i:m:v")) != -1) { switch (fd) { case 'i': if ((hp = gethostbyname(optarg)) == NULL) { fprintf(stderr, "rsattach: invalid internet name/address - %s\n", optarg); return 1; } break; case 'v': printf("rsattach: %s\n", VERSION); return 0; case ':': case '?': fprintf(stderr, "usage: rsattach [-i inetaddr] [-v] port\n"); return 1; } } if ((argc - optind) != 1) { fprintf(stderr, "usage: rsattach [-i inetaddr] [-v] port\n"); return 1; } if (!readconfig(argv[optind])) return 1; if (!getfreedev(dev)) { fprintf(stderr, "rsattach: cannot find free Rose device\n"); return 1; } if (!startiface(dev, hp)) return 1; printf("Rose port %s bound to device %s\n", argv[optind], dev); return 0; } ax25-tools-0.0.10-rc2+cvs20120204/rose/rsdwnlnk.80000644000175000017500000000313707264466573016657 0ustar patpat.TH RSDWNLNK 8 "29 April 1997" Linux "Linux Programmer's Manual" .SH NAME rsdwnlnk \- User exit from the ROSE network. .SH SYNOPSIS .B rsdwnlnk .SH DESCRIPTION .LP The .B rdwnplnk program allows a user to leave the ROSE network using the standard pseudo-digipeating method. Recent Linux kernels are aware of this form of operation and the .B ax25d program can create such connections. The normal mode of operation of a ROSE switch is to have one ROSE address (ie port) per physical AX.25 port. Therefore ROSE users coming in on a given ROSE port will come out of the associated AX.25 port. .LP To use .B rsdwnlnk you need an entry in .B ax25d.conf to listen for incoming ROSE connections to any callsigns that are not matched by the more specific ROSE entries. In the example below, I will be listening for ROSE connections on my ROSE port rs144, the exiting AX.25 connection will be via the associated AX.25 port, 144, using the callsign KE4GAJ-10. Please note that the callsign should be on the same line as the rest of the command, it may be wrapped onto the next line on your screen. .LP # .br {* VIA rs144} .br NOCALL * * * * * * L .br default * * * * * * - root /usr/sbin/rsdwnlnk rsdwnlnk 144 KE4GAJ-10 .br # .LP There would typically be one .B rsdwnlnk per ROSE port. The associated program for entering a ROSE network is .B rsuplnk. .LP All errors generated by .B rsdwnlnk are written to the system debug log file. .SH FILES .br /etc/ax25/axports .SH "SEE ALSO" .BR rose (4), .BR ax25d.conf (5), .BR ax25d (8), .BR rsuplnk (8), .BR rose_call (8). .SH AUTHOR Jonathan Naylor G4KLX ax25-tools-0.0.10-rc2+cvs20120204/rose/rsmemsiz.c0000644000175000017500000001403111005131634016703 0ustar patpat#include #include #include #include #include #include #include #include #include #include #include enum meminfo_row { meminfo_main = 0, meminfo_swap }; enum meminfo_col { meminfo_total = 0, meminfo_used, meminfo_free, meminfo_shared, meminfo_buffers, meminfo_cached }; unsigned read_total_main(void); /* * This code is slightly modified from the procps package. */ #define UPTIME_FILE "/proc/uptime" #define LOADAVG_FILE "/proc/loadavg" #define MEMINFO_FILE "/proc/meminfo" static char buf[300]; /* This macro opens FILE only if necessary and seeks to 0 so that successive calls to the functions are more efficient. It also reads the current contents of the file into the global buf. */ #define FILE_TO_BUF(FILE) { \ static int n, fd = -1; \ if (fd == -1 && (fd = open(FILE, O_RDONLY)) == -1) { \ fprintf(stdout, "ERROR: file %s, %s\r", FILE, strerror(errno)); \ close(fd); \ return 0; \ } \ lseek(fd, 0L, SEEK_SET); \ if ((n = read(fd, buf, sizeof buf - 1)) < 0) { \ fprintf(stdout, "ERROR: file %s, %s\r", FILE, strerror(errno)); \ close(fd); \ fd = -1; \ return 0; \ } \ buf[n] = '\0'; \ } #define SET_IF_DESIRED(x,y) if (x) *(x) = (y) /* evals 'x' twice */ int uptime(double *uptime_secs, double *idle_secs) { double up=0, idle=0; FILE_TO_BUF(UPTIME_FILE) if (sscanf(buf, "%lf %lf", &up, &idle) < 2) { fprintf(stdout, "ERROR: Bad data in %s\r", UPTIME_FILE); return 0; } SET_IF_DESIRED(uptime_secs, up); SET_IF_DESIRED(idle_secs, idle); return up; /* assume never be zero seconds in practice */ } int loadavg(double *av1, double *av5, double *av15) { double avg_1=0, avg_5=0, avg_15=0; FILE_TO_BUF(LOADAVG_FILE) if (sscanf(buf, "%lf %lf %lf", &avg_1, &avg_5, &avg_15) < 3) { fprintf(stdout, "ERROR: Bad data in %s\r", LOADAVG_FILE); return 0; } SET_IF_DESIRED(av1, avg_1); SET_IF_DESIRED(av5, avg_5); SET_IF_DESIRED(av15, avg_15); return 1; } /* The following /proc/meminfo parsing routine assumes the following format: [